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

Side by Side Diff: chrome/common/chrome_content_client_unittest.cc

Issue 24544004: Remove the chrome namespace around ChromeContent[Renderer]Client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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
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 "chrome/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "content/public/common/content_switches.h" 9 #include "content/public/common/content_switches.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace { 12 namespace {
13 13
14 void CheckUserAgentStringOrdering(bool mobile_device) { 14 void CheckUserAgentStringOrdering(bool mobile_device) {
15 std::vector<std::string> pieces; 15 std::vector<std::string> pieces;
16 16
17 // Check if the pieces of the user agent string come in the correct order. 17 // Check if the pieces of the user agent string come in the correct order.
18 chrome::ChromeContentClient content_client; 18 ChromeContentClient content_client;
19 std::string buffer = content_client.GetUserAgent(); 19 std::string buffer = content_client.GetUserAgent();
20 20
21 base::SplitStringUsingSubstr(buffer, "Mozilla/5.0 (", &pieces); 21 base::SplitStringUsingSubstr(buffer, "Mozilla/5.0 (", &pieces);
22 ASSERT_EQ(2u, pieces.size()); 22 ASSERT_EQ(2u, pieces.size());
23 buffer = pieces[1]; 23 buffer = pieces[1];
24 EXPECT_EQ("", pieces[0]); 24 EXPECT_EQ("", pieces[0]);
25 25
26 base::SplitStringUsingSubstr(buffer, ") AppleWebKit/", &pieces); 26 base::SplitStringUsingSubstr(buffer, ") AppleWebKit/", &pieces);
27 ASSERT_EQ(2u, pieces.size()); 27 ASSERT_EQ(2u, pieces.size());
28 buffer = pieces[1]; 28 buffer = pieces[1];
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 CheckUserAgentStringOrdering(false); 75 CheckUserAgentStringOrdering(false);
76 76
77 // Do it for mobile devices. 77 // Do it for mobile devices.
78 command_line->AppendSwitch(switches::kUseMobileUserAgent); 78 command_line->AppendSwitch(switches::kUseMobileUserAgent);
79 ASSERT_TRUE(command_line->HasSwitch(switches::kUseMobileUserAgent)); 79 ASSERT_TRUE(command_line->HasSwitch(switches::kUseMobileUserAgent));
80 CheckUserAgentStringOrdering(true); 80 CheckUserAgentStringOrdering(true);
81 #endif 81 #endif
82 } 82 }
83 83
84 } // namespace chrome_common 84 } // namespace chrome_common
OLDNEW
« no previous file with comments | « chrome/common/chrome_content_client_ios.mm ('k') | chrome/renderer/chrome_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698