diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 05:51:42 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 05:51:42 +0000 |
commit | ddc56f01f9cd23420a7215ffd39bef2ecd0e4d53 (patch) | |
tree | 5438c83c48b718edf8f0cb50c7edbd2f2d90a7c1 /chrome_frame | |
parent | cbf9b519e0ad46d106d7bc80e2768811af6e7841 (diff) | |
download | chromium_src-ddc56f01f9cd23420a7215ffd39bef2ecd0e4d53.zip chromium_src-ddc56f01f9cd23420a7215ffd39bef2ecd0e4d53.tar.gz chromium_src-ddc56f01f9cd23420a7215ffd39bef2ecd0e4d53.tar.bz2 |
Fix the randomly failing ChromeFrame window open tests to account for the additional DocumentComplete event fired
on IE8 as well on the same lines as IE7. This event fires twice randomly. Modified the expectations to handle this.
TBR=stoyan
Review URL: http://codereview.chromium.org/2799026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/no_interference_test.cc | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/chrome_frame/test/no_interference_test.cc b/chrome_frame/test/no_interference_test.cc index 5e68c6f..d02ecdb 100644 --- a/chrome_frame/test/no_interference_test.cc +++ b/chrome_frame/test/no_interference_test.cc @@ -166,17 +166,12 @@ TEST_F(NoInterferenceTest, FLAKY_JavascriptWindowOpen) { empty_page_url())), DelayCloseBrowserMock(&loop_, 2000, &new_window_mock))); - if (chrome_frame_test::GetInstalledIEVersion() == IE_7) { - // On IE7 the DocumentComplete fires twice for new windows. Hack to account - // for that. - testing::InSequence seq; + if (chrome_frame_test::GetInstalledIEVersion() != IE_6) { + // On IE7/8 the DocumentComplete at times fires twice for new windows. Hack + // to account for that. EXPECT_CALL(new_window_mock, OnIELoad(testing::StrCaseEq(empty_page_url()))) - .Times(1); - - EXPECT_CALL(new_window_mock, - OnIELoad(testing::StrCaseEq(empty_page_url()))) - .Times(1); + .Times(testing::AtMost(2)); } else { EXPECT_CALL(new_window_mock, OnIELoad(testing::StrCaseEq(empty_page_url()))) @@ -263,18 +258,14 @@ TEST_F(NoInterferenceTest, FLAKY_SelectContextMenuOpenInNewWindow) { SelectItem(&loop_, 1500, open_new_window_index))); mock_.ExpectNewWindowWithIE(empty_page_url(), &new_window_mock); - if (chrome_frame_test::GetInstalledIEVersion() == IE_7) { - // On IE7 the DocumentComplete fires twice for new windows. Hack to account - // for that. - testing::InSequence seq; - EXPECT_CALL(new_window_mock, - OnIELoad(testing::StrCaseEq(empty_page_url()))) - .Times(1); - + if (chrome_frame_test::GetInstalledIEVersion() != IE_6) { + // On IE6/7 the DocumentComplete at times fires twice for new windows. Hack + // to account for that. // TODO(kkania): Verifying the address bar is flaky with this, at least // on XP ie6. Fix. EXPECT_CALL(new_window_mock, OnIELoad(testing::StrCaseEq(empty_page_url()))) + .Times(testing::AtMost(2)) .WillOnce(DelayCloseBrowserMock(&loop_, 2000, &new_window_mock)); } else { // TODO(kkania): Verifying the address bar is flaky with this, at least |