OLD | NEW |
(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 |
OLD | NEW |