Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / extensions / shell / common / shell_content_client_unittest.cc
blob237d2dc9d29b06f57459fcaf6dc70aefb4ccf991
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.
5 #include "extensions/shell/common/shell_content_client.h"
7 #include <string>
9 #include "base/strings/string_util.h"
10 #include "testing/gtest/include/gtest/gtest.h"
12 typedef testing::Test ShellContentClientTest;
14 namespace extensions {
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();
21 // Must start with the usual Mozilla-compatibility string.
22 EXPECT_TRUE(StartsWithASCII(user_agent, "Mozilla/5.0", false)) << user_agent;
24 // Must contain a substring like "Chrome/1.2.3.4".
25 EXPECT_TRUE(MatchPattern(user_agent, "*Chrome/*.*.*.*")) << user_agent;
28 } // namespace extensions