WebKit2 needs layoutTestController.setDeferMainResourceDataLoad
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2016 19:27:24 +0000 (19:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2016 19:27:24 +0000 (19:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=42777

Patch by Jonathan Bedard <jbedard@apple.com> on 2016-08-24
Reviewed by Darin Adler.

The setDeferMainResourceDataLoad method was not correctly tested in DumpRenderTree and would pass even when setDeterMainResourceDataLoad was not called.  Removed function and test.

Tools:

* DumpRenderTree/TestRunner.cpp:
(setDeferMainResourceDataLoadCallback): Removed setDeferMainResourceDataLoad.
* DumpRenderTree/TestRunner.h:
(TestRunner::deferMainResourceDataLoad): Ditto.
(TestRunner::setDeferMainResourceDataLoad): Ditto.
* DumpRenderTree/mac/ResourceLoadDelegate.mm: Ditto.

LayoutTests:

* fast/loader/non-deferred-substitute-load-expected.txt: Removed fast/loader/non-deferred-substitute-load.html.
* fast/loader/non-deferred-substitute-load.html: Ditto.
* platform/ios-simulator-wk2/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.
* platform/wk2/TestExpectations: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204918 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/loader/non-deferred-substitute-load-expected.txt [deleted file]
LayoutTests/fast/loader/non-deferred-substitute-load.html [deleted file]
LayoutTests/platform/ios-simulator-wk2/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wk2/TestExpectations
Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.cpp
Tools/DumpRenderTree/TestRunner.h
Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm

index cebc5ad..5f86bc3 100644 (file)
@@ -1,3 +1,18 @@
+2016-08-24  Jonathan Bedard  <jbedard@apple.com>
+
+        WebKit2 needs layoutTestController.setDeferMainResourceDataLoad
+        https://bugs.webkit.org/show_bug.cgi?id=42777
+
+        Reviewed by Darin Adler.
+
+        The setDeferMainResourceDataLoad method was not correctly tested in DumpRenderTree and would pass even when setDeterMainResourceDataLoad was not called.  Removed function and test.
+
+        * fast/loader/non-deferred-substitute-load-expected.txt: Removed fast/loader/non-deferred-substitute-load.html.
+        * fast/loader/non-deferred-substitute-load.html: Ditto.
+        * platform/ios-simulator-wk2/TestExpectations: Ditto.
+        * platform/win/TestExpectations: Ditto.
+        * platform/wk2/TestExpectations: Ditto.
+
 2016-08-24  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, temporarily skipping W3C tests trying to load www1.localhost.
diff --git a/LayoutTests/fast/loader/non-deferred-substitute-load-expected.txt b/LayoutTests/fast/loader/non-deferred-substitute-load-expected.txt
deleted file mode 100644 (file)
index 8072cf2..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-ALERT: Triggering bug through JS-alert
-PASS
diff --git a/LayoutTests/fast/loader/non-deferred-substitute-load.html b/LayoutTests/fast/loader/non-deferred-substitute-load.html
deleted file mode 100644 (file)
index 63798da..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<p>This tests that using substitute load in combination with non-deferred main resource loading will not cause
-assertions or duplicate loads, which can happen if the substitute document contains JavaScript-alerts.</p>
-<script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.setDeferMainResourceDataLoad(false);
-    testRunner.queueLoadHTMLString("<script>if (typeof(hasBeenLoaded) != 'undefined') {" +
-        "document.getElementById('result').innerHTML = 'FAILURE';" +
-    "} else { " +
-        "hasBeenLoaded = true; document.write('<div id=result>PASS</div>'); alert('Triggering bug through JS-alert'); }" +
-    "<\/script>");
-} else
-    document.write('This test must be run by DumpRenderTree!')
-</script>
-
index fc2d99e..9dfd143 100644 (file)
@@ -522,7 +522,6 @@ fast/images/image-map-multiple.html [ Failure ]
 fast/images/image-map-zoom.html [ Failure ]
 fast/images/imagemap-dynamic-area-updates.html [ Failure ]
 fast/inline/relative-positioned-overflow.html [ Failure ]
-fast/loader/non-deferred-substitute-load.html [ Failure ]
 fast/loader/policy-delegate-action-hit-test-zoomed.html [ Failure ]
 fast/loader/repeat-same-document-navigation.html [ Failure ]
 fast/regions/assert-hit-test-image.html [ Failure ]
index 1781ee9..e4d6baa 100644 (file)
@@ -2531,9 +2531,6 @@ printing/return-from-printing-mode.html
 webkit.org/b/140866 fast/repaint/obscured-background-no-repaint.html [ Failure ]
 [ Debug ] fast/repaint/animation-after-layer-scroll.html [ Failure ]
 
-# Main frame document does not match cached page document:
-webkit.org/b/140871 [ Debug ] fast/loader/non-deferred-substitute-load.html [ Skip ]
-
 [ Release ] platform/win/fast/text/uniscribe-missing-glyph.html [ Failure ]
 [ Debug ] platform/win/fast/text/uniscribe-missing-glyph.html [ Skip ] # Debug assertion
 
index edb3afe..425f0ce 100644 (file)
@@ -150,10 +150,6 @@ http/tests/security/no-referrer.html
 # <https://bugs.webkit.org/show_bug.cgi?id=42700>
 http/tests/security/setDomainRelaxationForbiddenForURLScheme.html
 
-# WebKit2 needs testRunner.setDeferMainResourceDataLoad
-# <https://bugs.webkit.org/show_bug.cgi?id=42777>
-fast/loader/non-deferred-substitute-load.html
-
 # WebKitTestRunner needs testRunner.removeAllVisitedLinks
 http/tests/globalhistory/history-delegate-basic-visited-links.html
 
index 9b0170a..5f382de 100644 (file)
@@ -1,3 +1,19 @@
+2016-08-24  Jonathan Bedard  <jbedard@apple.com>
+
+        WebKit2 needs layoutTestController.setDeferMainResourceDataLoad
+        https://bugs.webkit.org/show_bug.cgi?id=42777
+
+        Reviewed by Darin Adler.
+
+        The setDeferMainResourceDataLoad method was not correctly tested in DumpRenderTree and would pass even when setDeterMainResourceDataLoad was not called.  Removed function and test.
+
+        * DumpRenderTree/TestRunner.cpp:
+        (setDeferMainResourceDataLoadCallback): Removed setDeferMainResourceDataLoad.
+        * DumpRenderTree/TestRunner.h:
+        (TestRunner::deferMainResourceDataLoad): Ditto.
+        (TestRunner::setDeferMainResourceDataLoad): Ditto.
+        * DumpRenderTree/mac/ResourceLoadDelegate.mm: Ditto.
+
 2016-08-23  Anders Carlsson  <andersca@apple.com>
 
         Add enum traits and use them in the IPC::Decoder
index db97dd4..4c9b991 100644 (file)
@@ -107,7 +107,6 @@ TestRunner::TestRunner(const std::string& testURL, const std::string& expectedPi
     , m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges(false)
     , m_handlesAuthenticationChallenges(false)
     , m_isPrinting(false)
-    , m_deferMainResourceDataLoad(true)
     , m_useDeferredFrameLoading(false)
     , m_shouldPaintBrokenImage(true)
     , m_shouldStayOnPageAfterHandlingBeforeUnload(false)
@@ -914,18 +913,6 @@ static JSValueRef setDatabaseQuotaCallback(JSContextRef context, JSObjectRef fun
     return JSValueMakeUndefined(context);
 }
 
-static JSValueRef setDeferMainResourceDataLoadCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
-    // Has Mac and Windows implementation
-    if (argumentCount < 1)
-        return JSValueMakeUndefined(context);
-
-    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
-    controller->setDeferMainResourceDataLoad(JSValueToBoolean(context, arguments[0]));
-
-    return JSValueMakeUndefined(context);
-}
-
 static JSValueRef setDefersLoadingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     if (argumentCount < 1)
@@ -2150,7 +2137,6 @@ JSStaticFunction* TestRunner::staticFunctions()
         { "setCloseRemainingWindowsWhenComplete", setCloseRemainingWindowsWhenCompleteCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setCustomPolicyDelegate", setCustomPolicyDelegateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setDatabaseQuota", setDatabaseQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 
-        { "setDeferMainResourceDataLoad", setDeferMainResourceDataLoadCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setDefersLoading", setDefersLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setUseDeferredFrameLoading", setUseDeferredFrameLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setDomainRelaxationForbiddenForURLScheme", setDomainRelaxationForbiddenForURLSchemeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
index 854ec28..2527587 100644 (file)
@@ -295,9 +295,6 @@ public:
     double databaseMaxQuota() const { return m_databaseMaxQuota; }
     void setDatabaseMaxQuota(double quota) { m_databaseMaxQuota = quota; }
 
-    bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; }
-    void setDeferMainResourceDataLoad(bool flag) { m_deferMainResourceDataLoad = flag; }
-
     bool useDeferredFrameLoading() const { return m_useDeferredFrameLoading; }
     void setUseDeferredFrameLoading(bool flag) { m_useDeferredFrameLoading = flag; }
 
@@ -431,7 +428,6 @@ private:
     bool m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges;
     bool m_handlesAuthenticationChallenges;
     bool m_isPrinting;
-    bool m_deferMainResourceDataLoad;
     bool m_useDeferredFrameLoading;
     bool m_shouldPaintBrokenImage;
     bool m_shouldStayOnPageAfterHandlingBeforeUnload;
index 2b74e72..cde6886 100644 (file)
@@ -150,10 +150,6 @@ BOOL isAllowedHost(NSString *host)
         printf("%s\n", [string UTF8String]);
     }
 
-    if (!done && !gTestRunner->deferMainResourceDataLoad()) {
-        [dataSource _setDeferMainResourceDataLoad:false];
-    }
-
     if (!done && gTestRunner->willSendRequestReturnsNull())
         return nil;