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

Side by Side Diff: webkit/user_agent/user_agent_unittest.cc

Issue 14304004: Convert a bunch of test_shell_tests to content_browsertests. These are tests that depend on loading… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 8 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 | « webkit/tools/test_shell/test_shell.gypi ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "webkit/user_agent/user_agent.h" 5 #include "webkit/user_agent/user_agent.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "webkit/tools/test_shell/test_shell_test.h"
12 11
13 namespace { 12 namespace {
14 13
15 class WebkitGlueUserAgentTest : public TestShellTest { 14 typedef testing::Test WebkitGlueUserAgentTest;
16 };
17 15
18 bool IsSpoofedUserAgent(const std::string& user_agent) { 16 bool IsSpoofedUserAgent(const std::string& user_agent) {
19 return user_agent.find("TestShell") == std::string::npos; 17 return user_agent.find("TestContentClient") == std::string::npos;
20 } 18 }
21 19
22 TEST_F(WebkitGlueUserAgentTest, UserAgentSpoofingHack) { 20 TEST_F(WebkitGlueUserAgentTest, UserAgentSpoofingHack) {
23 enum Platform { 21 enum Platform {
24 NONE = 0, 22 NONE = 0,
25 MACOSX = 1, 23 MACOSX = 1,
26 WIN = 2, 24 WIN = 2,
27 OTHER = 4, 25 OTHER = 4,
28 }; 26 };
29 27
(...skipping 18 matching lines...) Expand all
48 #endif 46 #endif
49 47
50 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected); ++i) { 48 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected); ++i) {
51 EXPECT_EQ((expected[i].os_mask & os_bit) != 0, 49 EXPECT_EQ((expected[i].os_mask & os_bit) != 0,
52 IsSpoofedUserAgent( 50 IsSpoofedUserAgent(
53 webkit_glue::GetUserAgent(GURL(expected[i].url)))); 51 webkit_glue::GetUserAgent(GURL(expected[i].url))));
54 } 52 }
55 } 53 }
56 54
57 } // namespace 55 } // namespace
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_shell.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698