Lines Matching refs:domain
52 // * Three levels of domain cookie (.b.a, .c.b.a, .d.c.b.a)
56 // * Two domain path cookies (.c.b.a/dir1, .c.b.a/dir1/dir2)
59 // Domain cookies
95 // Domain path cookies
365 static const char kValidDomainCookieLine[] = "A=B; path=/; domain=google.izzle";
375 EXPECT_TRUE(cm->SetCookie(url_google, "C=D; domain=.google.izzle"));
378 // Verify that A=B was set as a host cookie rather than a domain
379 // cookie -- should not be accessible from a sub sub-domain.
382 // Test and make sure we find domain cookies on the same domain.
383 EXPECT_TRUE(cm->SetCookie(url_google, "E=F; domain=.www.google.izzle"));
386 // Test setting a domain= that doesn't start w/ a dot, should
387 // treat it as a domain cookie, as if there was a pre-pended dot.
388 EXPECT_TRUE(cm->SetCookie(url_google, "G=H; domain=www.google.izzle"));
391 // Test domain enforcement, should fail on a sub-domain or something too deep.
392 EXPECT_FALSE(cm->SetCookie(url_google, "I=J; domain=.izzle"));
394 EXPECT_FALSE(cm->SetCookie(url_google, "K=L; domain=.bla.www.google.izzle"));
411 EXPECT_FALSE(cm->SetCookie(url_google, "a=1; domain=.www.google.com."));
412 EXPECT_FALSE(cm->SetCookie(url_google, "b=2; domain=.www.google.com.."));
430 EXPECT_TRUE(cm->SetCookie(url_abcd, "a=1; domain=.a.b.c.d.com"));
431 EXPECT_TRUE(cm->SetCookie(url_abcd, "b=2; domain=.b.c.d.com"));
432 EXPECT_TRUE(cm->SetCookie(url_abcd, "c=3; domain=.c.d.com"));
433 EXPECT_TRUE(cm->SetCookie(url_abcd, "d=4; domain=.d.com"));
441 EXPECT_TRUE(cm->SetCookie(url_bcd, "X=bcd; domain=.b.c.d.com"));
442 EXPECT_TRUE(cm->SetCookie(url_bcd, "X=cd; domain=.c.d.com"));
450 // Test that setting a cookie which specifies an invalid domain has
451 // no side-effect. An invalid domain in this context is one which does
452 // not match the originating domain.
462 // More specific sub-domain than allowed.
463 EXPECT_FALSE(cm->SetCookie(url_foobar, "a=1; domain=.yo.foo.bar.com"));
465 EXPECT_FALSE(cm->SetCookie(url_foobar, "b=2; domain=.foo.com"));
466 EXPECT_FALSE(cm->SetCookie(url_foobar, "c=3; domain=.bar.foo.com"));
469 EXPECT_FALSE(cm->SetCookie(url_foobar, "d=4; domain=.foo.bar.com.net"));
471 // A substring that isn't really a parent domain.
472 EXPECT_FALSE(cm->SetCookie(url_foobar, "e=5; domain=ar.com"));
475 EXPECT_FALSE(cm->SetCookie(url_foobar, "f=6; domain=."));
476 EXPECT_FALSE(cm->SetCookie(url_foobar, "g=7; domain=/"));
477 EXPECT_FALSE(cm->SetCookie(url_foobar, "h=8; domain=http://foo.bar.com"));
478 EXPECT_FALSE(cm->SetCookie(url_foobar, "i=9; domain=..foo.bar.com"));
479 EXPECT_FALSE(cm->SetCookie(url_foobar, "j=10; domain=..bar.com"));
481 // Make sure there isn't something quirky in the domain canonicalization
483 EXPECT_FALSE(cm->SetCookie(url_foobar, "k=11; domain=.foo.bar.com?blah"));
484 EXPECT_FALSE(cm->SetCookie(url_foobar, "l=12; domain=.foo.bar.com/blah"));
485 EXPECT_FALSE(cm->SetCookie(url_foobar, "m=13; domain=.foo.bar.com:80"));
486 EXPECT_FALSE(cm->SetCookie(url_foobar, "n=14; domain=.foo.bar.com:"));
487 EXPECT_FALSE(cm->SetCookie(url_foobar, "o=15; domain=.foo.bar.com#sup"));
498 // hosts below have the same domain + registry.
501 EXPECT_FALSE(cm->SetCookie(url_foocom, "a=1; domain=.foo.com.com.com"));
506 // Test the behavior of omitting dot prefix from domain, should
510 { // The omission of dot results in setting a domain cookie.
514 EXPECT_TRUE(cm->SetCookie(url_hosted, "sawAd=1; domain=filefront.com"));
522 EXPECT_TRUE(cm->SetCookie(url, "a=1; domain=www.google.com"));
529 // Test that the domain specified in cookie string is treated case-insensitive
534 EXPECT_TRUE(cm->SetCookie(url_google, "a=1; domain=.GOOGLE.COM"));
535 EXPECT_TRUE(cm->SetCookie(url_google, "b=2; domain=.wWw.gOOgLE.coM"));
547 { // IP addresses should not be able to set domain cookies.
549 EXPECT_FALSE(cm->SetCookie(url_ip, "b=2; domain=.1.2.3.4"));
550 EXPECT_FALSE(cm->SetCookie(url_ip, "c=3; domain=.3.4"));
552 // It should be allowed to set a cookie if domain= matches the IP address
554 EXPECT_FALSE(cm->SetCookie(url_ip, "b=2; domain=1.2.3.3"));
556 EXPECT_TRUE(cm->SetCookie(url_ip, "b=2; domain=1.2.3.4"));
568 EXPECT_FALSE(cm->SetCookie(url, "b=2; domain=.com"));
569 EXPECT_FALSE(cm->SetCookie(url, "c=3; domain=com"));
572 // not a domain cookie.
588 EXPECT_FALSE(cm->SetCookie(url, "a=1; domain=.b"));
589 EXPECT_FALSE(cm->SetCookie(url, "b=2; domain=b"));
596 EXPECT_FALSE(cm->SetCookie(url, "a=1; domain=.com"));
597 EXPECT_FALSE(cm->SetCookie(url, "b=2; domain=com"));
604 EXPECT_FALSE(cm->SetCookie(url, "a=1; domain=.co.uk"));
605 EXPECT_FALSE(cm->SetCookie(url, "b=2; domain=.uk"));
615 EXPECT_FALSE(cm->SetCookie(url, "b=2; domain=.b"));
616 EXPECT_FALSE(cm->SetCookie(url, "c=3; domain=b"));
621 // Test reading/writing cookies when the domain ends with a period,
630 // Do not share cookie space with the dot version of domain.
632 EXPECT_FALSE(cm->SetCookie(url, "b=2; domain=.www.google.com."));
635 EXPECT_TRUE(cm->SetCookie(url_with_dot, "b=2; domain=.google.com."));
1061 // between them. If we are using the effective domain keying system
1063 // kDomainMaxCookies for both together. If we're using the domain
1065 // individual domain shouldn't go above kDomainMaxCookies.
1141 const std::string& domain,
1146 if (it->Domain() == domain && it->Name() == name)
1198 "C=D; domain=.google.izzle",
1201 "E=F; domain=.google.izzle; secure",
1213 EXPECT_EQ("www.google.izzle", it->Domain());
1217 EXPECT_EQ(".google.izzle", it->Domain());
1228 EXPECT_EQ(".google.izzle", it->Domain());
1238 EXPECT_EQ("www.google.izzle", it->Domain());
1242 EXPECT_EQ(".google.izzle", it->Domain());
1246 EXPECT_EQ(".google.izzle", it->Domain());
1533 EXPECT_EQ(url_google.host(), delegate->changes()[0].first.Domain());
1536 EXPECT_EQ(url_google.host(), delegate->changes()[1].first.Domain());
1540 EXPECT_EQ(url_google.host(), delegate->changes()[2].first.Domain());
1549 EXPECT_EQ(url_google.host(), delegate->changes()[0].first.Domain());
1567 EXPECT_EQ(url_google.host(), delegate->changes()[0].first.Domain());
1585 EXPECT_EQ(url_google.host(), delegate->changes()[0].first.Domain());
1589 EXPECT_EQ(url_google.host(), delegate->changes()[1].first.Domain());
1637 EXPECT_EQ("www.google.izzle", it->Domain());
1651 EXPECT_EQ(".google.izzle", it->Domain());
1665 EXPECT_EQ("www.google.izzle", it->Domain());
1682 // this call, and domain cookies arent touched.
1821 // Cases where the effective domain is null, so we use the host
1846 std::string domain;
1869 p->domain, p->path, p->expires,
1892 EXPECT_EQ(GURL(input->gurl).host(), output->Domain());
1912 "d=1; domain=b.a.google.com"));
1914 "a=4; domain=b.a.google.com"));
1916 "e=1; domain=c.b.a.google.com"));