OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 content::PAGE_TRANSITION_TYPED, false)); | 182 content::PAGE_TRANSITION_TYPED, false)); |
183 | 183 |
184 WaitForTabsAndPopups(browser(), 3, 1, 0); | 184 WaitForTabsAndPopups(browser(), 3, 1, 0); |
185 } | 185 } |
186 | 186 |
187 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowArgumentsOverflow) { | 187 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowArgumentsOverflow) { |
188 ASSERT_TRUE(RunExtensionTest("window_open/argument_overflow")) << message_; | 188 ASSERT_TRUE(RunExtensionTest("window_open/argument_overflow")) << message_; |
189 } | 189 } |
190 | 190 |
191 class WindowOpenPanelDisabledTest : public ExtensionApiTest { | 191 class WindowOpenPanelDisabledTest : public ExtensionApiTest { |
192 virtual void SetUpCommandLine(CommandLine* command_line) { | 192 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
193 ExtensionApiTest::SetUpCommandLine(command_line); | 193 ExtensionApiTest::SetUpCommandLine(command_line); |
194 // TODO(jennb): Re-enable when panels are enabled by default. | 194 // TODO(jennb): Re-enable when panels are enabled by default. |
195 // command_line->AppendSwitch(switches::kDisablePanels); | 195 // command_line->AppendSwitch(switches::kDisablePanels); |
196 } | 196 } |
197 }; | 197 }; |
198 | 198 |
199 IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, | 199 IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, |
200 DISABLED_WindowOpenPanelNotEnabled) { | 200 DISABLED_WindowOpenPanelNotEnabled) { |
201 ASSERT_TRUE(RunExtensionTest("window_open/panel_not_enabled")) << message_; | 201 ASSERT_TRUE(RunExtensionTest("window_open/panel_not_enabled")) << message_; |
202 } | 202 } |
203 | 203 |
204 class WindowOpenPanelTest : public ExtensionApiTest { | 204 class WindowOpenPanelTest : public ExtensionApiTest { |
205 virtual void SetUpCommandLine(CommandLine* command_line) { | 205 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
206 ExtensionApiTest::SetUpCommandLine(command_line); | 206 ExtensionApiTest::SetUpCommandLine(command_line); |
207 command_line->AppendSwitch(switches::kEnablePanels); | 207 command_line->AppendSwitch(switches::kEnablePanels); |
208 } | 208 } |
209 }; | 209 }; |
210 | 210 |
211 // TODO: this ifdef will have to be updated when we have win ash bots running | 211 // TODO: this ifdef will have to be updated when we have win ash bots running |
212 // browser_tests. | 212 // browser_tests. |
213 #if defined(USE_ASH) && !defined(OS_WIN) | 213 #if defined(USE_ASH) && !defined(OS_WIN) |
214 // On Ash, this currently fails because we're currently opening new panel | 214 // On Ash, this currently fails because we're currently opening new panel |
215 // windows as popup windows instead. | 215 // windows as popup windows instead. |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(), | 429 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(), |
430 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + | 430 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + |
431 "/newtab.html"), false, &newtab)); | 431 "/newtab.html"), false, &newtab)); |
432 | 432 |
433 // Extension API should succeed. | 433 // Extension API should succeed. |
434 bool result = false; | 434 bool result = false; |
435 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", | 435 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", |
436 &result)); | 436 &result)); |
437 EXPECT_TRUE(result); | 437 EXPECT_TRUE(result); |
438 } | 438 } |
OLD | NEW |