Use component installer mechanism instead of extensions for supervised user whitelists.
[chromium-blink-merge.git] / components / dns_prefetch / renderer / renderer_net_predictor_unittest.cc
blob03a4f2e561fe6bba5431b51e78e781b08aee3d6c
1 // Copyright (c) 2006-2010 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.
5 // Single threaded tests of RendererNetPredictor functionality.
7 #include "components/dns_prefetch/renderer/renderer_net_predictor.h"
9 #include <algorithm>
11 #include "testing/gtest/include/gtest/gtest.h"
13 namespace dns_prefetch {
15 class RenderDnsMasterTest : public testing::Test {
18 TEST(RenderDnsMasterTest, NumericIpDiscardCheck) {
19 // Regular names.
20 const std::string A("a.com"), B("b.net"), C("www.other.uk");
21 // Combination of digits plus dots.
22 const std::string N1("1.3."), N2("5.5.7.12");
24 #define TESTNAME(string) RendererNetPredictor::is_numeric_ip((string.data()), \
25 (string).size())
27 EXPECT_TRUE(TESTNAME(N1));
28 EXPECT_TRUE(TESTNAME(N2));
30 EXPECT_FALSE(TESTNAME(A));
31 EXPECT_FALSE(TESTNAME(B));
32 EXPECT_FALSE(TESTNAME(C));
34 #undef TESTNAME
37 } // namespace dns_prefetch