REGRESSION(r240541): WebKit.WebsitePoliciesCustomJavaScriptUserAgent is failing since...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 03:56:19 +0000 (03:56 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 03:56:19 +0000 (03:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193979

Reviewed by Wenson Hsieh.

Fix the test for iOS. Make the test work with iOS UA string.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:

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

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm

index 9779d9c..2d2b069 100644 (file)
@@ -1,3 +1,14 @@
+2019-01-30  Ryosuke Niwa  <rniwa@webkit.org>
+
+        REGRESSION(r240541): WebKit.WebsitePoliciesCustomJavaScriptUserAgent is failing since introduction on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=193979
+
+        Reviewed by Wenson Hsieh.
+
+        Fix the test for iOS. Make the test work with iOS UA string.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
+
 2019-01-30  Ryan Haddad  <ryanhaddad@apple.com>
 
         Replace High Sierra LLINT CLoop bot due to hardware failure
index db166c2..b8b6c6f 100644 (file)
@@ -1139,8 +1139,8 @@ TEST(WebKit, WebsitePoliciesCustomJavaScriptUserAgent)
     [schemeHandler addMappingFromURLString:@"test://www.apple.com/subframe.html" toData:customUserAgentSubFrameTestBytes];
     [schemeHandler setTaskHandler:[](id <WKURLSchemeTask> task) {
         auto* userAgentString = [task.request valueForHTTPHeaderField:@"User-Agent"];
-        EXPECT_TRUE([userAgentString hasPrefix:@"Mozilla/5.0 (Macintosh;"]);
-        EXPECT_TRUE([userAgentString hasSuffix:@"(KHTML, like Gecko)"]);
+        EXPECT_TRUE([userAgentString hasPrefix:@"Mozilla/5.0 "]);
+        EXPECT_TRUE([userAgentString containsString:@"(KHTML, like Gecko)"]);
     }];
     [configuration setURLSchemeHandler:schemeHandler.get() forURLScheme:@"test"];
     [configuration preferences]._needsSiteSpecificQuirks = YES;