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 "chrome/browser/chromeos/settings/cros_settings.h" | 5 #include "chrome/browser/chromeos/settings/cros_settings.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 CrosSettingsTest() | 33 CrosSettingsTest() |
34 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 34 : ui_thread_(content::BrowserThread::UI, &message_loop_), |
35 local_state_(TestingBrowserProcess::GetGlobal()), | 35 local_state_(TestingBrowserProcess::GetGlobal()), |
36 settings_(DeviceSettingsService::Get()), | 36 settings_(DeviceSettingsService::Get()), |
37 weak_factory_(this) {} | 37 weak_factory_(this) {} |
38 | 38 |
39 ~CrosSettingsTest() override {} | 39 ~CrosSettingsTest() override {} |
40 | 40 |
41 void TearDown() override { | 41 void TearDown() override { |
42 ASSERT_TRUE(expected_props_.empty()); | 42 ASSERT_TRUE(expected_props_.empty()); |
43 STLDeleteValues(&expected_props_); | 43 base::STLDeleteValues(&expected_props_); |
44 } | 44 } |
45 | 45 |
46 void FetchPref(const std::string& pref) { | 46 void FetchPref(const std::string& pref) { |
47 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 47 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
48 if (expected_props_.find(pref) == expected_props_.end()) | 48 if (expected_props_.find(pref) == expected_props_.end()) |
49 return; | 49 return; |
50 | 50 |
51 if (CrosSettingsProvider::TRUSTED == | 51 if (CrosSettingsProvider::TRUSTED == |
52 settings_.PrepareTrustedValues( | 52 settings_.PrepareTrustedValues( |
53 base::Bind(&CrosSettingsTest::FetchPref, | 53 base::Bind(&CrosSettingsTest::FetchPref, |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 EXPECT_TRUE(wildcard_match); | 260 EXPECT_TRUE(wildcard_match); |
261 EXPECT_TRUE(cs->FindEmailInList( | 261 EXPECT_TRUE(cs->FindEmailInList( |
262 kAccountsPrefUsers, "user@example.com", &wildcard_match)); | 262 kAccountsPrefUsers, "user@example.com", &wildcard_match)); |
263 EXPECT_FALSE(wildcard_match); | 263 EXPECT_FALSE(wildcard_match); |
264 EXPECT_TRUE(cs->FindEmailInList( | 264 EXPECT_TRUE(cs->FindEmailInList( |
265 kAccountsPrefUsers, "*@example.com", &wildcard_match)); | 265 kAccountsPrefUsers, "*@example.com", &wildcard_match)); |
266 EXPECT_TRUE(wildcard_match); | 266 EXPECT_TRUE(wildcard_match); |
267 } | 267 } |
268 | 268 |
269 } // namespace chromeos | 269 } // namespace chromeos |
OLD | NEW |