| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 EXPECT_TRUE(WaitForTabsAndPopups(browser(), 3, 1, 0)); | 224 EXPECT_TRUE(WaitForTabsAndPopups(browser(), 3, 1, 0)); |
| 225 } | 225 } |
| 226 | 226 |
| 227 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowArgumentsOverflow) { | 227 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowArgumentsOverflow) { |
| 228 ASSERT_TRUE(RunExtensionTest("window_open/argument_overflow")) << message_; | 228 ASSERT_TRUE(RunExtensionTest("window_open/argument_overflow")) << message_; |
| 229 } | 229 } |
| 230 | 230 |
| 231 class WindowOpenPanelDisabledTest : public ExtensionApiTest { | 231 class WindowOpenPanelDisabledTest : public ExtensionApiTest { |
| 232 void SetUpCommandLine(base::CommandLine* command_line) override { | 232 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 233 ExtensionApiTest::SetUpCommandLine(command_line); | 233 ExtensionApiTest::SetUpCommandLine(command_line); |
| 234 // TODO(jennb): Re-enable when panels are enabled by default. | 234 command_line->AppendSwitch(switches::kDisablePanels); |
| 235 // command_line->AppendSwitch(switches::kDisablePanels); | |
| 236 } | 235 } |
| 237 }; | 236 }; |
| 238 | 237 |
| 239 IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, | 238 IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, WindowOpenPanelNotEnabled) { |
| 240 DISABLED_WindowOpenPanelNotEnabled) { | |
| 241 ASSERT_TRUE(RunExtensionTest("window_open/panel_not_enabled")) << message_; | 239 ASSERT_TRUE(RunExtensionTest("window_open/panel_not_enabled")) << message_; |
| 242 } | 240 } |
| 243 | 241 |
| 244 class WindowOpenPanelTest : public ExtensionApiTest { | 242 class WindowOpenPanelTest : public ExtensionApiTest { |
| 245 void SetUpCommandLine(base::CommandLine* command_line) override { | 243 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 246 ExtensionApiTest::SetUpCommandLine(command_line); | 244 ExtensionApiTest::SetUpCommandLine(command_line); |
| 247 command_line->AppendSwitch(switches::kEnablePanels); | 245 command_line->AppendSwitch(switches::kEnablePanels); |
| 248 } | 246 } |
| 249 }; | 247 }; |
| 250 | 248 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 274 // | | | <--------------/ | | | 272 // | | | <--------------/ | | |
| 275 // | +---------------------+ | | +-------------------------------+ | | 273 // | +---------------------+ | | +-------------------------------+ | |
| 276 // | | | | | 274 // | | | | |
| 277 // +-----------------------------+ +-----------------------------------+ | 275 // +-----------------------------+ +-----------------------------------+ |
| 278 // | 276 // |
| 279 // See also crbug.com/568357 for more info / context. | 277 // See also crbug.com/568357 for more info / context. |
| 280 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, BrowsingInstanceTest) { | 278 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, BrowsingInstanceTest) { |
| 281 host_resolver()->AddRule("*", "127.0.0.1"); | 279 host_resolver()->AddRule("*", "127.0.0.1"); |
| 282 ASSERT_TRUE(StartEmbeddedTestServer()); | 280 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 283 | 281 |
| 284 ASSERT_TRUE(RunExtensionTest("window_open/panel_browsing_instance")) | 282 ASSERT_TRUE( |
| 283 RunExtensionTestWithArg("window_open/panel_browsing_instance", "panel")) |
| 285 << message_; | 284 << message_; |
| 286 } | 285 } |
| 287 | 286 |
| 287 // Similar to the previous test, but for when panels are disabled. |
| 288 IN_PROC_BROWSER_TEST_F(WindowOpenPanelDisabledTest, BrowsingInstanceTest) { |
| 289 host_resolver()->AddRule("*", "127.0.0.1"); |
| 290 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 291 |
| 292 ASSERT_TRUE( |
| 293 RunExtensionTestWithArg("window_open/panel_browsing_instance", "popup")) |
| 294 << message_; |
| 295 } |
| 296 |
| 288 #if defined(USE_ASH_PANELS) || defined(OS_LINUX) | 297 #if defined(USE_ASH_PANELS) || defined(OS_LINUX) |
| 289 // On Ash, this currently fails because we're currently opening new panel | 298 // On Ash, this currently fails because we're currently opening new panel |
| 290 // windows as popup windows instead. | 299 // windows as popup windows instead. |
| 291 // We're also failing on Linux-aura due to the panel is not opened in the | 300 // We're also failing on Linux-aura due to the panel is not opened in the |
| 292 // right origin. | 301 // right origin. |
| 293 #define MAYBE_WindowOpenPanelDetached DISABLED_WindowOpenPanelDetached | 302 #define MAYBE_WindowOpenPanelDetached DISABLED_WindowOpenPanelDetached |
| 294 #else | 303 #else |
| 295 #define MAYBE_WindowOpenPanelDetached WindowOpenPanelDetached | 304 #define MAYBE_WindowOpenPanelDetached WindowOpenPanelDetached |
| 296 #endif | 305 #endif |
| 297 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanelDetached) { | 306 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanelDetached) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 last_loaded_extension_id() + "/newtab.html"), | 538 last_loaded_extension_id() + "/newtab.html"), |
| 530 false, | 539 false, |
| 531 &newtab)); | 540 &newtab)); |
| 532 | 541 |
| 533 // Extension API should succeed. | 542 // Extension API should succeed. |
| 534 bool result = false; | 543 bool result = false; |
| 535 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", | 544 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", |
| 536 &result)); | 545 &result)); |
| 537 EXPECT_TRUE(result); | 546 EXPECT_TRUE(result); |
| 538 } | 547 } |
| OLD | NEW |