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

Side by Side Diff: chrome/renderer/net/renderer_predictor_unittest.cc

Issue 2866026: Rename Dns prefetching files to Predictor files... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/net/renderer_net_predictor.cc ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 RendererNetPredictor functionality.
6 6
7 #include "chrome/renderer/net/render_dns_master.h" 7 #include "chrome/renderer/net/renderer_net_predictor.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
11 11
12 namespace { 12 namespace {
13 13
14 class RenderDnsMasterTest : public testing::Test { 14 class RenderDnsMasterTest : public testing::Test {
15 }; 15 };
16 16
17 TEST(RenderDnsMasterTest, NumericIpDiscardCheck) { 17 TEST(RenderDnsMasterTest, NumericIpDiscardCheck) {
18 // Regular names. 18 // Regular names.
19 const std::string A("a.com"), B("b.net"), C("www.other.uk"); 19 const std::string A("a.com"), B("b.net"), C("www.other.uk");
20 // Combination of digits plus dots. 20 // Combination of digits plus dots.
21 const std::string N1("1.3."), N2("5.5.7.12"); 21 const std::string N1("1.3."), N2("5.5.7.12");
22 22
23 #define TESTNAME(string) RendererNetPredictor::is_numeric_ip((string.data()), \ 23 #define TESTNAME(string) RendererNetPredictor::is_numeric_ip((string.data()), \
24 (string).size()) 24 (string).size())
25 25
26 EXPECT_TRUE(TESTNAME(N1)); 26 EXPECT_TRUE(TESTNAME(N1));
27 EXPECT_TRUE(TESTNAME(N2)); 27 EXPECT_TRUE(TESTNAME(N2));
28 28
29 EXPECT_FALSE(TESTNAME(A)); 29 EXPECT_FALSE(TESTNAME(A));
30 EXPECT_FALSE(TESTNAME(B)); 30 EXPECT_FALSE(TESTNAME(B));
31 EXPECT_FALSE(TESTNAME(C)); 31 EXPECT_FALSE(TESTNAME(C));
32 32
33 #undef TESTNAME 33 #undef TESTNAME
34 } 34 }
35 35
36 } // namespace anonymous 36 } // namespace anonymous
OLDNEW
« no previous file with comments | « chrome/renderer/net/renderer_net_predictor.cc ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698