⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286582 in webkit


Ignore:
Timestamp:
Dec 6, 2021, 5:19:58 PM (5 years ago)
Author:
wilander@apple.com
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):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r286579 r286582  
     12021-12-06  John Wilander  <wilander@apple.com>
     2
     3        Add WebCore::RegistrableDomain tests for duplicate sub domains
     4        https://bugs.webkit.org/show_bug.cgi?id=233902
     5        <rdar://problem/86130326>
     6
     7        Unreviewed expansion of the RegistrableDomain.MatchesURLs API test.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=233330 claims that duplicate sub domains
     10        such as news.news.example.com causes WebKit's RegistrableDomain matching to fail
     11        and treat same-site content as cross-site. This patch add tests of such duplicate
     12        sub domains.
     13
     14        * TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp:
     15        (TestWebKitAPI::TEST):
     16
    1172021-12-06  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp

    r244884 r286582  
    5959    URL webkitURLWithPath { URL(), "https://webkit.org/road/to/nowhere/" };
    6060    URL webkitSubdomainURL { URL(), "https://sub.domain.webkit.org" };
     61    URL webkitOtherSubdomainURL { URL(), "https://sub.other.webkit.org" };
     62    URL webkitDuplicateSubdomainURL { URL(), "https://domain.domain.webkit.org" };
    6163    URL webkitSubdomainURLWithPath { URL(), "https://sub.domain.webkit.org/road/to/nowhere/" };
    6264    RegistrableDomain webkitDomain { webkitURL };
     65    RegistrableDomain webkitSubdomain { webkitSubdomainURL };
    6366
    6467    ASSERT_TRUE(webkitDomain.matches(webkitURL));
    6568    ASSERT_TRUE(webkitDomain.matches(webkitURLWithPath));
    6669    ASSERT_TRUE(webkitDomain.matches(webkitSubdomainURL));
     70    ASSERT_TRUE(webkitDomain.matches(webkitDuplicateSubdomainURL));
    6771    ASSERT_TRUE(webkitDomain.matches(webkitSubdomainURLWithPath));
     72    ASSERT_TRUE(webkitSubdomain.matches(webkitOtherSubdomainURL));
     73    ASSERT_TRUE(webkitSubdomain.matches(webkitDuplicateSubdomainURL));
    6874
    6975    URL localhostURL { URL(), "http://localhost" };
Note: See TracChangeset for help on using the changeset viewer.