Title: [244668] trunk/Tools
Revision
244668
Author
[email protected]
Date
2019-04-25 15:41:59 -0700 (Thu, 25 Apr 2019)

Log Message

DumpRenderTree doesn't call Internals::resetToConsistentState() before the first test
https://bugs.webkit.org/show_bug.cgi?id=197273

Reviewed by Dean Jackson.

Reorder code so that we create gTestRunner before calling resetWebViewToConsistentStateBeforeTesting(),
so that WebCoreTestSupport::resetInternalsObject() is always run.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):
(runTest):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (244667 => 244668)


--- trunk/Tools/ChangeLog	2019-04-25 22:09:27 UTC (rev 244667)
+++ trunk/Tools/ChangeLog	2019-04-25 22:41:59 UTC (rev 244668)
@@ -118,6 +118,20 @@
         * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm: Add a test that POSTs all sorts of things
           from an XHR to a custom protocol.
 
+2019-04-25  Simon Fraser  <[email protected]>
+
+        DumpRenderTree doesn't call Internals::resetToConsistentState() before the first test
+        https://bugs.webkit.org/show_bug.cgi?id=197273
+
+        Reviewed by Dean Jackson.
+
+        Reorder code so that we create gTestRunner before calling resetWebViewToConsistentStateBeforeTesting(),
+        so that WebCoreTestSupport::resetInternalsObject() is always run.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebViewToConsistentStateBeforeTesting):
+        (runTest):
+
 2019-04-24  John Wilander  <[email protected]>
 
         Age out unconverted Ad Click Attributions after one week.

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (244667 => 244668)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2019-04-25 22:09:27 UTC (rev 244667)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2019-04-25 22:41:59 UTC (rev 244668)
@@ -1882,13 +1882,13 @@
 
     setlocale(LC_ALL, "");
 
-    if (gTestRunner) {
-        gTestRunner->resetPageVisibility();
-        WebCoreTestSupport::resetInternalsObject([mainFrame globalContext]);
-        // in the case that a test using the chrome input field failed, be sure to clean up for the next test
-        gTestRunner->removeChromeInputField();
-    }
+    ASSERT(gTestRunner);
+    gTestRunner->resetPageVisibility();
+    // In the case that a test using the chrome input field failed, be sure to clean up for the next test.
+    gTestRunner->removeChromeInputField();
 
+    WebCoreTestSupport::resetInternalsObject([mainFrame globalContext]);
+
 #if !PLATFORM(IOS_FAMILY)
     if (WebCore::Frame* frame = [webView _mainCoreFrame])
         WebCoreTestSupport::clearWheelEventTestTrigger(*frame);
@@ -2005,18 +2005,18 @@
     }
     mainFrameTestOptions = options;
 
+    const char* testURL([[url absoluteString] UTF8String]);
+    gTestRunner = TestRunner::create(testURL, command.expectedPixelHash);
+    gTestRunner->setAllowedHosts(allowedHosts);
+    gTestRunner->setCustomTimeout(command.timeout);
+    gTestRunner->setDumpJSConsoleLogInStdErr(command.dumpJSConsoleLogInStdErr || options.dumpJSConsoleLogInStdErr);
+
     resetWebViewToConsistentStateBeforeTesting(options);
 
-    const char* testURL([[url absoluteString] UTF8String]);
-
 #if !PLATFORM(IOS_FAMILY)
     changeWindowScaleIfNeeded(testURL);
 #endif
 
-    gTestRunner = TestRunner::create(testURL, command.expectedPixelHash);
-    gTestRunner->setAllowedHosts(allowedHosts);
-    gTestRunner->setCustomTimeout(command.timeout);
-    gTestRunner->setDumpJSConsoleLogInStdErr(command.dumpJSConsoleLogInStdErr || options.dumpJSConsoleLogInStdErr);
     topLoadingFrame = nil;
 #if !PLATFORM(IOS_FAMILY)
     ASSERT(!draggingInfo); // the previous test should have called eventSender.mouseUp to drop!
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to