Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/browser/extensions/extension_webui_apitest.cc

Issue 564993002: Embedded Extension Options: remove flags and trunk channel restrictions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
140 scoped_ptr<FeatureSwitch::ScopedOverride> enable_options_; 130 scoped_ptr<FeatureSwitch::ScopedOverride> enable_options_;
141 }; 131 };
142 132
143 IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, SanityCheckAvailableAPIsInFrame) { 133 IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, SanityCheckAvailableAPIsInFrame) {
144 ASSERT_TRUE(RunTestOnExtensionsFrame("sanity_check_available_apis.js")); 134 ASSERT_TRUE(RunTestOnExtensionsFrame("sanity_check_available_apis.js"));
145 } 135 }
146 136
147 IN_PROC_BROWSER_TEST_F(ExtensionWebUITest, 137 IN_PROC_BROWSER_TEST_F(ExtensionWebUITest,
148 SanityCheckAvailableAPIsInChromeFrame) { 138 SanityCheckAvailableAPIsInChromeFrame) {
149 ASSERT_TRUE(RunTestOnChromeExtensionsFrame("sanity_check_available_apis.js")); 139 ASSERT_TRUE(RunTestOnChromeExtensionsFrame("sanity_check_available_apis.js"));
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 227
238 ASSERT_TRUE(listener->WaitUntilSatisfied()); 228 ASSERT_TRUE(listener->WaitUntilSatisfied());
239 listener->Reply(extension->id()); 229 listener->Reply(extension->id());
240 listener.reset(new ExtensionTestMessageListener("onclose received", false)); 230 listener.reset(new ExtensionTestMessageListener("onclose received", false));
241 ASSERT_TRUE(listener->WaitUntilSatisfied()); 231 ASSERT_TRUE(listener->WaitUntilSatisfied());
242 } 232 }
243 233
244 } // namespace 234 } // namespace
245 235
246 } // namespace extensions 236 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/common/extensions/api/_api_features.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698