| 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 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 #else | 2498 #else |
| 2499 int modifiers = blink::WebInputEvent::ControlKey; | 2499 int modifiers = blink::WebInputEvent::ControlKey; |
| 2500 #endif | 2500 #endif |
| 2501 modifiers |= blink::WebInputEvent::ShiftKey; | 2501 modifiers |= blink::WebInputEvent::ShiftKey; |
| 2502 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; | 2502 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; |
| 2503 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2503 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
| 2504 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | 2504 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); |
| 2505 } | 2505 } |
| 2506 | 2506 |
| 2507 // Middle-clicks open in a background tab. | 2507 // Middle-clicks open in a background tab. |
| 2508 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenMiddleClickTest) { | 2508 #if defined(OS_LINUX) |
| 2509 // http://crbug.com/396347 |
| 2510 #define MAYBE_WindowOpenMiddleClickTest DISABLED_WindowOpenMiddleClickTest |
| 2511 #else |
| 2512 #define MAYBE_WindowOpenMiddleClickTest WindowOpenMiddleClickTest |
| 2513 #endif |
| 2514 IN_PROC_BROWSER_TEST_F(ClickModifierTest, MAYBE_WindowOpenMiddleClickTest) { |
| 2509 int modifiers = 0; | 2515 int modifiers = 0; |
| 2510 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | 2516 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; |
| 2511 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; | 2517 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; |
| 2512 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | 2518 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); |
| 2513 } | 2519 } |
| 2514 | 2520 |
| 2515 // Shift-middle-clicks open in a foreground tab. | 2521 // Shift-middle-clicks open in a foreground tab. |
| 2516 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenShiftMiddleClickTest) { | 2522 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenShiftMiddleClickTest) { |
| 2517 int modifiers = blink::WebInputEvent::ShiftKey; | 2523 int modifiers = blink::WebInputEvent::ShiftKey; |
| 2518 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | 2524 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2548 #else | 2554 #else |
| 2549 int modifiers = blink::WebInputEvent::ControlKey; | 2555 int modifiers = blink::WebInputEvent::ControlKey; |
| 2550 #endif | 2556 #endif |
| 2551 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; | 2557 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; |
| 2552 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; | 2558 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; |
| 2553 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2559 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2554 } | 2560 } |
| 2555 | 2561 |
| 2556 // Control-shift-clicks open in a foreground tab. | 2562 // Control-shift-clicks open in a foreground tab. |
| 2557 // On OSX meta [the command key] takes the place of control. | 2563 // On OSX meta [the command key] takes the place of control. |
| 2558 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefControlShiftClickTest) { | 2564 // http://crbug.com/396347 |
| 2565 IN_PROC_BROWSER_TEST_F(ClickModifierTest, DISABLED_HrefControlShiftClickTest) { |
| 2559 #if defined(OS_MACOSX) | 2566 #if defined(OS_MACOSX) |
| 2560 int modifiers = blink::WebInputEvent::MetaKey; | 2567 int modifiers = blink::WebInputEvent::MetaKey; |
| 2561 #else | 2568 #else |
| 2562 int modifiers = blink::WebInputEvent::ControlKey; | 2569 int modifiers = blink::WebInputEvent::ControlKey; |
| 2563 #endif | 2570 #endif |
| 2564 modifiers |= blink::WebInputEvent::ShiftKey; | 2571 modifiers |= blink::WebInputEvent::ShiftKey; |
| 2565 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; | 2572 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; |
| 2566 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2573 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
| 2567 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2574 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2568 } | 2575 } |
| 2569 | 2576 |
| 2570 // Middle-clicks open in a background tab. | 2577 // Middle-clicks open in a background tab. |
| 2571 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefMiddleClickTest) { | 2578 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefMiddleClickTest) { |
| 2572 int modifiers = 0; | 2579 int modifiers = 0; |
| 2573 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | 2580 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; |
| 2574 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; | 2581 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; |
| 2575 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2582 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2576 } | 2583 } |
| 2577 | 2584 |
| 2578 // Shift-middle-clicks open in a foreground tab. | 2585 // Shift-middle-clicks open in a foreground tab. |
| 2579 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { | 2586 // http://crbug.com/396347 |
| 2587 IN_PROC_BROWSER_TEST_F(ClickModifierTest, DISABLED_HrefShiftMiddleClickTest) { |
| 2580 int modifiers = blink::WebInputEvent::ShiftKey; | 2588 int modifiers = blink::WebInputEvent::ShiftKey; |
| 2581 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | 2589 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; |
| 2582 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2590 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
| 2583 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2591 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2584 } | 2592 } |
| 2585 | 2593 |
| 2586 IN_PROC_BROWSER_TEST_F(BrowserTest, GetSizeForNewRenderView) { | 2594 IN_PROC_BROWSER_TEST_F(BrowserTest, GetSizeForNewRenderView) { |
| 2587 // The instant extended NTP has javascript that does not work with | 2595 // The instant extended NTP has javascript that does not work with |
| 2588 // ui_test_utils::NavigateToURL. The NTP rvh reloads when the browser tries | 2596 // ui_test_utils::NavigateToURL. The NTP rvh reloads when the browser tries |
| 2589 // to navigate away from the page, which causes the WebContents to end up in | 2597 // to navigate away from the page, which causes the WebContents to end up in |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2707 #endif | 2715 #endif |
| 2708 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2716 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
| 2709 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2717 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
| 2710 gfx::Size exp_final_size(initial_wcv_size); | 2718 gfx::Size exp_final_size(initial_wcv_size); |
| 2711 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2719 exp_final_size.Enlarge(wcv_resize_insets.width(), |
| 2712 wcv_resize_insets.height() + height_inset); | 2720 wcv_resize_insets.height() + height_inset); |
| 2713 EXPECT_EQ(exp_final_size, | 2721 EXPECT_EQ(exp_final_size, |
| 2714 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2722 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
| 2715 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); | 2723 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); |
| 2716 } | 2724 } |
| OLD | NEW |