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

Side by Side Diff: extensions/shell/common/shell_content_client_unittest.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 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
« no previous file with comments | « extensions/common/permissions/permissions_info.cc ('k') | google_apis/drive/test_util.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/shell/common/shell_content_client.h" 5 #include "extensions/shell/common/shell_content_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/pattern.h" 9 #include "base/strings/pattern.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 typedef testing::Test ShellContentClientTest; 13 typedef testing::Test ShellContentClientTest;
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 // Tests that the app_shell user agent looks like a Chrome user agent. 17 // Tests that the app_shell user agent looks like a Chrome user agent.
18 TEST_F(ShellContentClientTest, UserAgentFormat) { 18 TEST_F(ShellContentClientTest, UserAgentFormat) {
19 ShellContentClient client; 19 ShellContentClient client;
20 std::string user_agent = client.GetUserAgent(); 20 std::string user_agent = client.GetUserAgent();
21 21
22 // Must start with the usual Mozilla-compatibility string. 22 // Must start with the usual Mozilla-compatibility string.
23 EXPECT_TRUE(base::StartsWithASCII(user_agent, "Mozilla/5.0", false)) 23 EXPECT_TRUE(base::StartsWith(user_agent, "Mozilla/5.0",
24 base::CompareCase::INSENSITIVE_ASCII))
24 << user_agent; 25 << user_agent;
25 26
26 // Must contain a substring like "Chrome/1.2.3.4". 27 // Must contain a substring like "Chrome/1.2.3.4".
27 EXPECT_TRUE(base::MatchPattern(user_agent, "*Chrome/*.*.*.*")) << user_agent; 28 EXPECT_TRUE(base::MatchPattern(user_agent, "*Chrome/*.*.*.*")) << user_agent;
28 } 29 }
29 30
30 } // namespace extensions 31 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/permissions/permissions_info.cc ('k') | google_apis/drive/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698