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

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

Issue 1890163004: extensions: Abstract out install delay strategy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for comments in #4 Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extension_service_test_base.h" 5 #include "chrome/browser/extensions/extension_service_test_base.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
16 #include "build/build_config.h" 16 #include "build/build_config.h"
17 #include "chrome/browser/extensions/component_loader.h" 17 #include "chrome/browser/extensions/component_loader.h"
18 #include "chrome/browser/extensions/extension_error_reporter.h" 18 #include "chrome/browser/extensions/extension_error_reporter.h"
19 #include "chrome/browser/extensions/extension_garbage_collector_factory.h" 19 #include "chrome/browser/extensions/extension_garbage_collector_factory.h"
20 #include "chrome/browser/extensions/extension_service.h" 20 #include "chrome/browser/extensions/extension_service.h"
21 #include "chrome/browser/extensions/shared_module_service.h"
21 #include "chrome/browser/extensions/test_extension_system.h" 22 #include "chrome/browser/extensions/test_extension_system.h"
22 #include "chrome/browser/extensions/updater/extension_updater.h" 23 #include "chrome/browser/extensions/updater/extension_updater.h"
23 #include "chrome/browser/prefs/browser_prefs.h" 24 #include "chrome/browser/prefs/browser_prefs.h"
24 #include "chrome/common/chrome_constants.h" 25 #include "chrome/common/chrome_constants.h"
25 #include "chrome/common/chrome_paths.h" 26 #include "chrome/common/chrome_paths.h"
26 #include "chrome/test/base/testing_browser_process.h" 27 #include "chrome/test/base/testing_browser_process.h"
27 #include "chrome/test/base/testing_profile.h" 28 #include "chrome/test/base/testing_profile.h"
28 #include "components/pref_registry/pref_registry_syncable.h" 29 #include "components/pref_registry/pref_registry_syncable.h"
29 #include "components/syncable_prefs/pref_service_mock_factory.h" 30 #include "components/syncable_prefs/pref_service_mock_factory.h"
30 #include "components/syncable_prefs/pref_service_syncable.h" 31 #include "components/syncable_prefs/pref_service_syncable.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 312
312 service_ = 313 service_ =
313 system->CreateExtensionService(base::CommandLine::ForCurrentProcess(), 314 system->CreateExtensionService(base::CommandLine::ForCurrentProcess(),
314 params.extensions_install_dir, 315 params.extensions_install_dir,
315 params.autoupdate_enabled); 316 params.autoupdate_enabled);
316 317
317 service_->SetFileTaskRunnerForTesting( 318 service_->SetFileTaskRunnerForTesting(
318 base::ThreadTaskRunnerHandle::Get().get()); 319 base::ThreadTaskRunnerHandle::Get().get());
319 service_->set_extensions_enabled(true); 320 service_->set_extensions_enabled(true);
320 service_->set_show_extensions_prompts(false); 321 service_->set_show_extensions_prompts(false);
321 service_->set_install_updates_when_idle_for_test(false);
322 service_->component_loader()->set_ignore_whitelist_for_testing(true); 322 service_->component_loader()->set_ignore_whitelist_for_testing(true);
323 323
324 // When we start up, we want to make sure there is no external provider, 324 // When we start up, we want to make sure there is no external provider,
325 // since the ExtensionService on Windows will use the Registry as a default 325 // since the ExtensionService on Windows will use the Registry as a default
326 // provider and if there is something already registered there then it will 326 // provider and if there is something already registered there then it will
327 // interfere with the tests. Those tests that need an external provider 327 // interfere with the tests. Those tests that need an external provider
328 // will register one specifically. 328 // will register one specifically.
329 service_->ClearProvidersForTesting(); 329 service_->ClearProvidersForTesting();
330 330
331 service_->RegisterInstallGate(ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS,
332 service_->shared_module_service());
333
331 #if defined(OS_CHROMEOS) 334 #if defined(OS_CHROMEOS)
332 InstallLimiter::Get(profile_.get())->DisableForTest(); 335 InstallLimiter::Get(profile_.get())->DisableForTest();
333 #endif 336 #endif
334 } 337 }
335 338
336 } // namespace extensions 339 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/extension_system_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698