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

Side by Side Diff: chrome/browser/extensions/settings/settings_apitest.cc

Issue 10829142: Disable the managed storage API behind a flag for M22. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 4 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
« no previous file with comments | « chrome/browser/extensions/settings/settings_api.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h"
6 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 8 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
10 #include "chrome/browser/extensions/settings/settings_frontend.h" 11 #include "chrome/browser/extensions/settings/settings_frontend.h"
11 #include "chrome/browser/extensions/settings/settings_namespace.h" 12 #include "chrome/browser/extensions/settings/settings_namespace.h"
12 #include "chrome/browser/extensions/settings/settings_sync_util.h" 13 #include "chrome/browser/extensions/settings/settings_sync_util.h"
13 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
16 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/extensions/value_builder.h" 17 #include "chrome/common/extensions/value_builder.h"
16 #include "chrome/test/base/ui_test_utils.h" 18 #include "chrome/test/base/ui_test_utils.h"
17 #include "sync/api/sync_change.h" 19 #include "sync/api/sync_change.h"
18 #include "sync/api/sync_change_processor.h" 20 #include "sync/api/sync_change_processor.h"
19 #include "sync/api/sync_error_factory.h" 21 #include "sync/api/sync_error_factory.h"
20 #include "sync/api/sync_error_factory_mock.h" 22 #include "sync/api/sync_error_factory_mock.h"
21 #include "testing/gmock/include/gmock/gmock.h" 23 #include "testing/gmock/include/gmock/gmock.h"
22 24
23 #if defined(ENABLE_CONFIGURATION_POLICY) 25 #if defined(ENABLE_CONFIGURATION_POLICY)
24 #include "chrome/browser/policy/browser_policy_connector.h" 26 #include "chrome/browser/policy/browser_policy_connector.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 81
80 DISALLOW_COPY_AND_ASSIGN(SyncChangeProcessorDelegate); 82 DISALLOW_COPY_AND_ASSIGN(SyncChangeProcessorDelegate);
81 }; 83 };
82 84
83 } // namespace 85 } // namespace
84 86
85 class ExtensionSettingsApiTest : public ExtensionApiTest { 87 class ExtensionSettingsApiTest : public ExtensionApiTest {
86 protected: 88 protected:
87 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 89 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
88 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); 90 ExtensionApiTest::SetUpInProcessBrowserTestFixture();
91 CommandLine::ForCurrentProcess()->AppendSwitch(
92 switches::kEnableManagedStorage);
93
89 #if defined(ENABLE_CONFIGURATION_POLICY) 94 #if defined(ENABLE_CONFIGURATION_POLICY)
90 EXPECT_CALL(policy_provider_, IsInitializationComplete()) 95 EXPECT_CALL(policy_provider_, IsInitializationComplete())
91 .WillRepeatedly(Return(true)); 96 .WillRepeatedly(Return(true));
92 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( 97 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(
93 &policy_provider_); 98 &policy_provider_);
94 #endif 99 #endif
95 } 100 }
96 101
97 void ReplyWhenSatisfied( 102 void ReplyWhenSatisfied(
98 Namespace settings_namespace, 103 Namespace settings_namespace,
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 SettingsFrontend* frontend = 486 SettingsFrontend* frontend =
482 browser()->profile()->GetExtensionService()->settings_frontend(); 487 browser()->profile()->GetExtensionService()->settings_frontend();
483 frontend->DisableStorageForTesting(MANAGED); 488 frontend->DisableStorageForTesting(MANAGED);
484 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); 489 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED));
485 // Now run the extension. 490 // Now run the extension.
486 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) 491 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled"))
487 << message_; 492 << message_;
488 } 493 }
489 494
490 } // namespace extensions 495 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/settings/settings_api.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698