diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 21:08:00 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 21:08:00 +0000 |
commit | 0cc270a99dcae7021c0ccbed22c376d157e579cb (patch) | |
tree | cad1bacfcb6a227157d1689959259922dcc43a7a /chrome_frame | |
parent | 44d76e1eeb3fb8ffb8e6b809c9535c3390662dc3 (diff) | |
download | chromium_src-0cc270a99dcae7021c0ccbed22c376d157e579cb.zip chromium_src-0cc270a99dcae7021c0ccbed22c376d157e579cb.tar.gz chromium_src-0cc270a99dcae7021c0ccbed22c376d157e579cb.tar.bz2 |
Fix ChromeFrame full tab refresh tests to get them to work more reliably. We now call Refresh
on the WebBrowser interface when we receive the OnLoad notification from Chrome.
Increased the timeout for the refresh tests to get them to work correctly on the slower CF
builders.
BUG=none
TEST=ChromeFrame tests.
Review URL: http://codereview.chromium.org/6410049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73666 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.cc | 1 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.h | 1 | ||||
-rw-r--r-- | chrome_frame/test/ie_event_sink.cc | 2 | ||||
-rw-r--r-- | chrome_frame/test/navigation_test.cc | 32 |
4 files changed, 21 insertions, 15 deletions
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc index 17f4483..e28abea 100644 --- a/chrome_frame/test/chrome_frame_test_utils.cc +++ b/chrome_frame/test/chrome_frame_test_utils.cc @@ -50,6 +50,7 @@ const char kChromeImageName[] = "chrome.exe"; const wchar_t kIEProfileName[] = L"iexplore"; const wchar_t kChromeLauncher[] = L"chrome_launcher.exe"; const int kChromeFrameLongNavigationTimeoutInSeconds = 10; +const int kChromeFrameVeryLongNavigationTimeoutInSeconds = 30; const wchar_t TempRegKeyOverride::kTempTestKeyPath[] = L"Software\\Chromium\\TempTestKeys"; diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h index 3715f88f..8b45ba1 100644 --- a/chrome_frame/test/chrome_frame_test_utils.h +++ b/chrome_frame/test/chrome_frame_test_utils.h @@ -60,6 +60,7 @@ extern const wchar_t kSafariImageName[]; extern const char kChromeImageName[]; extern const wchar_t kChromeLauncher[]; extern const int kChromeFrameLongNavigationTimeoutInSeconds; +extern const int kChromeFrameVeryLongNavigationTimeoutInSeconds; // Temporarily impersonate the current thread to low integrity for the lifetime // of the object. Destructor will automatically revert integrity level. diff --git a/chrome_frame/test/ie_event_sink.cc b/chrome_frame/test/ie_event_sink.cc index ebe41dd..8e71047 100644 --- a/chrome_frame/test/ie_event_sink.cc +++ b/chrome_frame/test/ie_event_sink.cc @@ -372,7 +372,7 @@ HRESULT IEEventSink::CloseWebBrowser() { } void IEEventSink::Refresh() { - base::win::ScopedVariant refresh_level(REFRESH_NORMAL); + base::win::ScopedVariant refresh_level(REFRESH_COMPLETELY); web_browser2_->Refresh2(refresh_level.AsInput()); } diff --git a/chrome_frame/test/navigation_test.cc b/chrome_frame/test/navigation_test.cc index 0e83867..093ea42 100644 --- a/chrome_frame/test/navigation_test.cc +++ b/chrome_frame/test/navigation_test.cc @@ -946,13 +946,14 @@ TEST_P(FullTabNavigationTest, RefreshContents) { _, _, _, _, _)); EXPECT_CALL(ie_mock_, OnNavigateComplete2(_, testing::Field(&VARIANT::bstrVal, - StrEq(src_url)))) - .WillOnce(DelayRefresh(&ie_mock_, &loop_, 2000)); - + StrEq(src_url)))); EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(src_url))) - .Times(2); + .Times(2) + .WillOnce(DelayRefresh(&ie_mock_, &loop_, 50)) + .WillOnce(testing::Return()); - LaunchIEAndNavigate(src_url); + LaunchIENavigateAndLoop(src_url, + kChromeFrameVeryLongNavigationTimeoutInSeconds); } class FullTabSeleniumTest @@ -1086,7 +1087,9 @@ TEST_F(FullTabDownloadTest, TopLevelPostReissueFromChromeFramePage) { EXPECT_CALL(ie_mock_, OnLoad(false, StrEq(src_url))); EXPECT_CALL(ie_mock_, OnLoad(true, StrEq(tgt_url))) - .Times(2); + .Times(2) + .WillOnce(DelayRefresh(&ie_mock_, &loop_, 50)) + .WillOnce(testing::Return()); EXPECT_CALL(ie_mock_, OnBeforeNavigate2(_, testing::Field(&VARIANT::bstrVal, @@ -1097,11 +1100,11 @@ TEST_F(FullTabDownloadTest, TopLevelPostReissueFromChromeFramePage) { testing::Field(&VARIANT::bstrVal, StrEq(tgt_url)))) .Times(2) - .WillOnce(testing::DoAll(DelayRefresh(&ie_mock_, &loop_, 2000), - DelayCloseBrowserMock(&loop_, 4000, &ie_mock_))) + .WillOnce(DelayCloseBrowserMock(&loop_, 4000, &ie_mock_)) .WillOnce(testing::Return()); - LaunchIENavigateAndLoop(src_url, kChromeFrameLongNavigationTimeoutInSeconds); + LaunchIENavigateAndLoop(src_url, + kChromeFrameVeryLongNavigationTimeoutInSeconds); } MATCHER_P(UserAgentHeaderMatcher, ua_string, "") { @@ -1162,13 +1165,14 @@ TEST_P(FullTabNavigationTest, RefreshContentsUATest) { _, _, _, _, _)); EXPECT_CALL(ie_mock_, OnNavigateComplete2(_, testing::Field(&VARIANT::bstrVal, - StrEq(src_url)))) - .WillOnce(DelayRefresh(&ie_mock_, &loop_, 2000)); - + StrEq(src_url)))); EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(src_url))) - .Times(testing::AtMost(2)); + .Times(testing::Between(1, 2)) + .WillOnce(DelayRefresh(&ie_mock_, &loop_, 50)) + .WillOnce(testing::Return()); - LaunchIEAndNavigate(src_url); + LaunchIENavigateAndLoop(src_url, + kChromeFrameVeryLongNavigationTimeoutInSeconds); } // Link navigations in the same domain specified with the noreferrer flag |