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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "base/values.h" | 11 #include "base/values.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_system_factory.h" | 14 #include "chrome/browser/extensions/extension_system_factory.h" |
15 #include "chrome/browser/policy/schema_registry_service.h" | 15 #include "chrome/browser/policy/schema_registry_service.h" |
16 #include "chrome/browser/policy/schema_registry_service_factory.h" | 16 #include "chrome/browser/policy/schema_registry_service_factory.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "components/policy/core/browser/browser_policy_connector.h" | 19 #include "components/policy/core/browser/browser_policy_connector.h" |
20 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 20 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
21 #include "components/policy/core/common/policy_bundle.h" | 21 #include "components/policy/core/common/policy_bundle.h" |
22 #include "components/policy/core/common/policy_map.h" | 22 #include "components/policy/core/common/policy_map.h" |
23 #include "components/policy/core/common/policy_namespace.h" | 23 #include "components/policy/core/common/policy_namespace.h" |
24 #include "components/policy/core/common/policy_types.h" | 24 #include "components/policy/core/common/policy_types.h" |
25 #include "components/policy/core/common/schema.h" | 25 #include "components/policy/core/common/schema.h" |
26 #include "components/policy/core/common/schema_map.h" | 26 #include "components/policy/core/common/schema_map.h" |
27 #include "components/policy/core/common/schema_registry.h" | 27 #include "components/policy/core/common/schema_registry.h" |
| 28 #include "components/sync/api/fake_sync_change_processor.h" |
| 29 #include "components/sync/api/sync_change.h" |
| 30 #include "components/sync/api/sync_change_processor.h" |
| 31 #include "components/sync/api/sync_change_processor_wrapper_for_test.h" |
| 32 #include "components/sync/api/sync_error_factory.h" |
| 33 #include "components/sync/api/sync_error_factory_mock.h" |
| 34 #include "components/sync/api/syncable_service.h" |
28 #include "extensions/browser/api/storage/settings_namespace.h" | 35 #include "extensions/browser/api/storage/settings_namespace.h" |
29 #include "extensions/browser/api/storage/storage_frontend.h" | 36 #include "extensions/browser/api/storage/storage_frontend.h" |
30 #include "extensions/browser/extension_system.h" | 37 #include "extensions/browser/extension_system.h" |
31 #include "extensions/common/value_builder.h" | 38 #include "extensions/common/value_builder.h" |
32 #include "extensions/test/extension_test_message_listener.h" | 39 #include "extensions/test/extension_test_message_listener.h" |
33 #include "extensions/test/result_catcher.h" | 40 #include "extensions/test/result_catcher.h" |
34 #include "sync/api/fake_sync_change_processor.h" | |
35 #include "sync/api/sync_change.h" | |
36 #include "sync/api/sync_change_processor.h" | |
37 #include "sync/api/sync_change_processor_wrapper_for_test.h" | |
38 #include "sync/api/sync_error_factory.h" | |
39 #include "sync/api/sync_error_factory_mock.h" | |
40 #include "sync/api/syncable_service.h" | |
41 #include "testing/gmock/include/gmock/gmock.h" | 41 #include "testing/gmock/include/gmock/gmock.h" |
42 | 42 |
43 namespace extensions { | 43 namespace extensions { |
44 | 44 |
45 using settings_namespace::LOCAL; | 45 using settings_namespace::LOCAL; |
46 using settings_namespace::MANAGED; | 46 using settings_namespace::MANAGED; |
47 using settings_namespace::Namespace; | 47 using settings_namespace::Namespace; |
48 using settings_namespace::SYNC; | 48 using settings_namespace::SYNC; |
49 using settings_namespace::ToString; | 49 using settings_namespace::ToString; |
50 using testing::Mock; | 50 using testing::Mock; |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 // Disable the 'managed' namespace. | 564 // Disable the 'managed' namespace. |
565 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); | 565 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); |
566 frontend->DisableStorageForTesting(MANAGED); | 566 frontend->DisableStorageForTesting(MANAGED); |
567 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); | 567 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); |
568 // Now run the extension. | 568 // Now run the extension. |
569 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) | 569 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) |
570 << message_; | 570 << message_; |
571 } | 571 } |
572 | 572 |
573 } // namespace extensions | 573 } // namespace extensions |
OLD | NEW |