Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: components/network_hints/renderer/renderer_dns_prefetch_unittest.cc

Issue 848303005: Renamed the dns_prefetch component to network_predictor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Single threaded tests of RendererNetPredictor functionality. 5 // Single threaded tests of RendererDnsPrefetch functionality.
6 6
7 #include "components/dns_prefetch/renderer/renderer_net_predictor.h" 7 #include "components/network_hints/renderer/renderer_dns_prefetch.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace dns_prefetch { 13 namespace network_hints {
14 14
15 class RenderDnsMasterTest : public testing::Test { 15 class RenderDnsMasterTest : public testing::Test {
16 }; 16 };
17 17
18 TEST(RenderDnsMasterTest, NumericIpDiscardCheck) { 18 TEST(RenderDnsMasterTest, NumericIpDiscardCheck) {
19 // Regular names. 19 // Regular names.
20 const std::string A("a.com"), B("b.net"), C("www.other.uk"); 20 const std::string A("a.com"), B("b.net"), C("www.other.uk");
21 // Combination of digits plus dots. 21 // Combination of digits plus dots.
22 const std::string N1("1.3."), N2("5.5.7.12"); 22 const std::string N1("1.3."), N2("5.5.7.12");
23 23
24 #define TESTNAME(string) RendererNetPredictor::is_numeric_ip((string.data()), \ 24 #define TESTNAME(string) RendererDnsPrefetch::is_numeric_ip((string.data()), \
25 (string).size()) 25 (string).size())
26 26
27 EXPECT_TRUE(TESTNAME(N1)); 27 EXPECT_TRUE(TESTNAME(N1));
28 EXPECT_TRUE(TESTNAME(N2)); 28 EXPECT_TRUE(TESTNAME(N2));
29 29
30 EXPECT_FALSE(TESTNAME(A)); 30 EXPECT_FALSE(TESTNAME(A));
31 EXPECT_FALSE(TESTNAME(B)); 31 EXPECT_FALSE(TESTNAME(B));
32 EXPECT_FALSE(TESTNAME(C)); 32 EXPECT_FALSE(TESTNAME(C));
33 33
34 #undef TESTNAME 34 #undef TESTNAME
35 } 35 }
36 36
37 } // namespace dns_prefetch 37 } // namespace network_hints
OLDNEW
« no previous file with comments | « components/network_hints/renderer/renderer_dns_prefetch.cc ('k') | tools/ipc_fuzzer/message_lib/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698