Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: chrome/browser/extensions/test_extension_prefs.cc

Issue 2825963003: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/extensions (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/extensions/test_extension_prefs.h" 5 #include "chrome/browser/extensions/test_extension_prefs.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 void TestExtensionPrefs::RecreateExtensionPrefs() { 103 void TestExtensionPrefs::RecreateExtensionPrefs() {
104 // We persist and reload the PrefService's PrefStores because this process 104 // We persist and reload the PrefService's PrefStores because this process
105 // deletes all empty dictionaries. The ExtensionPrefs implementation 105 // deletes all empty dictionaries. The ExtensionPrefs implementation
106 // needs to be able to handle this situation. 106 // needs to be able to handle this situation.
107 if (pref_service_) { 107 if (pref_service_) {
108 // Commit a pending write (which posts a task to task_runner_) and wait for 108 // Commit a pending write (which posts a task to task_runner_) and wait for
109 // it to finish. 109 // it to finish.
110 pref_service_->CommitPendingWrite(); 110 pref_service_->CommitPendingWrite();
111 base::RunLoop run_loop; 111 base::RunLoop run_loop;
112 ASSERT_TRUE( 112 ASSERT_TRUE(task_runner_->PostTaskAndReply(
113 task_runner_->PostTaskAndReply( 113 FROM_HERE, base::BindOnce(&base::DoNothing), run_loop.QuitClosure()));
114 FROM_HERE,
115 base::Bind(&base::DoNothing),
116 run_loop.QuitClosure()));
117 run_loop.Run(); 114 run_loop.Run();
118 } 115 }
119 116
120 extension_pref_value_map_.reset(new ExtensionPrefValueMap); 117 extension_pref_value_map_.reset(new ExtensionPrefValueMap);
121 sync_preferences::PrefServiceMockFactory factory; 118 sync_preferences::PrefServiceMockFactory factory;
122 factory.SetUserPrefsFile(preferences_file_, task_runner_.get()); 119 factory.SetUserPrefsFile(preferences_file_, task_runner_.get());
123 factory.set_extension_prefs( 120 factory.set_extension_prefs(
124 new ExtensionPrefStore(extension_pref_value_map_.get(), false)); 121 new ExtensionPrefStore(extension_pref_value_map_.get(), false));
125 pref_service_ = factory.CreateSyncable(pref_registry_.get()); 122 pref_service_ = factory.CreateSyncable(pref_registry_.get());
126 std::unique_ptr<ExtensionPrefs> prefs(ExtensionPrefs::Create( 123 std::unique_ptr<ExtensionPrefs> prefs(ExtensionPrefs::Create(
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { 204 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) {
208 extensions_disabled_ = extensions_disabled; 205 extensions_disabled_ = extensions_disabled;
209 } 206 }
210 207
211 ChromeAppSorting* TestExtensionPrefs::app_sorting() { 208 ChromeAppSorting* TestExtensionPrefs::app_sorting() {
212 return static_cast<ChromeAppSorting*>( 209 return static_cast<ChromeAppSorting*>(
213 ExtensionSystem::Get(&profile_)->app_sorting()); 210 ExtensionSystem::Get(&profile_)->app_sorting());
214 } 211 }
215 212
216 } // namespace extensions 213 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/test_blacklist.cc ('k') | chrome/browser/extensions/unpacked_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698