| 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 "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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 virtual ~MockSchemaRegistryObserver() {} | 67 virtual ~MockSchemaRegistryObserver() {} |
| 68 | 68 |
| 69 MOCK_METHOD1(OnSchemaRegistryUpdated, void(bool)); | 69 MOCK_METHOD1(OnSchemaRegistryUpdated, void(bool)); |
| 70 MOCK_METHOD0(OnSchemaRegistryReady, void()); | 70 MOCK_METHOD0(OnSchemaRegistryReady, void()); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 class ExtensionSettingsApiTest : public ExtensionApiTest { | 75 class ExtensionSettingsApiTest : public ExtensionApiTest { |
| 76 protected: | 76 protected: |
| 77 virtual void SetUpInProcessBrowserTestFixture() override { | 77 void SetUpInProcessBrowserTestFixture() override { |
| 78 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 78 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 79 | 79 |
| 80 #if defined(ENABLE_CONFIGURATION_POLICY) | 80 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 81 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) | 81 EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) |
| 82 .WillRepeatedly(Return(true)); | 82 .WillRepeatedly(Return(true)); |
| 83 policy_provider_.SetAutoRefresh(); | 83 policy_provider_.SetAutoRefresh(); |
| 84 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( | 84 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( |
| 85 &policy_provider_); | 85 &policy_provider_); |
| 86 #endif | 86 #endif |
| 87 } | 87 } |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 // ENABLE_CONFIGURATION_POLICY is not defined. | 573 // ENABLE_CONFIGURATION_POLICY is not defined. |
| 574 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); | 574 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); |
| 575 frontend->DisableStorageForTesting(MANAGED); | 575 frontend->DisableStorageForTesting(MANAGED); |
| 576 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); | 576 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); |
| 577 // Now run the extension. | 577 // Now run the extension. |
| 578 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) | 578 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) |
| 579 << message_; | 579 << message_; |
| 580 } | 580 } |
| 581 | 581 |
| 582 } // namespace extensions | 582 } // namespace extensions |
| OLD | NEW |