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

Side by Side Diff: ios/web/public/user_agent_unittest.mm

Issue 2705293014: Created web::UserAgentType. (Closed)
Patch Set: rebase + compile fix Created 3 years, 9 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 | « ios/web/public/user_agent.mm ('k') | ios/web/public/web_client.h » ('j') | 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 2017 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 #import "ios/web/public/user_agent.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace web {
10
11 // Tests conversions between UserAgentType values and their descriptions
12 TEST(UserAgentTest, UserAgentTypeDescription) {
13 const std::string kMobileDescription("MOBILE");
14 const std::string kDesktopDescription("DESKTOP");
15 const std::string kNoneDescription("NONE");
16 const std::string kInvalidDescription(
17 "not returned by GetUserAgentTypeDescription()");
18 EXPECT_EQ(kMobileDescription,
19 GetUserAgentTypeDescription(UserAgentType::MOBILE));
20 EXPECT_EQ(kDesktopDescription,
21 GetUserAgentTypeDescription(UserAgentType::DESKTOP));
22 EXPECT_EQ(kNoneDescription, GetUserAgentTypeDescription(UserAgentType::NONE));
23 EXPECT_EQ(UserAgentType::MOBILE,
24 GetUserAgentTypeWithDescription(kMobileDescription));
25 EXPECT_EQ(UserAgentType::DESKTOP,
26 GetUserAgentTypeWithDescription(kDesktopDescription));
27 EXPECT_EQ(UserAgentType::NONE,
28 GetUserAgentTypeWithDescription(kNoneDescription));
29 EXPECT_EQ(UserAgentType::NONE,
30 GetUserAgentTypeWithDescription(kInvalidDescription));
31 }
32
33 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/public/user_agent.mm ('k') | ios/web/public/web_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698