Title: [286582] trunk/Tools
Revision
286582
Author
[email protected]
Date
2021-12-06 17:19:58 -0800 (Mon, 06 Dec 2021)

Log Message

Add WebCore::RegistrableDomain tests for duplicate sub domains
https://bugs.webkit.org/show_bug.cgi?id=233902
<rdar://problem/86130326>

Unreviewed expansion of the RegistrableDomain.MatchesURLs API test.

https://bugs.webkit.org/show_bug.cgi?id=233330 claims that duplicate sub domains
such as news.news.example.com causes WebKit's RegistrableDomain matching to fail
and treat same-site content as cross-site. This patch add tests of such duplicate
sub domains.


* TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (286581 => 286582)


--- trunk/Tools/ChangeLog	2021-12-07 01:15:26 UTC (rev 286581)
+++ trunk/Tools/ChangeLog	2021-12-07 01:19:58 UTC (rev 286582)
@@ -1,3 +1,19 @@
+2021-12-06  John Wilander  <[email protected]>
+
+        Add WebCore::RegistrableDomain tests for duplicate sub domains
+        https://bugs.webkit.org/show_bug.cgi?id=233902
+        <rdar://problem/86130326>
+
+        Unreviewed expansion of the RegistrableDomain.MatchesURLs API test.
+
+        https://bugs.webkit.org/show_bug.cgi?id=233330 claims that duplicate sub domains
+        such as news.news.example.com causes WebKit's RegistrableDomain matching to fail
+        and treat same-site content as cross-site. This patch add tests of such duplicate
+        sub domains.
+
+        * TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp:
+        (TestWebKitAPI::TEST):
+
 2021-12-06  Brady Eidson  <[email protected]>
 
         webpushd/webpushtool debugging additions

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp (286581 => 286582)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp	2021-12-07 01:15:26 UTC (rev 286581)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp	2021-12-07 01:19:58 UTC (rev 286582)
@@ -58,13 +58,19 @@
     URL webkitURL { URL(), "https://webkit.org" };
     URL webkitURLWithPath { URL(), "https://webkit.org/road/to/nowhere/" };
     URL webkitSubdomainURL { URL(), "https://sub.domain.webkit.org" };
+    URL webkitOtherSubdomainURL { URL(), "https://sub.other.webkit.org" };
+    URL webkitDuplicateSubdomainURL { URL(), "https://domain.domain.webkit.org" };
     URL webkitSubdomainURLWithPath { URL(), "https://sub.domain.webkit.org/road/to/nowhere/" };
     RegistrableDomain webkitDomain { webkitURL };
+    RegistrableDomain webkitSubdomain { webkitSubdomainURL };
 
     ASSERT_TRUE(webkitDomain.matches(webkitURL));
     ASSERT_TRUE(webkitDomain.matches(webkitURLWithPath));
     ASSERT_TRUE(webkitDomain.matches(webkitSubdomainURL));
+    ASSERT_TRUE(webkitDomain.matches(webkitDuplicateSubdomainURL));
     ASSERT_TRUE(webkitDomain.matches(webkitSubdomainURLWithPath));
+    ASSERT_TRUE(webkitSubdomain.matches(webkitOtherSubdomainURL));
+    ASSERT_TRUE(webkitSubdomain.matches(webkitDuplicateSubdomainURL));
 
     URL localhostURL { URL(), "http://localhost" };
     URL localhostURLWithPath { URL(), "http://localhost/road/to/nowhere/" };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to