Title: [254386] trunk/LayoutTests
Revision
254386
Author
[email protected]
Date
2020-01-10 17:52:56 -0800 (Fri, 10 Jan 2020)

Log Message

Make http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins* use resource/util.js
https://bugs.webkit.org/show_bug.cgi?id=206100
<rdar://problem/58492335>

Unreviewed test gardening.


* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html:
    These two tests now use setEnableFeature() in resources/util.js which makes sure
    testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned() is called with
    false before ending the test.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (254385 => 254386)


--- trunk/LayoutTests/ChangeLog	2020-01-11 01:29:02 UTC (rev 254385)
+++ trunk/LayoutTests/ChangeLog	2020-01-11 01:52:56 UTC (rev 254386)
@@ -1,3 +1,17 @@
+2020-01-10  John Wilander  <[email protected]>
+
+        Make http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins* use resource/util.js
+        https://bugs.webkit.org/show_bug.cgi?id=206100
+        <rdar://problem/58492335>
+
+        Unreviewed test gardening.
+
+        * http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html:
+        * http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html:
+            These two tests now use setEnableFeature() in resources/util.js which makes sure 
+            testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned() is called with
+            false before ending the test.
+
 2020-01-10  Ryan Haddad  <[email protected]>
 
         3 editing/spelling test failures on Mojave Release WK1

Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html (254385 => 254386)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html	2020-01-11 01:29:02 UTC (rev 254385)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-database.html	2020-01-11 01:52:56 UTC (rev 254386)
@@ -4,8 +4,9 @@
     <meta charset="UTF-8">
     <title>Tests for Classification Based on Sub Frame Under Top Frame Origins</title>
     <script src=""
+    <script src=""
 </head>
-<body>
+<body _onload_="run()">
 <script>
     const hostUnderTest = "127.0.0.1:8000";
     const statisticsUrl = "http://" + hostUnderTest + "/temp";
@@ -19,14 +20,12 @@
         else
             testPassed("Host did not get classified as prevalent resource.");
 
-        testRunner.statisticsResetToConsistentState(function() {
+        setEnableFeature(false, function() {
             testRunner.notifyDone();
         });
     }
 
     function runTestRunnerTest() {
-        testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
-
         testRunner.setStatisticsPrevalentResource(statisticsUrl, false, function() {
             if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
                 testFailed("Host did not get set as non-prevalent resource.");
@@ -42,11 +41,12 @@
         });
     }
 
-    if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
-        testRunner.setUseITPDatabase(true);
-        testRunner.waitUntilDone();
-        internals.setResourceLoadStatisticsEnabled(true);
-        runTestRunnerTest();
+    function run() {
+        if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
+            testRunner.setUseITPDatabase(true);
+            testRunner.waitUntilDone();
+            setEnableFeature(true, runTestRunnerTest);
+        }
     }
 </script>
 </body>

Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html (254385 => 254386)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html	2020-01-11 01:29:02 UTC (rev 254385)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html	2020-01-11 01:52:56 UTC (rev 254386)
@@ -4,8 +4,9 @@
     <meta charset="UTF-8">
     <title>Tests for Classification Based on Sub Frame Under Top Frame Origins</title>
     <script src=""
+    <script src=""
 </head>
-<body>
+<body _onload_="run()">
 <script>
     const hostUnderTest = "127.0.0.1:8000";
     const statisticsUrl = "http://" + hostUnderTest + "/temp";
@@ -19,14 +20,12 @@
         else
             testPassed("Host did not get classified as prevalent resource.");
 
-        testRunner.statisticsResetToConsistentState(function() {
+        setEnableFeature(false, function() {
             testRunner.notifyDone();
         });
     }
 
     function runTestRunnerTest() {
-        testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
-
         testRunner.setStatisticsPrevalentResource(statisticsUrl, false, function() {
             if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
                 testFailed("Host did not get set as non-prevalent resource.");
@@ -42,10 +41,11 @@
         });
     }
 
-    if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
-        testRunner.waitUntilDone();
-        internals.setResourceLoadStatisticsEnabled(true);
-        runTestRunnerTest();
+    function run() {
+        if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
+            testRunner.waitUntilDone();
+            setEnableFeature(true, runTestRunnerTest);
+        }
     }
 </script>
 </body>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to