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 "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 "chrome/browser/extensions/api/storage/settings_frontend.h" | 9 #include "chrome/browser/extensions/api/storage/settings_frontend.h" |
10 #include "chrome/browser/extensions/api/storage/settings_namespace.h" | 10 #include "chrome/browser/extensions/api/storage/settings_namespace.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 extension_system->ready().Post(FROM_HERE, run_loop.QuitClosure()); | 447 extension_system->ready().Post(FROM_HERE, run_loop.QuitClosure()); |
448 run_loop.Run(); | 448 run_loop.Run(); |
449 ASSERT_TRUE(extension_system->ready().is_signaled()); | 449 ASSERT_TRUE(extension_system->ready().is_signaled()); |
450 } | 450 } |
451 | 451 |
452 policy::ProfilePolicyConnector* connector = | 452 policy::ProfilePolicyConnector* connector = |
453 policy::ProfilePolicyConnectorFactory::GetForProfile(profile); | 453 policy::ProfilePolicyConnectorFactory::GetForProfile(profile); |
454 policy::PolicyService* service = connector->policy_service(); | 454 policy::PolicyService* service = connector->policy_service(); |
455 scoped_refptr<const policy::PolicyDomainDescriptor> descriptor = | 455 scoped_refptr<const policy::PolicyDomainDescriptor> descriptor = |
456 service->GetPolicyDomainDescriptor(policy::POLICY_DOMAIN_EXTENSIONS); | 456 service->GetPolicyDomainDescriptor(policy::POLICY_DOMAIN_EXTENSIONS); |
457 EXPECT_TRUE(descriptor); | 457 EXPECT_TRUE(descriptor.get()); |
458 } | 458 } |
459 | 459 |
460 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, ManagedStorage) { | 460 IN_PROC_BROWSER_TEST_F(ExtensionSettingsApiTest, ManagedStorage) { |
461 // Set policies for the test extension. | 461 // Set policies for the test extension. |
462 scoped_ptr<base::DictionaryValue> policy = extensions::DictionaryBuilder() | 462 scoped_ptr<base::DictionaryValue> policy = extensions::DictionaryBuilder() |
463 .Set("string-policy", "value") | 463 .Set("string-policy", "value") |
464 .Set("int-policy", -123) | 464 .Set("int-policy", -123) |
465 .Set("double-policy", 456e7) | 465 .Set("double-policy", 456e7) |
466 .SetBoolean("boolean-policy", true) | 466 .SetBoolean("boolean-policy", true) |
467 .Set("list-policy", extensions::ListBuilder() | 467 .Set("list-policy", extensions::ListBuilder() |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 SettingsFrontend* frontend = | 547 SettingsFrontend* frontend = |
548 browser()->profile()->GetExtensionService()->settings_frontend(); | 548 browser()->profile()->GetExtensionService()->settings_frontend(); |
549 frontend->DisableStorageForTesting(MANAGED); | 549 frontend->DisableStorageForTesting(MANAGED); |
550 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); | 550 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); |
551 // Now run the extension. | 551 // Now run the extension. |
552 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) | 552 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) |
553 << message_; | 553 << message_; |
554 } | 554 } |
555 | 555 |
556 } // namespace extensions | 556 } // namespace extensions |
OLD | NEW |