Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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/extensions/extension_apitest.h" | |
| 6 #include "extensions/common/feature_switch.h" | |
| 7 #include "extensions/common/switches.h" | |
| 8 | |
| 9 using extensions::Extension; | |
| 10 using extensions::FeatureSwitch; | |
| 11 | |
| 12 class ExtensionOptionsApiTest : public ExtensionApiTest { | |
| 13 private: | |
| 14 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
| 15 // Need to add a command line flag as well as a FeatureSwitch because the | |
| 16 // FeatureSwitch is not copied over to the renderer process from the | |
| 17 // browser process | |
|
Devlin
2014/07/17 20:05:09
.
ericzeng
2014/07/17 23:14:47
Done.
| |
| 18 command_line->AppendSwitch( | |
| 19 extensions::switches::kEnableEmbeddedExtensionOptions); | |
| 20 ExtensionApiTest::SetUpCommandLine(command_line); | |
| 21 } | |
| 22 }; | |
| 23 | |
| 24 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, EmbedOptionsInExtension) { | |
| 25 FeatureSwitch::ScopedOverride enable_options( | |
| 26 FeatureSwitch::embedded_extension_options(), true); | |
| 27 | |
| 28 const Extension* extension = InstallExtension( | |
| 29 test_data_dir_.AppendASCII("extension_options").AppendASCII("embed_self"), | |
| 30 1); | |
| 31 ASSERT_TRUE(extension); | |
| 32 ASSERT_TRUE( | |
| 33 extensions::FeatureSwitch::embedded_extension_options()->IsEnabled()); | |
|
Devlin
2014/07/17 20:05:09
nit: don't need extensions:: prefix.
ericzeng
2014/07/17 23:14:46
Done.
| |
| 34 ASSERT_TRUE(RunExtensionSubtest("extension_options/embed_self", "test.html")); | |
| 35 } | |
| OLD | NEW |