Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Unified Diff: net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc

Issue 1783813002: SameSite: Strict/Lax behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@strict-lax
Patch Set: Comment. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/registry_controlled_domains/registry_controlled_domain.cc ('k') | net/cookies/canonical_cookie.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
diff --git a/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc b/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
index 42af173b584a122bd7bb383b06be705920338bc7..0d553cb255b3b8f79a4a1c95dd2fad807323a986 100644
--- a/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
+++ b/net/base/registry_controlled_domains/registry_controlled_domain_unittest.cc
@@ -5,6 +5,7 @@
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
+#include "url/origin.h"
namespace {
namespace test1 {
@@ -67,12 +68,6 @@ size_t GetRegistryLengthFromHostIncludingPrivate(
return GetRegistryLength(host, unknown_filter, INCLUDE_PRIVATE_REGISTRIES);
}
-bool CompareDomains(const std::string& url1, const std::string& url2) {
- GURL g1 = GURL(url1);
- GURL g2 = GURL(url2);
- return SameDomainOrHost(g1, g2, EXCLUDE_PRIVATE_REGISTRIES);
-}
-
} // namespace
class RegistryControlledDomainTest : public testing::Test {
@@ -82,6 +77,17 @@ class RegistryControlledDomainTest : public testing::Test {
SetFindDomainGraph(graph, sizeof(Graph));
}
+ bool CompareDomains(const std::string& url1, const std::string& url2) {
+ SCOPED_TRACE(url1 + " " + url2);
+ GURL g1 = GURL(url1);
+ GURL g2 = GURL(url2);
+ url::Origin o1 = url::Origin(g1);
+ url::Origin o2 = url::Origin(g2);
+ EXPECT_EQ(SameDomainOrHost(o1, o2, EXCLUDE_PRIVATE_REGISTRIES),
+ SameDomainOrHost(g1, g2, EXCLUDE_PRIVATE_REGISTRIES));
+ return SameDomainOrHost(g1, g2, EXCLUDE_PRIVATE_REGISTRIES);
+ }
+
void TearDown() override { SetFindDomainGraph(); }
};
« no previous file with comments | « net/base/registry_controlled_domains/registry_controlled_domain.cc ('k') | net/cookies/canonical_cookie.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698