| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_test_message_listener.h" | 10 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 if (active_web_contents->GetLastCommittedURL() == frame_url) | 121 if (active_web_contents->GetLastCommittedURL() == frame_url) |
| 122 return active_web_contents->GetMainFrame(); | 122 return active_web_contents->GetMainFrame(); |
| 123 | 123 |
| 124 content::RenderFrameHost* frame_host = NULL; | 124 content::RenderFrameHost* frame_host = NULL; |
| 125 active_web_contents->ForEachFrame( | 125 active_web_contents->ForEachFrame( |
| 126 base::Bind(&FindFrame, frame_url, &frame_host)); | 126 base::Bind(&FindFrame, frame_url, &frame_host)); |
| 127 return frame_host; | 127 return frame_host; |
| 128 } | 128 } |
| 129 | 129 |
| 130 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 131 FeatureSwitch::ScopedOverride enable_options( |
| 132 FeatureSwitch::embedded_extension_options(), true); |
| 133 // Need to add a command line flag as well as a FeatureSwitch because the |
| 134 // FeatureSwitch is not copied over to the renderer process from the |
| 135 // browser process. |
| 136 command_line->AppendSwitch(switches::kEnableEmbeddedExtensionOptions); |
| 137 ExtensionApiTest::SetUpCommandLine(command_line); |
| 138 } |
| 139 |
| 130 scoped_ptr<FeatureSwitch::ScopedOverride> enable_options_; | 140 scoped_ptr<FeatureSwitch::ScopedOverride> enable_options_; |
| 131 }; | 141 }; |
| 132 | 142 |
| 133 IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, SanityCheckAvailableAPIsInFrame) { | 143 IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, SanityCheckAvailableAPIsInFrame) { |
| 134 ASSERT_TRUE(RunTestOnExtensionsFrame("sanity_check_available_apis.js")); | 144 ASSERT_TRUE(RunTestOnExtensionsFrame("sanity_check_available_apis.js")); |
| 135 } | 145 } |
| 136 | 146 |
| 137 IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, | 147 IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, |
| 138 SanityCheckAvailableAPIsInChromeFrame) { | 148 SanityCheckAvailableAPIsInChromeFrame) { |
| 139 ASSERT_TRUE(RunTestOnChromeExtensionsFrame("sanity_check_available_apis.js")); | 149 ASSERT_TRUE(RunTestOnChromeExtensionsFrame("sanity_check_available_apis.js")); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 237 |
| 228 ASSERT_TRUE(listener->WaitUntilSatisfied()); | 238 ASSERT_TRUE(listener->WaitUntilSatisfied()); |
| 229 listener->Reply(extension->id()); | 239 listener->Reply(extension->id()); |
| 230 listener.reset(new ExtensionTestMessageListener("onclose received", false)); | 240 listener.reset(new ExtensionTestMessageListener("onclose received", false)); |
| 231 ASSERT_TRUE(listener->WaitUntilSatisfied()); | 241 ASSERT_TRUE(listener->WaitUntilSatisfied()); |
| 232 } | 242 } |
| 233 | 243 |
| 234 } // namespace | 244 } // namespace |
| 235 | 245 |
| 236 } // namespace extensions | 246 } // namespace extensions |
| OLD | NEW |