| function setEnableFeature(enable, completionHandler) { |
| if (typeof completionHandler !== "function") |
| testFailed("setEnableFeature() requires a completion handler function."); |
| if (enable) { |
| internals.setResourceLoadStatisticsEnabled(true); |
| testRunner.setStatisticsIsRunningTest(true); |
| completionHandler(); |
| } else { |
| testRunner.statisticsResetToConsistentState(function() { |
| testRunner.setStatisticsIsRunningTest(false); |
| internals.setResourceLoadStatisticsEnabled(false); |
| testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(false); |
| completionHandler(); |
| }); |
| } |
| } |