summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/navigation_test.cc
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 13:47:13 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 13:47:13 +0000
commitf5d1ea32ea7081621c692e03ae153f74bde105b3 (patch)
tree6f508b877d92d3d3dccab58dc49284434c5b9cd3 /chrome_frame/test/navigation_test.cc
parent2014db003dcdc6e45aed7ba6d5e51819354ef66a (diff)
downloadchromium_src-f5d1ea32ea7081621c692e03ae153f74bde105b3.zip
chromium_src-f5d1ea32ea7081621c692e03ae153f74bde105b3.tar.gz
chromium_src-f5d1ea32ea7081621c692e03ae153f74bde105b3.tar.bz2
This changelist consists of a test for the Delete Browsing History feature.
The feature was never covered by automated tests, and a recent changelist addressed a bug in the feature (http://codereview.chromium.org/3167040). The test validates the following: 1) That cached files are re-retrieved after the user requests their deletion. 2) That saved form data is deleted after the user requests its deletion. 3) That Chrome Frame tabs do not crash when the user deletes browsing history. BUG=56212 TEST= (1) Run "chrome_frame_tests.exe --gclient_filter=DeleteBro*" (should pass) (2) Run the test, and immediately lock your workstation before it starts. It should still pass. (3) Comment out the call to RemoveBrowsingData in DeleteChromeHistory::OnAutomationServerReady (chrome_frame/delete_chrome_history.cc) and run the test. It fails. (4) Revert changes from 3, comment out the check for low integrity level in DeleteChromeHistory::DeleteBrowsingHistory (same file) and run the test. It fails. Review URL: http://codereview.chromium.org/3365010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/navigation_test.cc')
-rw-r--r--chrome_frame/test/navigation_test.cc32
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());