OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/chromeos/settings/cros_settings.h" | 14 #include "chrome/browser/chromeos/settings/cros_settings.h" |
15 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 15 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
| 16 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
16 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" | 17 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" |
17 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 18 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
18 #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h" | 19 #include "chrome/browser/policy/proto/chromeos/chrome_device_policy.pb.h" |
19 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" | 20 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" |
20 #include "chrome/test/base/scoped_testing_local_state.h" | 21 #include "chrome/test/base/scoped_testing_local_state.h" |
21 #include "chrome/test/base/testing_browser_process.h" | 22 #include "chrome/test/base/testing_browser_process.h" |
22 #include "content/public/test/test_browser_thread.h" | 23 #include "content/public/test/test_browser_thread.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 | 25 |
25 namespace em = enterprise_management; | 26 namespace em = enterprise_management; |
26 | 27 |
27 namespace chromeos { | 28 namespace chromeos { |
28 | 29 |
29 class CrosSettingsTest : public testing::Test { | 30 class CrosSettingsTest : public testing::Test { |
30 protected: | 31 protected: |
31 CrosSettingsTest() | 32 CrosSettingsTest() |
32 : message_loop_(MessageLoop::TYPE_UI), | 33 : message_loop_(MessageLoop::TYPE_UI), |
33 ui_thread_(content::BrowserThread::UI, &message_loop_), | 34 ui_thread_(content::BrowserThread::UI, &message_loop_), |
34 local_state_(TestingBrowserProcess::GetGlobal()), | 35 local_state_(TestingBrowserProcess::GetGlobal()), |
| 36 settings_(DeviceSettingsService::Get()), |
35 weak_factory_(this) {} | 37 weak_factory_(this) {} |
36 | 38 |
37 virtual ~CrosSettingsTest() {} | 39 virtual ~CrosSettingsTest() {} |
38 | 40 |
39 virtual void TearDown() OVERRIDE { | 41 virtual void TearDown() OVERRIDE { |
40 ASSERT_TRUE(expected_props_.empty()); | 42 ASSERT_TRUE(expected_props_.empty()); |
41 STLDeleteValues(&expected_props_); | 43 STLDeleteValues(&expected_props_); |
42 expected_props_.clear(); | 44 expected_props_.clear(); |
43 } | 45 } |
44 | 46 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 EXPECT_TRUE(cs->FindEmailInList(kAccountsPrefUsers, "WITH.DOTS@gmail.com")); | 246 EXPECT_TRUE(cs->FindEmailInList(kAccountsPrefUsers, "WITH.DOTS@gmail.com")); |
245 EXPECT_TRUE(cs->FindEmailInList(kAccountsPrefUsers, "WITHDOTS")); | 247 EXPECT_TRUE(cs->FindEmailInList(kAccountsPrefUsers, "WITHDOTS")); |
246 | 248 |
247 EXPECT_TRUE(cs->FindEmailInList(kAccountsPrefUsers, "Upper@example.com")); | 249 EXPECT_TRUE(cs->FindEmailInList(kAccountsPrefUsers, "Upper@example.com")); |
248 EXPECT_FALSE(cs->FindEmailInList(kAccountsPrefUsers, "U.pper@example.com")); | 250 EXPECT_FALSE(cs->FindEmailInList(kAccountsPrefUsers, "U.pper@example.com")); |
249 EXPECT_FALSE(cs->FindEmailInList(kAccountsPrefUsers, "Upper")); | 251 EXPECT_FALSE(cs->FindEmailInList(kAccountsPrefUsers, "Upper")); |
250 EXPECT_TRUE(cs->FindEmailInList(kAccountsPrefUsers, "upper@example.com")); | 252 EXPECT_TRUE(cs->FindEmailInList(kAccountsPrefUsers, "upper@example.com")); |
251 } | 253 } |
252 | 254 |
253 } // namespace chromeos | 255 } // namespace chromeos |
OLD | NEW |