| Index: net/cookies/cookie_util_unittest.cc
|
| diff --git a/net/cookies/cookie_util_unittest.cc b/net/cookies/cookie_util_unittest.cc
|
| index fc2763146c9f7287261562ef3e17ffb642764ac1..4b4f5a6ea2e238940d7722eadbabed59a2ad0e9d 100644
|
| --- a/net/cookies/cookie_util_unittest.cc
|
| +++ b/net/cookies/cookie_util_unittest.cc
|
| @@ -7,6 +7,8 @@
|
| #include <vector>
|
|
|
| #include "base/basictypes.h"
|
| +#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
| +#include "net/base/registry_controlled_domains/test_util.h"
|
| #include "net/cookies/cookie_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -43,8 +45,6 @@ void CheckSerialize(
|
| EXPECT_EQ(str_expected, net::cookie_util::SerializeRequestCookieLine(prc));
|
| }
|
|
|
| -} // namespace
|
| -
|
| TEST(CookieUtilTest, TestDomainIsHostOnly) {
|
| const struct {
|
| const char* str;
|
| @@ -194,3 +194,26 @@ TEST(CookieUtilTest, TestRequestCookieParsing) {
|
| CheckSerialize(tests[i].parsed, tests[i].str);
|
| }
|
| }
|
| +
|
| +class CookieUtilDomainTest : public testing::Test {
|
| + protected:
|
| + void SetUp() override {
|
| + net::test::registry_controlled_domains::SetFindDomainTestGraph();
|
| + }
|
| +
|
| + void TearDown() override {
|
| + net::registry_controlled_domains::SetFindDomainGraph();
|
| + }
|
| +};
|
| +
|
| +TEST_F(CookieUtilDomainTest, TestGetEffectiveDomain) {
|
| + // Note: registry_controlled_domains::GetDomainAndRegistry is tested in its
|
| + // own unittests.
|
| + EXPECT_EQ("", net::cookie_util::GetEffectiveDomain("http", "ac.jp"));
|
| + EXPECT_EQ("", net::cookie_util::GetEffectiveDomain("https", "ac.jp"));
|
| + EXPECT_EQ("", net::cookie_util::GetEffectiveDomain("ws", "ac.jp"));
|
| + EXPECT_EQ("", net::cookie_util::GetEffectiveDomain("wss", "ac.jp"));
|
| + EXPECT_EQ("ac.jp", net::cookie_util::GetEffectiveDomain("ftp", "ac.jp"));
|
| +}
|
| +
|
| +} // namespace
|
|
|