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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 new_model->GetWebContentsAt(2)->GetURL()); | 1524 new_model->GetWebContentsAt(2)->GetURL()); |
1525 | 1525 |
1526 EXPECT_TRUE( | 1526 EXPECT_TRUE( |
1527 extensions::TabHelper::FromWebContents( | 1527 extensions::TabHelper::FromWebContents( |
1528 new_model->GetWebContentsAt(0))->extension_app() == extension_app); | 1528 new_model->GetWebContentsAt(0))->extension_app() == extension_app); |
1529 } | 1529 } |
1530 #endif // !defined(OS_CHROMEOS) | 1530 #endif // !defined(OS_CHROMEOS) |
1531 | 1531 |
1532 // This test verifies we don't crash when closing the last window and the app | 1532 // This test verifies we don't crash when closing the last window and the app |
1533 // menu is showing. | 1533 // menu is showing. |
1534 // TODO(linux_aura) http://crbug.com/163931 | 1534 IN_PROC_BROWSER_TEST_F(BrowserTest, CloseWithAppMenuOpen) { |
1535 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) | |
1536 #define MAYBE_CloseWithAppMenuOpen DISABLED_CloseWithAppMenuOpen | |
1537 #else | |
1538 #define MAYBE_CloseWithAppMenuOpen CloseWithAppMenuOpen | |
1539 #endif | |
1540 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_CloseWithAppMenuOpen) { | |
1541 if (browser_defaults::kBrowserAliveWithNoWindows) | 1535 if (browser_defaults::kBrowserAliveWithNoWindows) |
1542 return; | 1536 return; |
1543 | 1537 |
1544 // We need a message loop running for menus on windows. | 1538 // We need a message loop running for menus on windows. |
1545 base::MessageLoop::current()->PostTask( | 1539 base::MessageLoop::current()->PostTask( |
1546 FROM_HERE, base::Bind(&RunCloseWithAppMenuCallback, browser())); | 1540 FROM_HERE, base::Bind(&RunCloseWithAppMenuCallback, browser())); |
1547 } | 1541 } |
1548 | 1542 |
1549 #if !defined(OS_MACOSX) | 1543 #if !defined(OS_MACOSX) |
1550 IN_PROC_BROWSER_TEST_F(BrowserTest, OpenAppWindowLikeNtp) { | 1544 IN_PROC_BROWSER_TEST_F(BrowserTest, OpenAppWindowLikeNtp) { |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2480 #else | 2474 #else |
2481 int modifiers = blink::WebInputEvent::ControlKey; | 2475 int modifiers = blink::WebInputEvent::ControlKey; |
2482 #endif | 2476 #endif |
2483 modifiers |= blink::WebInputEvent::ShiftKey; | 2477 modifiers |= blink::WebInputEvent::ShiftKey; |
2484 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; | 2478 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; |
2485 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2479 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
2486 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | 2480 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); |
2487 } | 2481 } |
2488 | 2482 |
2489 // Middle-clicks open in a background tab. | 2483 // Middle-clicks open in a background tab. |
2490 // TODO(linux_aura) http://crbug.com/163931 | 2484 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenMiddleClickTest) { |
2491 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) | |
2492 #define MAYBE_WindowOpenMiddleClickTest DISABLED_WindowOpenMiddleClickTest | |
2493 #else | |
2494 #define MAYBE_WindowOpenMiddleClickTest WindowOpenMiddleClickTest | |
2495 #endif | |
2496 IN_PROC_BROWSER_TEST_F(ClickModifierTest, MAYBE_WindowOpenMiddleClickTest) { | |
2497 int modifiers = 0; | 2485 int modifiers = 0; |
2498 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | 2486 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; |
2499 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; | 2487 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; |
2500 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | 2488 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); |
2501 } | 2489 } |
2502 | 2490 |
2503 // Shift-middle-clicks open in a foreground tab. | 2491 // Shift-middle-clicks open in a foreground tab. |
2504 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenShiftMiddleClickTest) { | 2492 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenShiftMiddleClickTest) { |
2505 int modifiers = blink::WebInputEvent::ShiftKey; | 2493 int modifiers = blink::WebInputEvent::ShiftKey; |
2506 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | 2494 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2549 #else | 2537 #else |
2550 int modifiers = blink::WebInputEvent::ControlKey; | 2538 int modifiers = blink::WebInputEvent::ControlKey; |
2551 #endif | 2539 #endif |
2552 modifiers |= blink::WebInputEvent::ShiftKey; | 2540 modifiers |= blink::WebInputEvent::ShiftKey; |
2553 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; | 2541 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; |
2554 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2542 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
2555 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2543 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
2556 } | 2544 } |
2557 | 2545 |
2558 // Middle-clicks open in a background tab. | 2546 // Middle-clicks open in a background tab. |
2559 // TODO(linux_aura) http://crbug.com/163931 | 2547 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefMiddleClickTest) { |
2560 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) | |
2561 #define MAYBE_HrefMiddleClickTest DISABLED_HrefMiddleClickTest | |
2562 #else | |
2563 #define MAYBE_HrefMiddleClickTest HrefMiddleClickTest | |
2564 #endif | |
2565 IN_PROC_BROWSER_TEST_F(ClickModifierTest, MAYBE_HrefMiddleClickTest) { | |
2566 int modifiers = 0; | 2548 int modifiers = 0; |
2567 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | 2549 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; |
2568 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; | 2550 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; |
2569 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2551 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
2570 } | 2552 } |
2571 | 2553 |
2572 // Shift-middle-clicks open in a foreground tab. | 2554 // Shift-middle-clicks open in a foreground tab. |
2573 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { | 2555 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { |
2574 int modifiers = blink::WebInputEvent::ShiftKey; | 2556 int modifiers = blink::WebInputEvent::ShiftKey; |
2575 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | 2557 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2701 #endif | 2683 #endif |
2702 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2684 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
2703 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2685 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
2704 gfx::Size exp_final_size(initial_wcv_size); | 2686 gfx::Size exp_final_size(initial_wcv_size); |
2705 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2687 exp_final_size.Enlarge(wcv_resize_insets.width(), |
2706 wcv_resize_insets.height() + height_inset); | 2688 wcv_resize_insets.height() + height_inset); |
2707 EXPECT_EQ(exp_final_size, | 2689 EXPECT_EQ(exp_final_size, |
2708 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2690 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
2709 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); | 2691 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); |
2710 } | 2692 } |
OLD | NEW |