diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 01:49:03 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 01:49:03 +0000 |
commit | 3dc423f963527b2788226359b34ab367f0788e44 (patch) | |
tree | 173cd115933f760bd784cb7dafc742f2b8d9a171 /chrome/test/data/History | |
parent | 53f4826c9fe6bea1718a499dc686f26dbf24ab50 (diff) | |
download | chromium_src-3dc423f963527b2788226359b34ab367f0788e44.zip chromium_src-3dc423f963527b2788226359b34ab367f0788e44.tar.gz chromium_src-3dc423f963527b2788226359b34ab367f0788e44.tar.bz2 |
Another attempt at fixing the VerifyHistoryLength3 ui test failures. The history length
when we reach the final page 4 in the sequence should be 5. The test2 incorrectly assumed
this to be 4 instead. Also page 2 could be navigated in the forward backward sequence.
Handle that as well.
Leaving the FAILS prefix on the VerifyHistoryLength3 test for now to validate whether it
passes correctly on all builders.
Bug=50931
Review URL: http://codereview.chromium.org/3141044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/History')
4 files changed, 48 insertions, 18 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 548512c..3db0b97 100644 --- a/chrome/test/data/History/history_length_test_page_1.html +++ b/chrome/test/data/History/history_length_test_page_1.html @@ -13,21 +13,22 @@ History Test Page 1.... function onLoad() { if (readCookie(navigate_backward_cookie) != null) { - setTimeout(OnNavigateBackward, 50); + setTimeout(OnNavigateBackward, 0); return true; } - setTimeout(OnInitialLoad, 50); + setTimeout(OnInitialLoad, 0); return true; } function OnNavigateBackward() { - if (window.history.length != 4) { + if (window.history.length != 5) { onFailure("History_Length_Test_3", 1, "History length mismatch on navigate backward at page 1: " + window.history.length); return false; } // Navigate forward from this point on. + eraseCookie(navigate_backward_cookie); createCookie(navigate_forward_cookie, "1", "1"); window.history.forward(); return true; 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 cd153d0..edc0dee 100644 --- a/chrome/test/data/History/history_length_test_page_2.html +++ b/chrome/test/data/History/history_length_test_page_2.html @@ -12,13 +12,42 @@ History Test Page 2.... <script type="text/javascript"> function onLoad() { - if (readCookie(navigate_backward_cookie) != null || - readCookie(navigate_forward_cookie) != null) { - onFailure("History_Length_Test_3", 1, - "Page 2 must not be visited in navigating backward/forward"); + // This page could be visited in the following sequences:- + // 1. history_length_test_page1->history_length_test_page2.html + // 2. history_length_test_page1->history_length_test_page2.html-> + // redirect to history_length_test_page3.html + // ->history_length_test_page4.html->history_length_test_page3.html-> + // history_length_test_page2.html->history_length_test_page1.html-> + // history_length_test_page2.html + if (readCookie(navigate_forward_cookie) != null) { + setTimeout(OnNavigateForward, 0); + } else if (readCookie(navigate_backward_cookie) != null) { + setTimeout(OnNavigateBackward, 0); + } else { + setTimeout(OnInitialLoad, 0); + } + return true; +} + +function OnNavigateForward() { + if (window.history.length != 5) { + onFailure("History_Length_Test_2", 1, + "History length mismatch on initial load at page 2: " + + window.history.length); + return false; + } + window.history.forward(); + return true; +} + +function OnNavigateBackward() { + if (window.history.length != 5) { + onFailure("History_Length_Test_2", 1, + "History length mismatch on initial load at page 2: " + + window.history.length); return false; } - setTimeout(OnInitialLoad, 50); + window.history.back(); return true; } 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 bc9ef65..c0154fe 100644 --- a/chrome/test/data/History/history_length_test_page_3.html +++ b/chrome/test/data/History/history_length_test_page_3.html @@ -13,14 +13,14 @@ History Test Page 3.... function onLoad() { if (readCookie(navigate_forward_cookie) != null) { - setTimeout(OnNavigateForward, 50); + setTimeout(OnNavigateForward, 0); return true; } if (readCookie(navigate_backward_cookie) != null) { - setTimeout(OnNavigateBackward, 50); + setTimeout(OnNavigateBackward, 0); return true; } - setTimeout(OnInitialLoad, 50); + setTimeout(OnInitialLoad, 0); return true; } @@ -30,7 +30,7 @@ function OnInitialLoad() { // 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. + // This history lengths could be 3 or 5. if (window.history.length != 3 && window.history.length != 4) { onFailure("History_Length_Test_2", 1, "History length mismatch on initial load at page 3: " + @@ -42,7 +42,7 @@ function OnInitialLoad() { } function OnNavigateBackward() { - if (window.history.length != 4) { + if (window.history.length != 5) { onFailure("History_Length_Test_3", 1, "History length mismatch on navigating backward at page 3: " + window.history.length); @@ -53,7 +53,7 @@ function OnNavigateBackward() { } function OnNavigateForward() { - if (window.history.length != 4) { + if (window.history.length != 5) { onFailure("History_Length_Test_3", 1, "History length mismatch on navigating forward at page 3: " + window.history.length); diff --git a/chrome/test/data/History/history_length_test_page_4.html b/chrome/test/data/History/history_length_test_page_4.html index 3e6b8a0..2b99d2f 100644 --- a/chrome/test/data/History/history_length_test_page_4.html +++ b/chrome/test/data/History/history_length_test_page_4.html @@ -13,15 +13,15 @@ History Test Page 4.... function onLoad() { if (readCookie(navigate_forward_cookie) != null) { - setTimeout(OnNavigateForward, 50); + setTimeout(OnNavigateForward, 0); return true; } - setTimeout(OnInitialLoad, 50); + setTimeout(OnInitialLoad, 0); return true; } function OnInitialLoad() { - if (window.history.length != 4) { + if (window.history.length != 5) { onFailure("History_Length_Test_3", 1, "History length mismatch on initial load at page 4: " + window.history.length); @@ -34,7 +34,7 @@ function OnInitialLoad() { } function OnNavigateForward() { - if (window.history.length != 4) { + if (window.history.length != 5) { onFailure("History_Length_Test_3", 1, "History length mismatch on navigating forward at page 4: " + window.history.length); |