Re-enable URLParser for non-Safari Cocoa apps after r207321
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Oct 2016 00:47:39 +0000 (00:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Oct 2016 00:47:39 +0000 (00:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163690

Patch by Alex Christensen <achristensen@webkit.org> on 2016-10-19
Reviewed by Darin Adler.

Source/WebCore:

I disabled the URLParser for non-Safari applications in r207305
to give me time to make URLParser more compatible, which I did in r207321

Updated some API tests which will be investigated in
https://bugs.webkit.org/show_bug.cgi?id=163127

* platform/URLParser.cpp:
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setURLParserEnabled): Deleted.
* testing/js/WebCoreTestSupport.h:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(DumpRenderTreeMain):
* TestWebKitAPI/Tests/WebKit2Cocoa/LoadInvalidURLRequest.mm:
(-[LoadInvalidURLNavigationActionDelegate webView:didFailProvisionalNavigation:withError:]):
* TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm:
(TestWebKitAPI::TEST):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::TestController):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/URLParser.cpp
Source/WebCore/testing/js/WebCoreTestSupport.cpp
Source/WebCore/testing/js/WebCoreTestSupport.h
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LoadInvalidURLRequest.mm
Tools/TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm
Tools/WebKitTestRunner/TestController.cpp

index ca1bd17..709b894 100644 (file)
@@ -1,3 +1,23 @@
+2016-10-19  Alex Christensen  <achristensen@webkit.org>
+
+        Re-enable URLParser for non-Safari Cocoa apps after r207321
+        https://bugs.webkit.org/show_bug.cgi?id=163690
+
+        Reviewed by Darin Adler.
+
+        I disabled the URLParser for non-Safari applications in r207305
+        to give me time to make URLParser more compatible, which I did in r207321
+
+        Updated some API tests which will be investigated in 
+        https://bugs.webkit.org/show_bug.cgi?id=163127
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::setEnabled):
+        (WebCore::URLParser::enabled):
+        * testing/js/WebCoreTestSupport.cpp:
+        (WebCoreTestSupport::setURLParserEnabled): Deleted.
+        * testing/js/WebCoreTestSupport.h:
+
 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
 
         CSS font-variation-settings does not handle uppercase axis names in variable fonts
index 2e20be9..9656bf8 100644 (file)
@@ -2843,31 +2843,16 @@ bool URLParser::internalValuesConsistent(const URL& url)
     // It should be able to be deduced from m_isValid and m_string.length() to save memory.
 }
 
-enum class URLParserEnabled {
-    Undetermined,
-    Yes,
-    No
-};
-
-static URLParserEnabled urlParserEnabled = URLParserEnabled::Undetermined;
+static bool urlParserEnabled = true;
 
 void URLParser::setEnabled(bool enabled)
 {
-    urlParserEnabled = enabled ? URLParserEnabled::Yes : URLParserEnabled::No;
+    urlParserEnabled = enabled;
 }
 
 bool URLParser::enabled()
 {
-    if (urlParserEnabled == URLParserEnabled::Undetermined) {
-#if PLATFORM(MAC)
-        urlParserEnabled = MacApplication::isSafari() ? URLParserEnabled::Yes : URLParserEnabled::No;
-#elif PLATFORM(IOS)
-        urlParserEnabled = IOSApplication::isMobileSafari() ? URLParserEnabled::Yes : URLParserEnabled::No;
-#else
-        urlParserEnabled = URLParserEnabled::Yes;
-#endif
-    }
-    return urlParserEnabled == URLParserEnabled::Yes;
+    return urlParserEnabled;
 }
 
 } // namespace WebCore
index cfc57ce..faffd0c 100644 (file)
@@ -121,11 +121,6 @@ void setAllowsAnySSLCertificate(bool allowAnySSLCertificate)
     InternalSettings::setAllowsAnySSLCertificate(allowAnySSLCertificate);
 }
 
-void setURLParserEnabled(bool enabled)
-{
-    URLParser::setEnabled(enabled);
-}
-
 void installMockGamepadProvider()
 {
 #if ENABLE(GAMEPAD)
index 099dcd8..e2976a0 100644 (file)
@@ -56,7 +56,6 @@ void clearWheelEventTestTrigger(WebCore::Frame&) TEST_SUPPORT_EXPORT;
 void setLogChannelToAccumulate(const WTF::String& name) TEST_SUPPORT_EXPORT;
 void initializeLogChannelsIfNecessary() TEST_SUPPORT_EXPORT;
 void setAllowsAnySSLCertificate(bool) TEST_SUPPORT_EXPORT;
-void setURLParserEnabled(bool) TEST_SUPPORT_EXPORT;
 
 void installMockGamepadProvider() TEST_SUPPORT_EXPORT;
 void connectMockGamepad(unsigned index) TEST_SUPPORT_EXPORT;
index 1167cd5..4694e18 100644 (file)
@@ -1,3 +1,19 @@
+2016-10-19  Alex Christensen  <achristensen@webkit.org>
+
+        Re-enable URLParser for non-Safari Cocoa apps after r207321
+        https://bugs.webkit.org/show_bug.cgi?id=163690
+
+        Reviewed by Darin Adler.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (DumpRenderTreeMain):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/LoadInvalidURLRequest.mm:
+        (-[LoadInvalidURLNavigationActionDelegate webView:didFailProvisionalNavigation:withError:]):
+        * TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm:
+        (TestWebKitAPI::TEST):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::TestController):
+
 2016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r207557.
index 0951e4d..ab7b156 100644 (file)
@@ -1411,7 +1411,6 @@ void atexitFunction()
 
 int DumpRenderTreeMain(int argc, const char *argv[])
 {
-    WebCoreTestSupport::setURLParserEnabled(true);
     atexit(atexitFunction);
 
 #if PLATFORM(IOS)
index b239575..101fe24 100644 (file)
@@ -54,8 +54,8 @@ static NSURL *literalURL(const char* literal)
 
 - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error
 {
-    EXPECT_WK_STREQ(error.domain, @"WebKitErrorDomain");
-    EXPECT_EQ(error.code, WebKitErrorCannotShowURL);
+    EXPECT_WK_STREQ(error.domain, @"NSURLErrorDomain");
+    EXPECT_EQ(error.code, -1003);
     EXPECT_TRUE([error.userInfo[@"NSErrorFailingURLKey"] isEqual:literalURL(literal)]);
 
     didFailProvisionalLoad = true;
index 29f2dcc..f3da489 100644 (file)
@@ -77,7 +77,7 @@ TEST(WebKit1, LoadInvalidURLRequest)
         didFailProvisionalLoad = false;
         Util::run(&didFinishTest);
 
-        EXPECT_TRUE(didFailProvisionalLoad);
+        EXPECT_FALSE(didFailProvisionalLoad);
     }
 }
 
index 803ccc0..94722ae 100644 (file)
@@ -115,7 +115,6 @@ TestController& TestController::singleton()
 
 TestController::TestController(int argc, const char* argv[])
 {
-    WebCoreTestSupport::setURLParserEnabled(true);
     initialize(argc, argv);
     controller = this;
     run();