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

Side by Side Diff: chrome/browser/extensions/api/storage/settings_apitest.cc

Issue 147923005: Split ExtensionSystem interface from ExtensionSystemImpl implementation, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/json/json_writer.h" 6 #include "base/json/json_writer.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/api/storage/settings_frontend.h" 10 #include "chrome/browser/extensions/api/storage/settings_frontend.h"
11 #include "chrome/browser/extensions/api/storage/settings_namespace.h" 11 #include "chrome/browser/extensions/api/storage/settings_namespace.h"
12 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" 12 #include "chrome/browser/extensions/api/storage/settings_sync_util.h"
13 #include "chrome/browser/extensions/extension_apitest.h" 13 #include "chrome/browser/extensions/extension_apitest.h"
14 #include "chrome/browser/extensions/extension_service.h" 14 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/browser/extensions/extension_system.h"
16 #include "chrome/browser/extensions/extension_system_factory.h" 15 #include "chrome/browser/extensions/extension_system_factory.h"
17 #include "chrome/browser/extensions/extension_test_message_listener.h" 16 #include "chrome/browser/extensions/extension_test_message_listener.h"
18 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/ui/browser.h" 18 #include "chrome/browser/ui/browser.h"
20 #include "chrome/test/base/ui_test_utils.h" 19 #include "chrome/test/base/ui_test_utils.h"
20 #include "extensions/browser/extension_system.h"
21 #include "extensions/common/value_builder.h" 21 #include "extensions/common/value_builder.h"
22 #include "sync/api/sync_change.h" 22 #include "sync/api/sync_change.h"
23 #include "sync/api/sync_change_processor.h" 23 #include "sync/api/sync_change_processor.h"
24 #include "sync/api/sync_error_factory.h" 24 #include "sync/api/sync_error_factory.h"
25 #include "sync/api/sync_error_factory_mock.h" 25 #include "sync/api/sync_error_factory_mock.h"
26 #include "testing/gmock/include/gmock/gmock.h" 26 #include "testing/gmock/include/gmock/gmock.h"
27 27
28 #if defined(ENABLE_CONFIGURATION_POLICY) 28 #if defined(ENABLE_CONFIGURATION_POLICY)
29 #include "chrome/browser/policy/schema_registry_service.h" 29 #include "chrome/browser/policy/schema_registry_service.h"
30 #include "chrome/browser/policy/schema_registry_service_factory.h" 30 #include "chrome/browser/policy/schema_registry_service_factory.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); 452 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED));
453 #endif 453 #endif
454 } 454 }
455 455
456 #if defined(ENABLE_CONFIGURATION_POLICY) 456 #if defined(ENABLE_CONFIGURATION_POLICY)
457 457
458 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, ExtensionsSchemas) { 458 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, ExtensionsSchemas) {
459 // Verifies that the Schemas for the extensions domain are created on startup. 459 // Verifies that the Schemas for the extensions domain are created on startup.
460 Profile* profile = browser()->profile(); 460 Profile* profile = browser()->profile();
461 ExtensionSystem* extension_system = 461 ExtensionSystem* extension_system =
462 ExtensionSystemFactory::GetForProfile(profile); 462 ExtensionSystemFactory::GetForBrowserContext(profile);
James Cook 2014/01/28 23:40:57 Maybe just ExtensionSystem::Get(profile)?
Yoyo Zhou 2014/01/29 00:42:56 Done.
463 if (!extension_system->ready().is_signaled()) { 463 if (!extension_system->ready().is_signaled()) {
464 // Wait until the extension system is ready. 464 // Wait until the extension system is ready.
465 base::RunLoop run_loop; 465 base::RunLoop run_loop;
466 extension_system->ready().Post(FROM_HERE, run_loop.QuitClosure()); 466 extension_system->ready().Post(FROM_HERE, run_loop.QuitClosure());
467 run_loop.Run(); 467 run_loop.Run();
468 ASSERT_TRUE(extension_system->ready().is_signaled()); 468 ASSERT_TRUE(extension_system->ready().is_signaled());
469 } 469 }
470 470
471 // This test starts without any test extensions installed. 471 // This test starts without any test extensions installed.
472 EXPECT_FALSE(GetSingleLoadedExtension()); 472 EXPECT_FALSE(GetSingleLoadedExtension());
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 SettingsFrontend* frontend = 614 SettingsFrontend* frontend =
615 browser()->profile()->GetExtensionService()->settings_frontend(); 615 browser()->profile()->GetExtensionService()->settings_frontend();
616 frontend->DisableStorageForTesting(MANAGED); 616 frontend->DisableStorageForTesting(MANAGED);
617 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); 617 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED));
618 // Now run the extension. 618 // Now run the extension.
619 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) 619 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled"))
620 << message_; 620 << message_;
621 } 621 }
622 622
623 } // namespace extensions 623 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698