This source file includes following definitions.
- TEST
#include "base/basictypes.h"
#include "net/cookies/cookie_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
TEST(CookieConstantsTest, TestCookiePriority) {
EXPECT_EQ("low", CookiePriorityToString(COOKIE_PRIORITY_LOW));
EXPECT_EQ("medium", CookiePriorityToString(COOKIE_PRIORITY_MEDIUM));
EXPECT_EQ("high", CookiePriorityToString(COOKIE_PRIORITY_HIGH));
EXPECT_EQ(COOKIE_PRIORITY_LOW, StringToCookiePriority("low"));
EXPECT_EQ(COOKIE_PRIORITY_MEDIUM, StringToCookiePriority("medium"));
EXPECT_EQ(COOKIE_PRIORITY_HIGH, StringToCookiePriority("high"));
EXPECT_EQ(COOKIE_PRIORITY_LOW, StringToCookiePriority("LOW"));
EXPECT_EQ(COOKIE_PRIORITY_MEDIUM, StringToCookiePriority("Medium"));
EXPECT_EQ(COOKIE_PRIORITY_HIGH, StringToCookiePriority("hiGH"));
EXPECT_EQ(COOKIE_PRIORITY_DEFAULT, COOKIE_PRIORITY_MEDIUM);
EXPECT_LT(COOKIE_PRIORITY_LOW, COOKIE_PRIORITY_MEDIUM);
EXPECT_LT(COOKIE_PRIORITY_MEDIUM, COOKIE_PRIORITY_HIGH);
const char* bad_tokens[] = {"", "lo", "lowerest", "high ", " high", "0"};
for (size_t i = 0; i < arraysize(bad_tokens); ++i) {
EXPECT_EQ(COOKIE_PRIORITY_DEFAULT, StringToCookiePriority(bad_tokens[i]));
}
}
}