OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/browser_process.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/prefs/pref_service.h" |
| 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/common/pref_names.h" |
| 10 |
| 11 // Tests enabling and querying managed mode. |
| 12 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ManagedModeGetAndEnable) { |
| 13 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 14 switches::kEnableExperimentalExtensionApis); |
| 15 |
| 16 PrefService* local_state = g_browser_process->local_state(); |
| 17 ASSERT_FALSE(local_state->GetBoolean(prefs::kInManagedMode)); |
| 18 |
| 19 ASSERT_TRUE(RunExtensionTest("managedMode")) << message_; |
| 20 const Extension* extension = GetSingleLoadedExtension(); |
| 21 ASSERT_TRUE(extension); |
| 22 |
| 23 EXPECT_TRUE(local_state->GetBoolean(prefs::kInManagedMode)); |
| 24 } |
OLD | NEW |