summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 23:34:03 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 23:34:03 +0000
commitf890108d79ed124f122b1e2526866e0e96410ff9 (patch)
treea7cb6a7e96646af30f8935d3638c20662e7cbe57 /chrome/test
parent8922de5133af29b6d89830f5df893b3eccf3c7c1 (diff)
downloadchromium_src-f890108d79ed124f122b1e2526866e0e96410ff9.zip
chromium_src-f890108d79ed124f122b1e2526866e0e96410ff9.tar.gz
chromium_src-f890108d79ed124f122b1e2526866e0e96410ff9.tar.bz2
This fixes the VerifyHistoryLength ui test flakiness. The test initiates page navigations in timers and reads the history length to validate it.
When we receive a request to initiate a navigation in the browser, we send out the request to the renderer and then immediately read the history length and send it out in an update history length request. This causes the test to fail at times as it reads a stale history length. When we receive the DidAddHistoryItem notification in the renderer, we should not update the history length for the start page navigation. This results in the test failure at times as it reads an incorrect history length. R=jam Review URL: http://codereview.chromium.org/8898 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4344 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/History/history_length_test1.html6
-rw-r--r--chrome/test/data/History/history_length_test2.html5
2 files changed, 5 insertions, 6 deletions
diff --git a/chrome/test/data/History/history_length_test1.html b/chrome/test/data/History/history_length_test1.html
index 4a44fa9..5700661 100644
--- a/chrome/test/data/History/history_length_test1.html
+++ b/chrome/test/data/History/history_length_test1.html
@@ -23,7 +23,7 @@ function onLoad() {
return true;
}
- setTimeout(OnNavigateToPage2, 100);
+ setTimeout(OnNavigateToPage2, 100);
return true;
}
@@ -42,7 +42,7 @@ function OnValidateHistoryForSecondRun() {
function OnMoveForwardInHistory() {
if (window.history.length != 2) {
- onFailure("History_Length_Test", 1, "History length mismatch");
+ onFailure("History_Length_Test", 1, "History length mismatch in MoveForward navigation");
return false;
}
@@ -53,7 +53,7 @@ function OnMoveForwardInHistory() {
function OnNavigateToPage2() {
if (window.history.length != 2) {
- onFailure("History_Length_Test", 1, "History length mismatch");
+ onFailure("History_Length_Test", 1, "History length mismatch in initial navigation");
return false;
}
diff --git a/chrome/test/data/History/history_length_test2.html b/chrome/test/data/History/history_length_test2.html
index 2bae3ac..39b5ebc 100644
--- a/chrome/test/data/History/history_length_test2.html
+++ b/chrome/test/data/History/history_length_test2.html
@@ -11,13 +11,12 @@ History test2....
<SCRIPT type="text/javascript">
function onLoad() {
- setTimeout(OnValidateHistoryLength, 100);
+ setTimeout(OnValidateHistoryLength, 100);
}
function OnValidateHistoryLength() {
if (window.history.length != 3) {
- onFailure("History_Length_Test", 1, "History length mismatch");
- alert(window.history.length);
+ onFailure("History_Length_Test", 1, "History length mismatch in second page OnLoad");
return false;
}