Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8995)

Unified Diff: chrome_frame/test/test_mock_with_web_server.cc

Issue 2173002: Add chrome frame tests for common navigation cases to ensure IE is not broken. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: final Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/test/test_mock_with_web_server.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/test_mock_with_web_server.cc
diff --git a/chrome_frame/test/test_mock_with_web_server.cc b/chrome_frame/test/test_mock_with_web_server.cc
index 5ab180bbae6f31eeb40d5a0fa162cb39c981ac11..d90cc8e938c03d64b3d3f1bda4441973d489016a 100644
--- a/chrome_frame/test/test_mock_with_web_server.cc
+++ b/chrome_frame/test/test_mock_with_web_server.cc
@@ -147,6 +147,34 @@ ExpectationSet MockWebBrowserEventSink::ExpectNewWindow(
return new_window;
}
+ExpectationSet MockWebBrowserEventSink::ExpectNavigationInIE(
+ const std::wstring& url) {
+ testing::InSequence sequence;
+ ExpectationSet navigation;
+ navigation += EXPECT_CALL(*this, OnBeforeNavigate2(_,
+ testing::Field(&VARIANT::bstrVal,
+ testing::StrCaseEq(url)), _, _, _, _, _));
+ navigation += EXPECT_CALL(*this, OnFileDownload(VARIANT_TRUE, _))
+ .Times(testing::AnyNumber());
+ navigation += EXPECT_CALL(*this, OnNavigateComplete2(_,
+ testing::Field(&VARIANT::bstrVal,
+ testing::StrCaseEq(url))));
+ return navigation;
+}
+
+ExpectationSet MockWebBrowserEventSink::ExpectNewWindowWithIE(
+ const std::wstring& url, MockWebBrowserEventSink* new_window_mock) {
+ DCHECK(new_window_mock);
+ ExpectationSet new_window;
+ new_window += EXPECT_CALL(*this, OnNewWindow3(_, _, _, _, _));
+ new_window += EXPECT_CALL(*this, OnNewBrowserWindow(_, _))
+ .WillOnce(testing::WithArgs<0>(testing::Invoke(CreateFunctor(
+ new_window_mock, &MockWebBrowserEventSink::Attach))));
+
+ new_window_mock->ExpectNavigationInIE(url);
+ return new_window;
+}
+
} // namespace chrome_frame_test
ACTION_P3(DelayCloseBrowserMock, loop, delay, mock) {
@@ -180,27 +208,13 @@ ACTION_P4(DelaySendChar, loop, delay, c, mod) {
simulate_input::SendCharA, c, mod), delay);
}
-ACTION_P4(DelaySendScanCode, loop, delay, c, mod) {
+ACTION_P3(DelaySendString, loop, delay, str) {
loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(
- simulate_input::SendScanCode, c, mod), delay);
+ simulate_input::SendStringW, str), delay);
}
ACTION_P5(SendExtendedKeysEnter, loop, delay, c, repeat, mod) {
- const unsigned int kInterval = 25;
- unsigned int next_delay = delay;
- for (int i = 0; i < repeat; i++) {
- loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(
- simulate_input::SendExtendedKey, c, mod), next_delay);
- next_delay += kInterval;
- }
-
- loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(
- simulate_input::SendCharA, VK_RETURN, simulate_input::NONE), next_delay);
-}
-
-ACTION_P3(DelaySendString, loop, delay, str) {
- loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(
- simulate_input::SendStringW, str), delay);
+ chrome_frame_test::DelaySendExtendedKeysEnter(loop, delay, c, repeat, mod);
}
ACTION(DoCloseWindow) {
« no previous file with comments | « chrome_frame/test/test_mock_with_web_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698