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

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

Issue 505403003: app_shell: Add version number in user agent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/shell/common/shell_content_client.cc ('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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "extensions/shell/common/shell_content_client.h"
6
7 #include <string>
8
9 #include "base/strings/string_util.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 typedef testing::Test ShellContentClientTest;
13
14 namespace extensions {
15
16 // Tests that the app_shell user agent looks like a Chrome user agent.
17 TEST_F(ShellContentClientTest, UserAgentFormat) {
18 ShellContentClient client;
19 std::string user_agent = client.GetUserAgent();
20
21 // Must start with the usual Mozilla-compatibility string.
22 EXPECT_TRUE(StartsWithASCII(user_agent, "Mozilla/5.0", false)) << user_agent;
23
24 // Must contain a substring like "Chrome/1.2.3.4".
25 EXPECT_TRUE(MatchPattern(user_agent, "*Chrome/*.*.*.*")) << user_agent;
26 }
27
28 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/common/shell_content_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698