Chromium Code Reviews| Index: chrome/browser/extensions/extension_webui_apitest.cc |
| diff --git a/chrome/browser/extensions/extension_webui_apitest.cc b/chrome/browser/extensions/extension_webui_apitest.cc |
| index dcd40d3c12bc7624ac90edf889e0d5cacbd57b3b..85766ddca277741452ab9f525a5428ec9c2b0e49 100644 |
| --- a/chrome/browser/extensions/extension_webui_apitest.cc |
| +++ b/chrome/browser/extensions/extension_webui_apitest.cc |
| @@ -18,6 +18,8 @@ |
| #include "extensions/browser/event_router.h" |
| #include "extensions/common/api/test.h" |
| #include "extensions/common/extension.h" |
| +#include "extensions/common/feature_switch.h" |
| +#include "extensions/common/switches.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| namespace extensions { |
| @@ -108,6 +110,15 @@ class ExtensionWebUITest : public ExtensionApiTest { |
| base::Bind(&FindFrame, frame_url, &frame_host)); |
| return frame_host; |
| } |
| + |
| + 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. |
| + command_line->AppendSwitch( |
| + extensions::switches::kEnableEmbeddedExtensionOptions); |
| + ExtensionApiTest::SetUpCommandLine(command_line); |
| + } |
| }; |
| IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, SanityCheckAvailableAPIs) { |
| @@ -167,6 +178,26 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, RuntimeLastError) { |
| EXPECT_EQ("true", listener->message()); |
| } |
| +IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, CanEmbedExtensionOptions) { |
| + FeatureSwitch::ScopedOverride enable_options( |
| + FeatureSwitch::embedded_extension_options(), true); |
|
not at google - send to devlin
2014/08/07 23:06:02
might as well do this in a member variable as well
ericzeng
2014/08/08 00:23:46
Done.
|
| + |
| + scoped_ptr<ExtensionTestMessageListener> listener( |
| + new ExtensionTestMessageListener("ready", true)); |
| + |
| + const Extension* extension = InstallExtension( |
| + test_data_dir_.AppendASCII("extension_options").AppendASCII("embed_self"), |
| + 1); |
| + ASSERT_TRUE(extension); |
| + |
| + ASSERT_TRUE(RunTestOnExtensions("can_embed_extension_options.js")); |
| + |
| + ASSERT_TRUE(listener->WaitUntilSatisfied()); |
| + listener->Reply(extension->id()); |
| + listener.reset(new ExtensionTestMessageListener("guest loaded", false)); |
| + ASSERT_TRUE(listener->WaitUntilSatisfied()); |
| +} |
| + |
| } // namespace |
| } // namespace extensions |