Chromium Code Reviews| Index: chrome/browser/guest_view/extension_options/extension_options_apitest.cc |
| diff --git a/chrome/browser/guest_view/extension_options/extension_options_apitest.cc b/chrome/browser/guest_view/extension_options/extension_options_apitest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f89f6ecdbae6257ea7764f6f274d21ad8938f587 |
| --- /dev/null |
| +++ b/chrome/browser/guest_view/extension_options/extension_options_apitest.cc |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/extensions/extension_apitest.h" |
| +#include "extensions/common/feature_switch.h" |
| +#include "extensions/common/switches.h" |
| + |
| +using extensions::Extension; |
| +using extensions::FeatureSwitch; |
| + |
| +class ExtensionOptionsApiTest : public ExtensionApiTest { |
| + private: |
| + virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| + // Need to add a command line flag as well as a FeatureSwitch because the |
| + // FeatureSwitch is not copied over to the renderer process from the |
| + // browser process |
|
Devlin
2014/07/17 20:05:09
.
ericzeng
2014/07/17 23:14:47
Done.
|
| + command_line->AppendSwitch( |
| + extensions::switches::kEnableEmbeddedExtensionOptions); |
| + ExtensionApiTest::SetUpCommandLine(command_line); |
| + } |
| +}; |
| + |
| +IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, EmbedOptionsInExtension) { |
| + FeatureSwitch::ScopedOverride enable_options( |
| + FeatureSwitch::embedded_extension_options(), true); |
| + |
| + const Extension* extension = InstallExtension( |
| + test_data_dir_.AppendASCII("extension_options").AppendASCII("embed_self"), |
| + 1); |
| + ASSERT_TRUE(extension); |
| + ASSERT_TRUE( |
| + 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.
|
| + ASSERT_TRUE(RunExtensionSubtest("extension_options/embed_self", "test.html")); |
| +} |