diff options
Diffstat (limited to 'chrome_frame/test/navigation_test.cc')
-rw-r--r-- | chrome_frame/test/navigation_test.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/chrome_frame/test/navigation_test.cc b/chrome_frame/test/navigation_test.cc index 0701a30..62cb876 100644 --- a/chrome_frame/test/navigation_test.cc +++ b/chrome_frame/test/navigation_test.cc @@ -287,6 +287,7 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) { return; } MockWindowObserver win_observer_mock; + ScopedComPtr<IInternetSecurityManager> security_manager; HRESULT hr = security_manager.CreateInstance(CLSID_InternetSecurityManager); ASSERT_HRESULT_SUCCEEDED(hr); @@ -294,25 +295,25 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) { hr = security_manager->SetZoneMapping(URLZONE_UNTRUSTED, GetTestUrl(L"").c_str(), SZM_CREATE); - EXPECT_CALL(ie_mock_, OnFileDownload(_, _)) - .Times(testing::AnyNumber()); + EXPECT_CALL(ie_mock_, OnFileDownload(_, _)).Times(testing::AnyNumber()); server_mock_.ExpectAndServeAnyRequests(GetParam()); ProtocolPatchMethod patch_method = GetPatchMethod(); - const wchar_t* kDialogClass = L"#32770"; const char* kAlertDlgCaption = "Security Alert"; - EXPECT_CALL(ie_mock_, OnBeforeNavigate2(_, - testing::Field(&VARIANT::bstrVal, - testing::StrCaseEq(GetSimplePageUrl())), _, _, _, _, _)) - .Times(1) - .WillOnce(WatchWindow(&win_observer_mock, kDialogClass)); + EXPECT_CALL(ie_mock_, OnBeforeNavigate2( + _, + testing::Field(&VARIANT::bstrVal, testing::StrCaseEq(GetSimplePageUrl())), + _, _, _, _, _)) + .Times(1) + .WillOnce(WatchWindow(&win_observer_mock, kAlertDlgCaption)); if (patch_method == PATCH_METHOD_INET_PROTOCOL) { - EXPECT_CALL(ie_mock_, OnBeforeNavigate2(_, - testing::Field(&VARIANT::bstrVal, - testing::HasSubstr(L"res://")), _, _, _, _, _)) + EXPECT_CALL(ie_mock_, OnBeforeNavigate2( + _, + testing::Field(&VARIANT::bstrVal, testing::HasSubstr(L"res://")), + _, _, _, _, _)) .Times(testing::AtMost(1)); } @@ -320,11 +321,12 @@ TEST_P(FullTabNavigationTest, FLAKY_RestrictedSite) { testing::Field(&VARIANT::bstrVal, StrEq(GetSimplePageUrl())))) .Times(testing::AtMost(1)); - EXPECT_CALL(win_observer_mock, OnWindowDetected(_, StrEq(kAlertDlgCaption))) + EXPECT_CALL(win_observer_mock, OnWindowOpen(_)) .Times(1) - .WillOnce(testing::DoAll( - DoCloseWindow(), - CloseBrowserMock(&ie_mock_))); + .WillOnce(DoCloseWindow()); + EXPECT_CALL(win_observer_mock, OnWindowClose(_)) + .Times(1) + .WillOnce(CloseBrowserMock(&ie_mock_)); LaunchIEAndNavigate(GetSimplePageUrl()); |