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 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2555 // Shift-middle-clicks open in a foreground tab. | 2555 // Shift-middle-clicks open in a foreground tab. |
2556 // http://crbug.com/396347 | 2556 // http://crbug.com/396347 |
2557 IN_PROC_BROWSER_TEST_F(ClickModifierTest, DISABLED_HrefShiftMiddleClickTest) { | 2557 IN_PROC_BROWSER_TEST_F(ClickModifierTest, DISABLED_HrefShiftMiddleClickTest) { |
2558 int modifiers = blink::WebInputEvent::ShiftKey; | 2558 int modifiers = blink::WebInputEvent::ShiftKey; |
2559 blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Middle; | 2559 blink::WebMouseEvent::Button button = blink::WebMouseEvent::Button::Middle; |
2560 WindowOpenDisposition disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; | 2560 WindowOpenDisposition disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; |
2561 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2561 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
2562 } | 2562 } |
2563 | 2563 |
2564 IN_PROC_BROWSER_TEST_F(BrowserTest, GetSizeForNewRenderView) { | 2564 IN_PROC_BROWSER_TEST_F(BrowserTest, GetSizeForNewRenderView) { |
2565 // Force an initial resize. This works around a test-only problem on Chrome OS | |
2566 // where the shelf may not be created before the initial test browser window | |
2567 // opens, which leads to sizing issues in WebContents resize. | |
2568 browser()->window()->SetBounds(gfx::Rect(10, 20, 600, 400)); | |
2569 // Let the message loop run so that resize actually takes effect. | |
2570 content::RunAllPendingInMessageLoop(); | |
2571 | |
2572 // The instant extended NTP has javascript that does not work with | 2565 // The instant extended NTP has javascript that does not work with |
2573 // ui_test_utils::NavigateToURL. The NTP rvh reloads when the browser tries | 2566 // ui_test_utils::NavigateToURL. The NTP rvh reloads when the browser tries |
2574 // to navigate away from the page, which causes the WebContents to end up in | 2567 // to navigate away from the page, which causes the WebContents to end up in |
2575 // an inconsistent state. (is_loaded = true, last_commited_url=ntp, | 2568 // an inconsistent state. (is_loaded = true, last_commited_url=ntp, |
2576 // visible_url=title1.html) | 2569 // visible_url=title1.html) |
2577 browser()->profile()->GetPrefs()->SetBoolean(prefs::kWebKitJavascriptEnabled, | 2570 browser()->profile()->GetPrefs()->SetBoolean(prefs::kWebKitJavascriptEnabled, |
2578 false); | 2571 false); |
2579 ASSERT_TRUE(embedded_test_server()->Start()); | 2572 ASSERT_TRUE(embedded_test_server()->Start()); |
2580 // Create an HTTPS server for cross-site transition. | 2573 // Create an HTTPS server for cross-site transition. |
2581 net::EmbeddedTestServer https_test_server( | 2574 net::EmbeddedTestServer https_test_server( |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2685 | 2678 |
2686 #if defined(OS_MACOSX) | 2679 #if defined(OS_MACOSX) |
2687 exp_commit_size.Enlarge(wcv_resize_insets.width(), | 2680 exp_commit_size.Enlarge(wcv_resize_insets.width(), |
2688 wcv_resize_insets.height()); | 2681 wcv_resize_insets.height()); |
2689 #else | 2682 #else |
2690 exp_commit_size.Enlarge(wcv_resize_insets.width(), | 2683 exp_commit_size.Enlarge(wcv_resize_insets.width(), |
2691 wcv_resize_insets.height() + height_inset); | 2684 wcv_resize_insets.height() + height_inset); |
2692 #endif | 2685 #endif |
2693 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2686 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
2694 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2687 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
2695 | |
2696 gfx::Size exp_final_size(initial_wcv_size); | 2688 gfx::Size exp_final_size(initial_wcv_size); |
2697 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2689 exp_final_size.Enlarge(wcv_resize_insets.width(), |
2698 wcv_resize_insets.height() + height_inset); | 2690 wcv_resize_insets.height() + height_inset); |
2699 EXPECT_EQ(exp_final_size, | 2691 EXPECT_EQ(exp_final_size, |
2700 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2692 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
2701 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); | 2693 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); |
2702 } | 2694 } |
2703 | 2695 |
2704 IN_PROC_BROWSER_TEST_F(BrowserTest, CanDuplicateTab) { | 2696 IN_PROC_BROWSER_TEST_F(BrowserTest, CanDuplicateTab) { |
2705 GURL url(ui_test_utils::GetTestUrl( | 2697 GURL url(ui_test_utils::GetTestUrl( |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2889 Browser* browser = new Browser(params); | 2881 Browser* browser = new Browser(params); |
2890 gfx::Rect bounds = browser->window()->GetBounds(); | 2882 gfx::Rect bounds = browser->window()->GetBounds(); |
2891 | 2883 |
2892 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 2884 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
2893 // See https://crbug.com/567925. | 2885 // See https://crbug.com/567925. |
2894 EXPECT_GE(bounds.width(), 100); | 2886 EXPECT_GE(bounds.width(), 100); |
2895 EXPECT_EQ(122, bounds.height()); | 2887 EXPECT_EQ(122, bounds.height()); |
2896 browser->window()->Close(); | 2888 browser->window()->Close(); |
2897 } | 2889 } |
2898 } | 2890 } |
OLD | NEW |