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 <vector> | 5 #include <vector> |
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/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 ConsiderRedirectAfterGestureAsUserInitiated) { | 243 ConsiderRedirectAfterGestureAsUserInitiated) { |
244 // Test the history length for the following page transition. | 244 // Test the history length for the following page transition. |
245 // | 245 // |
246 // -open-> Page 11 -slow_redirect-> Page 12. | 246 // -open-> Page 11 -slow_redirect-> Page 12. |
247 // | 247 // |
248 // If redirect occurs after a user gesture, e.g., mouse click, the | 248 // If redirect occurs after a user gesture, e.g., mouse click, the |
249 // redirect is more likely to be user-initiated rather than automatic. | 249 // redirect is more likely to be user-initiated rather than automatic. |
250 // Therefore, Page 11 should be in the history in addition to Page 12. | 250 // Therefore, Page 11 should be in the history in addition to Page 12. |
251 LoadAndWaitForFile("history_length_test_page_11.html"); | 251 LoadAndWaitForFile("history_length_test_page_11.html"); |
252 | 252 |
253 content::SimulateMouseClick(chrome::GetActiveWebContents(browser())); | 253 content::SimulateMouseClick(chrome::GetActiveWebContents(browser()), 0, |
| 254 WebKit::WebMouseEvent::ButtonLeft); |
254 LoadAndWaitForFile("history_length_test_page_11.html"); | 255 LoadAndWaitForFile("history_length_test_page_11.html"); |
255 } | 256 } |
256 | 257 |
257 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, | 258 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, |
258 ConsiderSlowRedirectAsUserInitiated) { | 259 ConsiderSlowRedirectAsUserInitiated) { |
259 // Test the history length for the following page transition. | 260 // Test the history length for the following page transition. |
260 // | 261 // |
261 // -open-> Page 21 -redirect-> Page 22. | 262 // -open-> Page 21 -redirect-> Page 22. |
262 // | 263 // |
263 // If redirect occurs more than 5 seconds later after the page is loaded, | 264 // If redirect occurs more than 5 seconds later after the page is loaded, |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 chrome::ExecuteCommand(browser(), IDC_SHOW_HISTORY); | 493 chrome::ExecuteCommand(browser(), IDC_SHOW_HISTORY); |
493 | 494 |
494 content::WebContents* active_web_contents = | 495 content::WebContents* active_web_contents = |
495 chrome::GetActiveWebContents(browser()); | 496 chrome::GetActiveWebContents(browser()); |
496 ASSERT_EQ(web_contents, active_web_contents); | 497 ASSERT_EQ(web_contents, active_web_contents); |
497 ASSERT_EQ(history_url, active_web_contents->GetURL()); | 498 ASSERT_EQ(history_url, active_web_contents->GetURL()); |
498 | 499 |
499 TabContents* second_tab = browser()->tab_strip_model()->GetTabContentsAt(1); | 500 TabContents* second_tab = browser()->tab_strip_model()->GetTabContentsAt(1); |
500 ASSERT_NE(history_url, second_tab->web_contents()->GetURL()); | 501 ASSERT_NE(history_url, second_tab->web_contents()->GetURL()); |
501 } | 502 } |
OLD | NEW |