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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 void FinalReplyWhenSatisfied( | 107 void FinalReplyWhenSatisfied( |
108 Namespace settings_namespace, | 108 Namespace settings_namespace, |
109 const std::string& normal_action, | 109 const std::string& normal_action, |
110 const std::string& incognito_action) { | 110 const std::string& incognito_action) { |
111 MaybeLoadAndReplyWhenSatisfied( | 111 MaybeLoadAndReplyWhenSatisfied( |
112 settings_namespace, normal_action, incognito_action, NULL, true); | 112 settings_namespace, normal_action, incognito_action, NULL, true); |
113 } | 113 } |
114 | 114 |
115 syncer::SyncableService* GetSyncableService() { | 115 syncer::SyncableService* GetSyncableService() { |
116 return settings_sync_util::GetSyncableServiceProvider(browser()->profile(), | 116 return settings_sync_util::GetSyncableService(browser()->profile(), |
117 kModelType) | 117 kModelType); |
118 .Run() | |
119 .get(); | |
120 } | 118 } |
121 | 119 |
122 void InitSync(syncer::SyncChangeProcessor* sync_processor) { | 120 void InitSync(syncer::SyncChangeProcessor* sync_processor) { |
123 base::RunLoop().RunUntilIdle(); | 121 base::RunLoop().RunUntilIdle(); |
124 InitSyncWithSyncableService(sync_processor, GetSyncableService()); | 122 InitSyncWithSyncableService(sync_processor, GetSyncableService()); |
125 } | 123 } |
126 | 124 |
127 void SendChanges(const syncer::SyncChangeList& change_list) { | 125 void SendChanges(const syncer::SyncChangeList& change_list) { |
128 base::RunLoop().RunUntilIdle(); | 126 base::RunLoop().RunUntilIdle(); |
129 SendChangesToSyncableService(change_list, GetSyncableService()); | 127 SendChangesToSyncableService(change_list, GetSyncableService()); |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 // Disable the 'managed' namespace. | 564 // Disable the 'managed' namespace. |
567 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); | 565 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); |
568 frontend->DisableStorageForTesting(MANAGED); | 566 frontend->DisableStorageForTesting(MANAGED); |
569 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); | 567 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); |
570 // Now run the extension. | 568 // Now run the extension. |
571 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) | 569 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) |
572 << message_; | 570 << message_; |
573 } | 571 } |
574 | 572 |
575 } // namespace extensions | 573 } // namespace extensions |
OLD | NEW |