1 // Copyright (c) 2013 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.
8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/stl_util.h"
11 #include "chromeos/dbus/dbus_thread_manager.h"
12 #include "chromeos/dbus/mock_dbus_thread_manager.h"
13 #include "chromeos/dbus/mock_shill_manager_client.h"
14 #include "chromeos/dbus/mock_shill_profile_client.h"
15 #include "chromeos/dbus/mock_shill_service_client.h"
16 #include "chromeos/network/managed_network_configuration_handler_impl.h"
17 #include "chromeos/network/network_configuration_handler.h"
18 #include "chromeos/network/network_profile_handler.h"
19 #include "chromeos/network/onc/onc_test_utils.h"
20 #include "chromeos/network/onc/onc_utils.h"
21 #include "dbus/object_path.h"
22 #include "testing/gmock/include/gmock/gmock.h"
23 #include "testing/gtest/include/gtest/gtest.h"
24 #include "third_party/cros_system_api/dbus/service_constants.h"
26 using ::testing::AnyNumber;
27 using ::testing::Invoke;
28 using ::testing::Mock;
29 using ::testing::Pointee;
30 using ::testing::Return;
31 using ::testing::SaveArg;
32 using ::testing::StrEq;
33 using ::testing::StrictMock;
36 namespace test_utils = ::chromeos::onc::test_utils;
42 std::string ValueToString(const base::Value* value) {
43 std::stringstream str;
48 const char kSharedProfilePath[] = "/profile/default";
49 const char kUser1[] = "user1";
50 const char kUser1ProfilePath[] = "/profile/user1/shill";
52 // Matcher to match base::Value.
55 std::string(negation ? "isn't" : "is") + " equal to " +
56 ValueToString(value)) {
57 return value->Equals(&arg);
60 class ShillProfileTestClient {
62 typedef ShillClientHelper::DictionaryValueCallbackWithoutStatus
63 DictionaryValueCallbackWithoutStatus;
64 typedef ShillClientHelper::ErrorCallback ErrorCallback;
66 void AddProfile(const std::string& profile_path,
67 const std::string& userhash) {
68 if (profile_entries_.HasKey(profile_path))
71 base::DictionaryValue* profile = new base::DictionaryValue;
72 profile_entries_.SetWithoutPathExpansion(profile_path, profile);
73 profile_to_user_[profile_path] = userhash;
76 void AddEntry(const std::string& profile_path,
77 const std::string& entry_path,
78 const base::DictionaryValue& entry) {
79 base::DictionaryValue* entries = NULL;
80 profile_entries_.GetDictionaryWithoutPathExpansion(profile_path, &entries);
83 base::DictionaryValue* new_entry = entry.DeepCopy();
84 new_entry->SetStringWithoutPathExpansion(shill::kProfileProperty,
86 entries->SetWithoutPathExpansion(entry_path, new_entry);
89 void GetProperties(const dbus::ObjectPath& profile_path,
90 const DictionaryValueCallbackWithoutStatus& callback,
91 const ErrorCallback& error_callback) {
92 base::DictionaryValue* entries = NULL;
93 profile_entries_.GetDictionaryWithoutPathExpansion(profile_path.value(),
97 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue);
98 base::ListValue* entry_paths = new base::ListValue;
99 result->SetWithoutPathExpansion(shill::kEntriesProperty, entry_paths);
100 for (base::DictionaryValue::Iterator it(*entries); !it.IsAtEnd();
102 entry_paths->AppendString(it.key());
105 ASSERT_TRUE(ContainsKey(profile_to_user_, profile_path.value()));
106 const std::string& userhash = profile_to_user_[profile_path.value()];
107 result->SetStringWithoutPathExpansion(shill::kUserHashProperty, userhash);
109 callback.Run(*result);
112 void GetEntry(const dbus::ObjectPath& profile_path,
113 const std::string& entry_path,
114 const DictionaryValueCallbackWithoutStatus& callback,
115 const ErrorCallback& error_callback) {
116 base::DictionaryValue* entries = NULL;
117 profile_entries_.GetDictionaryWithoutPathExpansion(profile_path.value(),
119 ASSERT_TRUE(entries);
121 base::DictionaryValue* entry = NULL;
122 entries->GetDictionaryWithoutPathExpansion(entry_path, &entry);
124 callback.Run(*entry);
128 base::DictionaryValue profile_entries_;
129 std::map<std::string, std::string> profile_to_user_;
132 class TestNetworkProfileHandler : public NetworkProfileHandler {
134 TestNetworkProfileHandler() {
135 Init(NULL /* No NetworkStateHandler */);
137 virtual ~TestNetworkProfileHandler() {}
139 void AddProfileForTest(const NetworkProfile& profile) {
144 DISALLOW_COPY_AND_ASSIGN(TestNetworkProfileHandler);
149 class ManagedNetworkConfigurationHandlerTest : public testing::Test {
151 ManagedNetworkConfigurationHandlerTest() {
154 virtual ~ManagedNetworkConfigurationHandlerTest() {
157 virtual void SetUp() OVERRIDE {
158 MockDBusThreadManager* dbus_thread_manager = new MockDBusThreadManager;
159 EXPECT_CALL(*dbus_thread_manager, GetSystemBus())
160 .WillRepeatedly(Return(static_cast<dbus::Bus*>(NULL)));
161 DBusThreadManager::InitializeForTesting(dbus_thread_manager);
163 SetNetworkConfigurationHandlerExpectations();
165 EXPECT_CALL(*dbus_thread_manager, GetShillManagerClient())
166 .WillRepeatedly(Return(&mock_manager_client_));
167 EXPECT_CALL(*dbus_thread_manager, GetShillServiceClient())
168 .WillRepeatedly(Return(&mock_service_client_));
169 EXPECT_CALL(*dbus_thread_manager, GetShillProfileClient())
170 .WillRepeatedly(Return(&mock_profile_client_));
172 ON_CALL(mock_profile_client_, GetProperties(_,_,_))
173 .WillByDefault(Invoke(&profiles_stub_,
174 &ShillProfileTestClient::GetProperties));
176 ON_CALL(mock_profile_client_, GetEntry(_,_,_,_))
177 .WillByDefault(Invoke(&profiles_stub_,
178 &ShillProfileTestClient::GetEntry));
180 network_profile_handler_.reset(new TestNetworkProfileHandler());
181 network_configuration_handler_.reset(
182 NetworkConfigurationHandler::InitializeForTest(
183 NULL /* no NetworkStateHandler */));
184 managed_network_configuration_handler_.reset(
185 new ManagedNetworkConfigurationHandlerImpl());
186 managed_network_configuration_handler_->Init(
187 NULL /* no NetworkStateHandler */,
188 network_profile_handler_.get(),
189 network_configuration_handler_.get());
191 message_loop_.RunUntilIdle();
194 virtual void TearDown() OVERRIDE {
195 managed_network_configuration_handler_.reset();
196 network_configuration_handler_.reset();
197 network_profile_handler_.reset();
198 DBusThreadManager::Shutdown();
201 void VerifyAndClearExpectations() {
202 Mock::VerifyAndClearExpectations(&mock_manager_client_);
203 Mock::VerifyAndClearExpectations(&mock_service_client_);
204 Mock::VerifyAndClearExpectations(&mock_profile_client_);
205 SetNetworkConfigurationHandlerExpectations();
208 void InitializeStandardProfiles() {
209 profiles_stub_.AddProfile(kUser1ProfilePath, kUser1);
210 network_profile_handler_->
211 AddProfileForTest(NetworkProfile(kUser1ProfilePath, kUser1));
212 network_profile_handler_->
213 AddProfileForTest(NetworkProfile(kSharedProfilePath, std::string()));
216 void SetUpEntry(const std::string& path_to_shill_json,
217 const std::string& profile_path,
218 const std::string& entry_path) {
219 scoped_ptr<base::DictionaryValue> entry =
220 test_utils::ReadTestDictionary(path_to_shill_json);
221 profiles_stub_.AddEntry(profile_path, entry_path, *entry);
224 void SetPolicy(::onc::ONCSource onc_source,
225 const std::string& userhash,
226 const std::string& path_to_onc) {
227 scoped_ptr<base::DictionaryValue> policy;
228 if (path_to_onc.empty())
229 policy = onc::ReadDictionaryFromJson(onc::kEmptyUnencryptedConfiguration);
231 policy = test_utils::ReadTestDictionary(path_to_onc);
233 base::ListValue empty_network_configs;
234 base::ListValue* network_configs = &empty_network_configs;
235 policy->GetListWithoutPathExpansion(
236 ::onc::toplevel_config::kNetworkConfigurations, &network_configs);
238 base::DictionaryValue empty_global_config;
239 base::DictionaryValue* global_network_config = &empty_global_config;
240 policy->GetDictionaryWithoutPathExpansion(
241 ::onc::toplevel_config::kGlobalNetworkConfiguration,
242 &global_network_config);
244 managed_handler()->SetPolicy(
245 onc_source, userhash, *network_configs, *global_network_config);
248 void SetNetworkConfigurationHandlerExpectations() {
249 // These calls occur in NetworkConfigurationHandler.
250 EXPECT_CALL(mock_manager_client_, GetProperties(_)).Times(AnyNumber());
251 EXPECT_CALL(mock_manager_client_,
252 AddPropertyChangedObserver(_)).Times(AnyNumber());
253 EXPECT_CALL(mock_manager_client_,
254 RemovePropertyChangedObserver(_)).Times(AnyNumber());
257 ManagedNetworkConfigurationHandler* managed_handler() {
258 return managed_network_configuration_handler_.get();
262 StrictMock<MockShillManagerClient> mock_manager_client_;
263 StrictMock<MockShillServiceClient> mock_service_client_;
264 StrictMock<MockShillProfileClient> mock_profile_client_;
265 ShillProfileTestClient profiles_stub_;
266 scoped_ptr<TestNetworkProfileHandler> network_profile_handler_;
267 scoped_ptr<NetworkConfigurationHandler> network_configuration_handler_;
268 scoped_ptr<ManagedNetworkConfigurationHandlerImpl>
269 managed_network_configuration_handler_;
270 base::MessageLoop message_loop_;
273 DISALLOW_COPY_AND_ASSIGN(ManagedNetworkConfigurationHandlerTest);
276 TEST_F(ManagedNetworkConfigurationHandlerTest, ProfileInitialization) {
277 InitializeStandardProfiles();
278 message_loop_.RunUntilIdle();
281 TEST_F(ManagedNetworkConfigurationHandlerTest, RemoveIrrelevantFields) {
282 InitializeStandardProfiles();
283 scoped_ptr<base::DictionaryValue> expected_shill_properties =
284 test_utils::ReadTestDictionary(
285 "policy/shill_policy_on_unconfigured_wifi1.json");
287 EXPECT_CALL(mock_profile_client_,
288 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
290 EXPECT_CALL(mock_manager_client_,
291 ConfigureServiceForProfile(
292 dbus::ObjectPath(kUser1ProfilePath),
293 IsEqualTo(expected_shill_properties.get()),
296 SetPolicy(::onc::ONC_SOURCE_USER_POLICY,
298 "policy/policy_wifi1_with_redundant_fields.onc");
299 message_loop_.RunUntilIdle();
302 TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyManageUnconfigured) {
303 InitializeStandardProfiles();
304 scoped_ptr<base::DictionaryValue> expected_shill_properties =
305 test_utils::ReadTestDictionary(
306 "policy/shill_policy_on_unconfigured_wifi1.json");
308 EXPECT_CALL(mock_profile_client_,
309 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
311 EXPECT_CALL(mock_manager_client_,
312 ConfigureServiceForProfile(
313 dbus::ObjectPath(kUser1ProfilePath),
314 IsEqualTo(expected_shill_properties.get()),
317 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
318 message_loop_.RunUntilIdle();
321 // Ensure that EAP settings for ethernet are matched with the right profile
322 // entry and written to the dedicated EthernetEAP service.
323 TEST_F(ManagedNetworkConfigurationHandlerTest,
324 SetPolicyManageUnmanagedEthernetEAP) {
325 InitializeStandardProfiles();
326 scoped_ptr<base::DictionaryValue> expected_shill_properties =
327 test_utils::ReadTestDictionary(
329 "shill_policy_on_unmanaged_ethernet_eap.json");
331 SetUpEntry("policy/shill_unmanaged_ethernet_eap.json",
335 // Also setup an unrelated WiFi configuration to verify that the right entry
337 SetUpEntry("policy/shill_unmanaged_wifi1.json",
341 EXPECT_CALL(mock_profile_client_,
342 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
344 EXPECT_CALL(mock_profile_client_,
345 GetEntry(dbus::ObjectPath(kUser1ProfilePath), _, _, _)).Times(2);
348 mock_profile_client_,
349 DeleteEntry(dbus::ObjectPath(kUser1ProfilePath), "eth_entry", _, _));
352 mock_manager_client_,
353 ConfigureServiceForProfile(dbus::ObjectPath(kUser1ProfilePath),
354 IsEqualTo(expected_shill_properties.get()),
358 ::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_ethernet_eap.onc");
359 message_loop_.RunUntilIdle();
362 TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyIgnoreUnmodified) {
363 InitializeStandardProfiles();
364 EXPECT_CALL(mock_profile_client_, GetProperties(_, _, _));
366 EXPECT_CALL(mock_manager_client_, ConfigureServiceForProfile(_, _, _, _));
368 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
369 message_loop_.RunUntilIdle();
370 VerifyAndClearExpectations();
372 SetUpEntry("policy/shill_policy_on_unmanaged_wifi1.json",
376 EXPECT_CALL(mock_profile_client_, GetProperties(_, _, _));
379 mock_profile_client_,
380 GetEntry(dbus::ObjectPath(kUser1ProfilePath), "some_entry_path", _, _));
382 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
383 message_loop_.RunUntilIdle();
386 TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyManageUnmanaged) {
387 InitializeStandardProfiles();
388 SetUpEntry("policy/shill_unmanaged_wifi1.json",
392 scoped_ptr<base::DictionaryValue> expected_shill_properties =
393 test_utils::ReadTestDictionary(
394 "policy/shill_policy_on_unmanaged_wifi1.json");
396 EXPECT_CALL(mock_profile_client_,
397 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
400 mock_profile_client_,
401 GetEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _));
404 mock_profile_client_,
405 DeleteEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _));
407 EXPECT_CALL(mock_manager_client_,
408 ConfigureServiceForProfile(
409 dbus::ObjectPath(kUser1ProfilePath),
410 IsEqualTo(expected_shill_properties.get()),
413 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
414 message_loop_.RunUntilIdle();
417 // Old ChromeOS versions may not have used the UIData property
418 TEST_F(ManagedNetworkConfigurationHandlerTest,
419 SetPolicyManageUnmanagedWithoutUIData) {
420 InitializeStandardProfiles();
421 SetUpEntry("policy/shill_unmanaged_wifi1.json",
425 scoped_ptr<base::DictionaryValue> expected_shill_properties =
426 test_utils::ReadTestDictionary(
427 "policy/shill_policy_on_unmanaged_wifi1.json");
429 EXPECT_CALL(mock_profile_client_,
430 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
433 mock_profile_client_,
434 GetEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _));
437 mock_profile_client_,
438 DeleteEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _));
440 EXPECT_CALL(mock_manager_client_,
441 ConfigureServiceForProfile(
442 dbus::ObjectPath(kUser1ProfilePath),
443 IsEqualTo(expected_shill_properties.get()),
446 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
447 message_loop_.RunUntilIdle();
450 TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyUpdateManagedNewGUID) {
451 InitializeStandardProfiles();
452 SetUpEntry("policy/shill_managed_wifi1.json",
456 scoped_ptr<base::DictionaryValue> expected_shill_properties =
457 test_utils::ReadTestDictionary(
458 "policy/shill_policy_on_unmanaged_wifi1.json");
460 // The passphrase isn't sent again, because it's configured by the user and
461 // Shill doesn't sent it on GetProperties calls.
462 expected_shill_properties->RemoveWithoutPathExpansion(
463 shill::kPassphraseProperty, NULL);
465 EXPECT_CALL(mock_profile_client_,
466 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
469 mock_profile_client_,
470 GetEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _));
473 mock_profile_client_,
474 DeleteEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _));
476 EXPECT_CALL(mock_manager_client_,
477 ConfigureServiceForProfile(
478 dbus::ObjectPath(kUser1ProfilePath),
479 IsEqualTo(expected_shill_properties.get()),
482 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
483 message_loop_.RunUntilIdle();
486 TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyReapplyToManaged) {
487 InitializeStandardProfiles();
488 SetUpEntry("policy/shill_policy_on_unmanaged_wifi1.json",
492 scoped_ptr<base::DictionaryValue> expected_shill_properties =
493 test_utils::ReadTestDictionary(
494 "policy/shill_policy_on_unmanaged_wifi1.json");
496 // The passphrase isn't sent again, because it's configured by the user and
497 // Shill doesn't sent it on GetProperties calls.
498 expected_shill_properties->RemoveWithoutPathExpansion(
499 shill::kPassphraseProperty, NULL);
501 EXPECT_CALL(mock_profile_client_,
502 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
505 mock_profile_client_,
506 GetEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _));
508 EXPECT_CALL(mock_manager_client_,
509 ConfigureServiceForProfile(
510 dbus::ObjectPath(kUser1ProfilePath),
511 IsEqualTo(expected_shill_properties.get()),
514 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
515 message_loop_.RunUntilIdle();
516 VerifyAndClearExpectations();
518 // If we apply the policy again, without change, then the Shill profile will
520 EXPECT_CALL(mock_profile_client_,
521 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
524 mock_profile_client_,
525 GetEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _));
527 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
528 message_loop_.RunUntilIdle();
531 TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyUnmanageManaged) {
532 InitializeStandardProfiles();
533 SetUpEntry("policy/shill_policy_on_unmanaged_wifi1.json",
537 EXPECT_CALL(mock_profile_client_,
538 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
540 EXPECT_CALL(mock_profile_client_,
541 GetEntry(dbus::ObjectPath(kUser1ProfilePath),
545 EXPECT_CALL(mock_profile_client_,
546 DeleteEntry(dbus::ObjectPath(kUser1ProfilePath),
550 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "");
551 message_loop_.RunUntilIdle();
554 TEST_F(ManagedNetworkConfigurationHandlerTest, SetEmptyPolicyIgnoreUnmanaged) {
555 InitializeStandardProfiles();
556 SetUpEntry("policy/shill_unmanaged_wifi1.json",
560 EXPECT_CALL(mock_profile_client_,
561 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
563 EXPECT_CALL(mock_profile_client_,
564 GetEntry(dbus::ObjectPath(kUser1ProfilePath),
568 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "");
569 message_loop_.RunUntilIdle();
572 TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyIgnoreUnmanaged) {
573 InitializeStandardProfiles();
574 SetUpEntry("policy/shill_unmanaged_wifi2.json",
578 EXPECT_CALL(mock_profile_client_,
579 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
582 mock_profile_client_,
583 GetEntry(dbus::ObjectPath(kUser1ProfilePath), "wifi2_entry_path", _, _));
585 scoped_ptr<base::DictionaryValue> expected_shill_properties =
586 test_utils::ReadTestDictionary(
587 "policy/shill_policy_on_unconfigured_wifi1.json");
589 EXPECT_CALL(mock_manager_client_,
590 ConfigureServiceForProfile(
591 dbus::ObjectPath(kUser1ProfilePath),
592 IsEqualTo(expected_shill_properties.get()),
595 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
596 message_loop_.RunUntilIdle();
599 TEST_F(ManagedNetworkConfigurationHandlerTest, AutoConnectDisallowed) {
600 InitializeStandardProfiles();
601 SetUpEntry("policy/shill_unmanaged_wifi2.json",
605 EXPECT_CALL(mock_profile_client_,
606 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
609 mock_profile_client_,
610 GetEntry(dbus::ObjectPath(kUser1ProfilePath), "wifi2_entry_path", _, _));
612 scoped_ptr<base::DictionaryValue> expected_shill_properties =
613 test_utils::ReadTestDictionary(
614 "policy/shill_disallow_autoconnect_on_unmanaged_wifi2.json");
616 EXPECT_CALL(mock_manager_client_,
617 ConfigureServiceForProfile(
618 dbus::ObjectPath(kUser1ProfilePath),
619 IsEqualTo(expected_shill_properties.get()),
622 SetPolicy(::onc::ONC_SOURCE_USER_POLICY,
624 "policy/policy_disallow_autoconnect.onc");
625 message_loop_.RunUntilIdle();
628 TEST_F(ManagedNetworkConfigurationHandlerTest, LateProfileLoading) {
629 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
631 message_loop_.RunUntilIdle();
632 VerifyAndClearExpectations();
634 scoped_ptr<base::DictionaryValue> expected_shill_properties =
635 test_utils::ReadTestDictionary(
636 "policy/shill_policy_on_unconfigured_wifi1.json");
638 EXPECT_CALL(mock_profile_client_,
639 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
641 EXPECT_CALL(mock_manager_client_,
642 ConfigureServiceForProfile(
643 dbus::ObjectPath(kUser1ProfilePath),
644 IsEqualTo(expected_shill_properties.get()),
647 InitializeStandardProfiles();
648 message_loop_.RunUntilIdle();
651 } // namespace chromeos