OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2627 int modifiers = blink::WebInputEvent::MetaKey; | 2627 int modifiers = blink::WebInputEvent::MetaKey; |
2628 #else | 2628 #else |
2629 int modifiers = blink::WebInputEvent::ControlKey; | 2629 int modifiers = blink::WebInputEvent::ControlKey; |
2630 #endif | 2630 #endif |
2631 modifiers |= blink::WebInputEvent::ShiftKey; | 2631 modifiers |= blink::WebInputEvent::ShiftKey; |
2632 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; | 2632 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; |
2633 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2633 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
2634 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | 2634 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); |
2635 } | 2635 } |
2636 | 2636 |
2637 // Middle-clicks open in a background tab. | |
2638 #if defined(OS_LINUX) | |
2639 // http://crbug.com/396347 | |
dtapuska
2016/04/26 17:11:56
Can you please ensure that crbug gets closed as wo
| |
2640 #define MAYBE_WindowOpenMiddleClickTest DISABLED_WindowOpenMiddleClickTest | |
2641 #else | |
2642 #define MAYBE_WindowOpenMiddleClickTest WindowOpenMiddleClickTest | |
2643 #endif | |
2644 IN_PROC_BROWSER_TEST_F(ClickModifierTest, MAYBE_WindowOpenMiddleClickTest) { | |
2645 int modifiers = 0; | |
2646 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | |
2647 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; | |
2648 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | |
2649 } | |
2650 | |
2651 // Shift-middle-clicks open in a foreground tab. | |
2652 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenShiftMiddleClickTest) { | |
2653 int modifiers = blink::WebInputEvent::ShiftKey; | |
2654 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonMiddle; | |
2655 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | |
2656 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | |
2657 } | |
2658 | |
2659 // Tests for clicking on normal links. | 2637 // Tests for clicking on normal links. |
2660 | 2638 |
2661 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefBasicClickTest) { | 2639 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefBasicClickTest) { |
2662 int modifiers = 0; | 2640 int modifiers = 0; |
2663 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; | 2641 blink::WebMouseEvent::Button button = blink::WebMouseEvent::ButtonLeft; |
2664 WindowOpenDisposition disposition = CURRENT_TAB; | 2642 WindowOpenDisposition disposition = CURRENT_TAB; |
2665 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2643 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
2666 } | 2644 } |
2667 | 2645 |
2668 // TODO(ericu): Alt-click behavior on links is platform-dependent and not well | 2646 // TODO(ericu): Alt-click behavior on links is platform-dependent and not well |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3299 Browser* browser = new Browser(params); | 3277 Browser* browser = new Browser(params); |
3300 gfx::Rect bounds = browser->window()->GetBounds(); | 3278 gfx::Rect bounds = browser->window()->GetBounds(); |
3301 | 3279 |
3302 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 3280 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
3303 // See https://crbug.com/567925. | 3281 // See https://crbug.com/567925. |
3304 EXPECT_GE(bounds.width(), 100); | 3282 EXPECT_GE(bounds.width(), 100); |
3305 EXPECT_EQ(122, bounds.height()); | 3283 EXPECT_EQ(122, bounds.height()); |
3306 browser->window()->Close(); | 3284 browser->window()->Close(); |
3307 } | 3285 } |
3308 } | 3286 } |
OLD | NEW |