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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 browser->tab_strip_model()->GetActiveWebContents(); | 1923 browser->tab_strip_model()->GetActiveWebContents(); |
1924 EXPECT_EQ(url, web_contents->GetURL()); | 1924 EXPECT_EQ(url, web_contents->GetURL()); |
1925 | 1925 |
1926 if (disposition == CURRENT_TAB) { | 1926 if (disposition == CURRENT_TAB) { |
1927 content::WebContents* web_contents = | 1927 content::WebContents* web_contents = |
1928 browser->tab_strip_model()->GetActiveWebContents(); | 1928 browser->tab_strip_model()->GetActiveWebContents(); |
1929 NavigationController* controller = | 1929 NavigationController* controller = |
1930 web_contents ? &web_contents->GetController() : NULL; | 1930 web_contents ? &web_contents->GetController() : NULL; |
1931 content::TestNavigationObserver same_tab_observer( | 1931 content::TestNavigationObserver same_tab_observer( |
1932 content::Source<NavigationController>(controller), | 1932 content::Source<NavigationController>(controller), |
1933 NULL, | |
1934 1); | 1933 1); |
1935 SimulateMouseClick(web_contents, modifiers, button); | 1934 SimulateMouseClick(web_contents, modifiers, button); |
1936 base::RunLoop run_loop; | 1935 base::RunLoop run_loop; |
1937 same_tab_observer.WaitForObservation( | 1936 same_tab_observer.WaitForObservation( |
1938 base::Bind(&content::RunThisRunLoop, base::Unretained(&run_loop)), | 1937 base::Bind(&content::RunThisRunLoop, base::Unretained(&run_loop)), |
1939 content::GetQuitTaskForRunLoop(&run_loop)); | 1938 content::GetQuitTaskForRunLoop(&run_loop)); |
1940 EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile(), | 1939 EXPECT_EQ(1u, chrome::GetBrowserCount(browser->profile(), |
1941 browser->host_desktop_type())); | 1940 browser->host_desktop_type())); |
1942 EXPECT_EQ(1, browser->tab_strip_model()->count()); | 1941 EXPECT_EQ(1, browser->tab_strip_model()->count()); |
1943 EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle()); | 1942 EXPECT_EQ(getSecondPageTitle(), web_contents->GetTitle()); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2103 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2102 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
2104 } | 2103 } |
2105 | 2104 |
2106 // Shift-middle-clicks open in a foreground tab. | 2105 // Shift-middle-clicks open in a foreground tab. |
2107 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { | 2106 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { |
2108 int modifiers = WebKit::WebInputEvent::ShiftKey; | 2107 int modifiers = WebKit::WebInputEvent::ShiftKey; |
2109 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; | 2108 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; |
2110 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2109 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
2111 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2110 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
2112 } | 2111 } |
OLD | NEW |