| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/basictypes.h" | 5 #include "base/macros.h" |
| 6 #include "net/cookies/cookie_constants.h" | 6 #include "net/cookies/cookie_constants.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 TEST(CookieConstantsTest, TestCookiePriority) { | 11 TEST(CookieConstantsTest, TestCookiePriority) { |
| 12 // Basic cases. | 12 // Basic cases. |
| 13 EXPECT_EQ("low", CookiePriorityToString(COOKIE_PRIORITY_LOW)); | 13 EXPECT_EQ("low", CookiePriorityToString(COOKIE_PRIORITY_LOW)); |
| 14 EXPECT_EQ("medium", CookiePriorityToString(COOKIE_PRIORITY_MEDIUM)); | 14 EXPECT_EQ("medium", CookiePriorityToString(COOKIE_PRIORITY_MEDIUM)); |
| 15 EXPECT_EQ("high", CookiePriorityToString(COOKIE_PRIORITY_HIGH)); | 15 EXPECT_EQ("high", CookiePriorityToString(COOKIE_PRIORITY_HIGH)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // Unrecognized tokens are interpreted as COOKIE_PRIORITY_DEFAULT. | 33 // Unrecognized tokens are interpreted as COOKIE_PRIORITY_DEFAULT. |
| 34 const char* const bad_tokens[] = { | 34 const char* const bad_tokens[] = { |
| 35 "", "lo", "lowerest", "high ", " high", "0"}; | 35 "", "lo", "lowerest", "high ", " high", "0"}; |
| 36 for (size_t i = 0; i < arraysize(bad_tokens); ++i) { | 36 for (size_t i = 0; i < arraysize(bad_tokens); ++i) { |
| 37 EXPECT_EQ(COOKIE_PRIORITY_DEFAULT, StringToCookiePriority(bad_tokens[i])); | 37 EXPECT_EQ(COOKIE_PRIORITY_DEFAULT, StringToCookiePriority(bad_tokens[i])); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace net | 41 } // namespace net |
| OLD | NEW |