1 // Copyright (c) 2012 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.
5 #include "chrome/browser/policy/browser_policy_connector.h"
7 #include "testing/gtest/include/gtest/gtest.h"
11 TEST(BrowserPolicyConnectorTest
, IsNonEnterpriseUser
) {
12 // List of example emails that are not enterprise users.
13 static const char* kNonEnterpriseUsers
[] = {
21 "another_user@live.com",
24 "i_love@yahoo.com.tw",
30 // List of example emails that are potential enterprise users.
31 static const char* kEnterpriseUsers
[] = {
33 "chrome_rules@chromium.org",
34 "user@hotmail.enterprise.com",
37 for (unsigned int i
= 0; i
< arraysize(kNonEnterpriseUsers
); ++i
) {
38 std::string
username(kNonEnterpriseUsers
[i
]);
39 EXPECT_TRUE(BrowserPolicyConnector::IsNonEnterpriseUser(username
)) <<
40 "IsNonEnterpriseUser returned false for " << username
;
42 for (unsigned int i
= 0; i
< arraysize(kEnterpriseUsers
); ++i
) {
43 std::string
username(kEnterpriseUsers
[i
]);
44 EXPECT_FALSE(BrowserPolicyConnector::IsNonEnterpriseUser(username
)) <<
45 "IsNonEnterpriseUser returned true for " << username
;