Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / renderer / net / renderer_predictor_unittest.cc
bloba987ba0e563a3d9b6976e4b8f4b8393429dc80f5
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 "chrome/renderer/net/renderer_net_predictor.h"
8 #include "testing/gtest/include/gtest/gtest.h"
10 #include <algorithm>
12 namespace {
14 class RenderDnsMasterTest : public testing::Test {
17 TEST(RenderDnsMasterTest, NumericIpDiscardCheck) {
18 // Regular names.
19 const std::string A("a.com"), B("b.net"), C("www.other.uk");
20 // Combination of digits plus dots.
21 const std::string N1("1.3."), N2("5.5.7.12");
23 #define TESTNAME(string) RendererNetPredictor::is_numeric_ip((string.data()), \
24 (string).size())
26 EXPECT_TRUE(TESTNAME(N1));
27 EXPECT_TRUE(TESTNAME(N2));
29 EXPECT_FALSE(TESTNAME(A));
30 EXPECT_FALSE(TESTNAME(B));
31 EXPECT_FALSE(TESTNAME(C));
33 #undef TESTNAME
36 } // namespace anonymous