This source file includes following definitions.
- TEST
#include "components/policy/core/browser/browser_policy_connector.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace policy {
TEST(BrowserPolicyConnectorTest, IsNonEnterpriseUser) {
static const char* kNonEnterpriseUsers[] = {
"fizz@aol.com",
"foo@gmail.com",
"bar@googlemail.com",
"baz@hotmail.it",
"baz@hotmail.co.uk",
"baz@hotmail.com.tw",
"user@msn.com",
"another_user@live.com",
"foo@qq.com",
"i_love@yahoo.com",
"i_love@yahoo.com.tw",
"i_love@yahoo.jp",
"i_love@yahoo.co.uk",
"user@yandex.ru"
};
static const char* kEnterpriseUsers[] = {
"foo@google.com",
"chrome_rules@chromium.org",
"user@hotmail.enterprise.com",
};
for (unsigned int i = 0; i < arraysize(kNonEnterpriseUsers); ++i) {
std::string username(kNonEnterpriseUsers[i]);
EXPECT_TRUE(BrowserPolicyConnector::IsNonEnterpriseUser(username)) <<
"IsNonEnterpriseUser returned false for " << username;
}
for (unsigned int i = 0; i < arraysize(kEnterpriseUsers); ++i) {
std::string username(kEnterpriseUsers[i]);
EXPECT_FALSE(BrowserPolicyConnector::IsNonEnterpriseUser(username)) <<
"IsNonEnterpriseUser returned true for " << username;
}
}
}