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