Resource Load Statistics: Make it possible exclude localhost from classification
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / resources / util.js
1 function setEnableFeature(enable, completionHandler) {
2     if (typeof completionHandler !== "function")
3         testFailed("setEnableFeature() requires a completion handler function.");
4     testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(enable);
5     if (enable) {
6         internals.setResourceLoadStatisticsEnabled(true);
7         testRunner.setStatisticsIsRunningTest(true);
8         completionHandler();
9     } else {
10         testRunner.statisticsResetToConsistentState(function() {
11             testRunner.setStatisticsIsRunningTest(false);
12             internals.setResourceLoadStatisticsEnabled(false);
13             completionHandler();
14         });
15     }
16 }