OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/mock_cros_settings.h" | 5 #include "chrome/browser/chromeos/mock_cros_settings.h" |
6 | 6 |
7 namespace chromeos { | 7 namespace chromeos { |
8 | 8 |
9 MockCrosSettings::MockCrosSettings() | 9 MockCrosSettings::MockCrosSettings() |
10 : dict_(new DictionaryValue) { | 10 : dict_(new DictionaryValue) { |
11 // Some mock settings | 11 // Some mock settings |
12 SetBoolean(kAccountsPrefAllowBWSI, true); | 12 SetBoolean(kAccountsPrefAllowBWSI, true); |
13 SetBoolean(kAccountsPrefAllowGuest, true); | 13 SetBoolean(kAccountsPrefAllowGuest, true); |
14 SetBoolean(kAccountsPrefShowUserNamesOnSignIn, true); | |
15 | 14 |
16 ListValue* user_list = new ListValue; | 15 ListValue* user_list = new ListValue; |
17 | 16 |
18 DictionaryValue* mock_user = new DictionaryValue; | 17 DictionaryValue* mock_user = new DictionaryValue; |
19 mock_user->SetString(L"email", L"mock_user_1@gmail.com"); | 18 mock_user->SetString(L"email", L"mock_user_1@gmail.com"); |
20 mock_user->SetString(L"name", L"Mock User One"); | |
21 mock_user->SetBoolean(L"owner", true); | |
22 user_list->Append(mock_user); | 19 user_list->Append(mock_user); |
23 | 20 |
24 mock_user = new DictionaryValue; | 21 mock_user = new DictionaryValue; |
25 mock_user->SetString(L"email", L"mock_user_2@gmail.com"); | 22 mock_user->SetString(L"email", L"mock_user_2@gmail.com"); |
26 mock_user->SetString(L"name", L"Mock User Two"); | |
27 mock_user->SetBoolean(L"owner", false); | |
28 user_list->Append(mock_user); | 23 user_list->Append(mock_user); |
29 | 24 |
30 Set(kAccountsPrefUsers, user_list); | 25 Set(kAccountsPrefUsers, user_list); |
31 } | 26 } |
32 | 27 |
33 void MockCrosSettings::Set(const std::wstring& path, Value* in_value) { | 28 void MockCrosSettings::Set(const std::wstring& path, Value* in_value) { |
34 dict_->Set(path, in_value); | 29 dict_->Set(path, in_value); |
35 } | 30 } |
36 | 31 |
37 bool MockCrosSettings::Get(const std::wstring& path, Value** out_value) const { | 32 bool MockCrosSettings::Get(const std::wstring& path, Value** out_value) const { |
38 return dict_->Get(path, out_value); | 33 return dict_->Get(path, out_value); |
39 } | 34 } |
40 | 35 |
41 } // namespace chromeos | 36 } // namespace chromeos |
OLD | NEW |