Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / policy / browser_policy_connector_unittest.cc
blobecb241a079f8bfa7ae9da13bc49674bee44f39c5
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"
9 namespace policy {
11 TEST(BrowserPolicyConnectorTest, IsNonEnterpriseUser) {
12 // List of example emails that are not enterprise users.
13 static const char* kNonEnterpriseUsers[] = {
14 "fizz@aol.com",
15 "foo@gmail.com",
16 "bar@googlemail.com",
17 "baz@hotmail.it",
18 "baz@hotmail.co.uk",
19 "baz@hotmail.com.tw",
20 "user@msn.com",
21 "another_user@live.com",
22 "foo@qq.com",
23 "i_love@yahoo.com",
24 "i_love@yahoo.com.tw",
25 "i_love@yahoo.jp",
26 "i_love@yahoo.co.uk",
27 "user@yandex.ru"
30 // List of example emails that are potential enterprise users.
31 static const char* kEnterpriseUsers[] = {
32 "foo@google.com",
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;
49 } // namespace policy