diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-09 20:40:14 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-09 20:40:14 +0000 |
commit | 2ffc6f7dd40198a8f8f4445bf25be5cf2ebdafe1 (patch) | |
tree | 41689d271cb7e45afe668a76e3d52916ee54d884 /chrome | |
parent | 2fd822f98d6f41efe6051d74a3be89593e1385b0 (diff) | |
download | chromium_src-2ffc6f7dd40198a8f8f4445bf25be5cf2ebdafe1.zip chromium_src-2ffc6f7dd40198a8f8f4445bf25be5cf2ebdafe1.tar.gz chromium_src-2ffc6f7dd40198a8f8f4445bf25be5cf2ebdafe1.tar.bz2 |
Fix the consistently failing VerifyHistoryLength2 and VerifyHistoryLength3 tests. The VerifyHistoryLength3
was broken during refactoring as it needs navigation to page1 followed by navigation to page 2, etc.
The length checks were also broken in the test pages.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=39785
Bug=39785
Review URL: http://codereview.chromium.org/2923002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
4 files changed, 29 insertions, 13 deletions
diff --git a/chrome/test/data/History/history_length_test_page_1.html b/chrome/test/data/History/history_length_test_page_1.html index 34fa74b..548512c 100644 --- a/chrome/test/data/History/history_length_test_page_1.html +++ b/chrome/test/data/History/history_length_test_page_1.html @@ -21,7 +21,7 @@ function onLoad() { } function OnNavigateBackward() { - if (window.history.length != 2) { + if (window.history.length != 4) { onFailure("History_Length_Test_3", 1, "History length mismatch on navigate backward at page 1: " + window.history.length); diff --git a/chrome/test/data/History/history_length_test_page_2.html b/chrome/test/data/History/history_length_test_page_2.html index b40912e..cd153d0 100644 --- a/chrome/test/data/History/history_length_test_page_2.html +++ b/chrome/test/data/History/history_length_test_page_2.html @@ -23,7 +23,7 @@ function onLoad() { } function OnInitialLoad() { - if (window.history.length != 3) { + if (window.history.length != 2 && window.history.length != 3) { onFailure("History_Length_Test_2", 1, "History length mismatch on initial load at page 2: " + window.history.length); diff --git a/chrome/test/data/History/history_length_test_page_3.html b/chrome/test/data/History/history_length_test_page_3.html index 32de5aa..bc9ef65 100644 --- a/chrome/test/data/History/history_length_test_page_3.html +++ b/chrome/test/data/History/history_length_test_page_3.html @@ -25,7 +25,13 @@ function onLoad() { } function OnInitialLoad() { - if (window.history.length != 3) { + // This page could be visited in the following sequences:- + // 1. history_length_test_page2.html redirect to + // history_length_test_page3.html + // 1. history_length_test_page1.html -> history_length_test_page2.html + // redirects to history_length_page3.html. + // This history lengths could be 3 or 4. + if (window.history.length != 3 && window.history.length != 4) { onFailure("History_Length_Test_2", 1, "History length mismatch on initial load at page 3: " + window.history.length); @@ -36,7 +42,7 @@ function OnInitialLoad() { } function OnNavigateBackward() { - if (window.history.length != 3) { + if (window.history.length != 4) { onFailure("History_Length_Test_3", 1, "History length mismatch on navigating backward at page 3: " + window.history.length); @@ -47,7 +53,7 @@ function OnNavigateBackward() { } function OnNavigateForward() { - if (window.history.length != 3) { + if (window.history.length != 4) { onFailure("History_Length_Test_3", 1, "History length mismatch on navigating forward at page 3: " + window.history.length); diff --git a/chrome/test/ui/history_uitest.cc b/chrome/test/ui/history_uitest.cc index 205f27d..45e0983 100644 --- a/chrome/test/ui/history_uitest.cc +++ b/chrome/test/ui/history_uitest.cc @@ -44,10 +44,7 @@ TEST_F(HistoryTester, VerifyHistoryLength1) { kTestCompleteSuccess, action_max_timeout_ms()); } -// TODO(yuzo): Fix the following failing tests. http://crbug.com/39785 -// These tests are broken because automatic and user-initiated transitions are -// distinguished based on the interval between page load and redirect. -TEST_F(HistoryTester, FAILS_VerifyHistoryLength2) { +TEST_F(HistoryTester, VerifyHistoryLength2) { // Test the history length for the following page transitions. // -open-> Page 2 -redirect-> Page 3. @@ -59,11 +56,24 @@ TEST_F(HistoryTester, FAILS_VerifyHistoryLength2) { kTestCompleteSuccess, action_max_timeout_ms()); } -// Fails consistently: http://crbug.com/39785 -TEST_F(HistoryTester, FAILS_VerifyHistoryLength3) { +TEST_F(HistoryTester, VerifyHistoryLength3) { // Test the history length for the following page transitions. - // -open-> Page 4 -navigate_backward-> Page 3 -navigate_backward->Page 1 - // -navigate_forward-> Page 3 -navigate_forward-> Page 4 + // -open-> Page 1 -> open Page 2 -redirect Page 3. open Page 4 + // -navigate_backward-> Page 3 -navigate_backward->Page 1 + // -navigate_forward-> Page 3 -navigate_forward-> Page 4 + const FilePath test_case_1( + FILE_PATH_LITERAL("history_length_test_page_1.html")); + GURL url_1 = ui_test_utils::GetTestUrl(FilePath(kHistoryDir), test_case_1); + NavigateToURL(url_1); + WaitForFinish("History_Length_Test_1", "1", url_1, kTestCompleteCookie, + kTestCompleteSuccess, action_max_timeout_ms()); + + const FilePath test_case_2( + FILE_PATH_LITERAL("history_length_test_page_2.html")); + GURL url_2 = ui_test_utils::GetTestUrl(FilePath(kHistoryDir), test_case_2); + NavigateToURL(url_2); + WaitForFinish("History_Length_Test_2", "1", url_2, kTestCompleteCookie, + kTestCompleteSuccess, action_max_timeout_ms()); const FilePath test_case_3( FILE_PATH_LITERAL("history_length_test_page_4.html")); |