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

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

Issue 349643002: Decoupled the SchemaRegistryService from SchemaRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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_sync_util.h" 10 #include "chrome/browser/extensions/api/storage/settings_sync_util.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 extension_system->ready().Post(FROM_HERE, run_loop.QuitClosure()); 425 extension_system->ready().Post(FROM_HERE, run_loop.QuitClosure());
426 run_loop.Run(); 426 run_loop.Run();
427 ASSERT_TRUE(extension_system->ready().is_signaled()); 427 ASSERT_TRUE(extension_system->ready().is_signaled());
428 } 428 }
429 429
430 // This test starts without any test extensions installed. 430 // This test starts without any test extensions installed.
431 EXPECT_FALSE(GetSingleLoadedExtension()); 431 EXPECT_FALSE(GetSingleLoadedExtension());
432 message_.clear(); 432 message_.clear();
433 433
434 policy::SchemaRegistry* registry = 434 policy::SchemaRegistry* registry =
435 policy::SchemaRegistryServiceFactory::GetForContext(profile); 435 policy::SchemaRegistryServiceFactory::GetForContext(profile)->registry();
436 ASSERT_TRUE(registry); 436 ASSERT_TRUE(registry);
437 EXPECT_FALSE(registry->schema_map()->GetSchema(policy::PolicyNamespace( 437 EXPECT_FALSE(registry->schema_map()->GetSchema(policy::PolicyNamespace(
438 policy::POLICY_DOMAIN_EXTENSIONS, kManagedStorageExtensionId))); 438 policy::POLICY_DOMAIN_EXTENSIONS, kManagedStorageExtensionId)));
439 439
440 MockSchemaRegistryObserver observer; 440 MockSchemaRegistryObserver observer;
441 registry->AddObserver(&observer); 441 registry->AddObserver(&observer);
442 442
443 // Install a managed extension. 443 // Install a managed extension.
444 EXPECT_CALL(observer, OnSchemaRegistryUpdated(true)); 444 EXPECT_CALL(observer, OnSchemaRegistryUpdated(true));
445 const Extension* extension = 445 const Extension* extension =
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 // ENABLE_CONFIGURATION_POLICY is not defined. 572 // ENABLE_CONFIGURATION_POLICY is not defined.
573 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); 573 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile());
574 frontend->DisableStorageForTesting(MANAGED); 574 frontend->DisableStorageForTesting(MANAGED);
575 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); 575 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED));
576 // Now run the extension. 576 // Now run the extension.
577 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) 577 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled"))
578 << message_; 578 << message_;
579 } 579 }
580 580
581 } // namespace extensions 581 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698