| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/basictypes.h" | |
| 6 #include "net/base/cookie_util.h" | |
| 7 #include "testing/gtest/include/gtest/gtest.h" | |
| 8 | |
| 9 TEST(CookieUtilTest, TestDomainIsHostOnly) { | |
| 10 const struct { | |
| 11 const char* str; | |
| 12 const bool is_host_only; | |
| 13 } tests[] = { | |
| 14 { "", true }, | |
| 15 { "www.google.com", true }, | |
| 16 { ".google.com", false } | |
| 17 }; | |
| 18 | |
| 19 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | |
| 20 EXPECT_EQ(tests[i].is_host_only, | |
| 21 net::cookie_util::DomainIsHostOnly(tests[i].str)); | |
| 22 } | |
| 23 } | |
| OLD | NEW |