| 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 "chrome/browser/extensions/api/storage/settings_frontend.h" | 7 #include "chrome/browser/extensions/api/storage/settings_frontend.h" |
| 8 #include "chrome/browser/extensions/api/storage/settings_namespace.h" | 8 #include "chrome/browser/extensions/api/storage/settings_namespace.h" |
| 9 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" | 9 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } // namespace | 85 } // namespace |
| 86 | 86 |
| 87 class ExtensionSettingsApiTest : public ExtensionApiTest { | 87 class ExtensionSettingsApiTest : public ExtensionApiTest { |
| 88 protected: | 88 protected: |
| 89 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 89 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 90 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 90 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 91 | 91 |
| 92 #if defined(ENABLE_CONFIGURATION_POLICY) | 92 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 93 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) | 93 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) |
| 94 .WillRepeatedly(Return(true)); | 94 .WillRepeatedly(Return(true)); |
| 95 EXPECT_CALL(policy_provider_, | 95 EXPECT_CALL(policy_provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); |
| 96 RegisterPolicyDomain(_, _)).Times(AnyNumber()); | |
| 97 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( | 96 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( |
| 98 &policy_provider_); | 97 &policy_provider_); |
| 99 #endif | 98 #endif |
| 100 } | 99 } |
| 101 | 100 |
| 102 void ReplyWhenSatisfied( | 101 void ReplyWhenSatisfied( |
| 103 Namespace settings_namespace, | 102 Namespace settings_namespace, |
| 104 const std::string& normal_action, | 103 const std::string& normal_action, |
| 105 const std::string& incognito_action) { | 104 const std::string& incognito_action) { |
| 106 MaybeLoadAndReplyWhenSatisfied( | 105 MaybeLoadAndReplyWhenSatisfied( |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 SettingsFrontend* frontend = | 516 SettingsFrontend* frontend = |
| 518 browser()->profile()->GetExtensionService()->settings_frontend(); | 517 browser()->profile()->GetExtensionService()->settings_frontend(); |
| 519 frontend->DisableStorageForTesting(MANAGED); | 518 frontend->DisableStorageForTesting(MANAGED); |
| 520 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); | 519 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); |
| 521 // Now run the extension. | 520 // Now run the extension. |
| 522 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) | 521 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) |
| 523 << message_; | 522 << message_; |
| 524 } | 523 } |
| 525 | 524 |
| 526 } // namespace extensions | 525 } // namespace extensions |
| OLD | NEW |