Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatistic...
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / user-interaction-only-reported-once-within-short-period-of-time.html
index 09806f4..a30b228 100644 (file)
         shouldBeTrue("testRunner.isStatisticsHasHadUserInteraction(topFrameOrigin)");
         shouldBeFalse("testRunner.isStatisticsHasHadUserInteraction(subFrameOrigin)");
 
-        if (testRunner)
-            testRunner.setStatisticsHasHadUserInteraction(topFrameOrigin, false);
+        if (testRunner) {
+            testRunner.setStatisticsHasHadUserInteraction(topFrameOrigin, false, function() {
+                shouldBeFalse("testRunner.isStatisticsHasHadUserInteraction(topFrameOrigin)");
 
-        shouldBeFalse("testRunner.isStatisticsHasHadUserInteraction(topFrameOrigin)");
-
-        activateElement("testElement", finishTest);
+                activateElement("testElement", finishTest);
+            });
+        }
     }
 
     function finishTest() {