summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 14:58:54 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 14:58:54 +0000
commit95bbb6c557f49c00783543d1313c2caec63adf31 (patch)
tree506ebdf52773c5360442e49e1f25c0e06b68bb20 /chrome_frame/test
parentde4aebacced33aa826ec85c91332ac1e87ffe50d (diff)
downloadchromium_src-95bbb6c557f49c00783543d1313c2caec63adf31.zip
chromium_src-95bbb6c557f49c00783543d1313c2caec63adf31.tar.gz
chromium_src-95bbb6c557f49c00783543d1313c2caec63adf31.tar.bz2
The ChromeFrame JavascriptWindowOpen test tries to open a popup in the onload notification, which is blocked on
IE7/8 by the popup blocker thus causing this test to consistently fail. Fix is to open the popup in the ondblclick notification and to fire dummy mouse down events to the IE window to trigger this event. TBR=amit Review URL: http://codereview.chromium.org/2866013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/data/no_interference/window_open.html5
-rw-r--r--chrome_frame/test/no_interference_test.cc7
-rw-r--r--chrome_frame/test/test_mock_with_web_server.cc5
-rw-r--r--chrome_frame/test/test_mock_with_web_server.h5
4 files changed, 14 insertions, 8 deletions
diff --git a/chrome_frame/test/data/no_interference/window_open.html b/chrome_frame/test/data/no_interference/window_open.html
index b426b17..a8b1c37 100644
--- a/chrome_frame/test/data/no_interference/window_open.html
+++ b/chrome_frame/test/data/no_interference/window_open.html
@@ -1,12 +1,13 @@
<html>
<head>
<script type="text/javascript">
- window.onload = function() {
+ function popup() {
window.open("empty.html", "test");
}
</script>
</head>
- <body>
+
+ <body ondblclick="popup();">
Calling window.open...
</body>
</html> \ No newline at end of file
diff --git a/chrome_frame/test/no_interference_test.cc b/chrome_frame/test/no_interference_test.cc
index 3731b04c..e90dfe5 100644
--- a/chrome_frame/test/no_interference_test.cc
+++ b/chrome_frame/test/no_interference_test.cc
@@ -136,7 +136,12 @@ TEST_F(NoInterferenceTest, FLAKY_JavascriptWindowOpen) {
testing::StrictMock<MockWebBrowserEventSink> > new_window_mock;
mock_.ExpectNavigationInIE(kWindowOpenUrl);
- EXPECT_CALL(mock_, OnIELoad(testing::StrCaseEq(kWindowOpenUrl)));
+ EXPECT_CALL(mock_, OnIELoad(testing::StrCaseEq(kWindowOpenUrl)))
+ .WillOnce(testing::DoAll(
+ DelaySendMouseClickToIE(&mock_, &loop_, 0, 100, 100,
+ simulate_input::LEFT),
+ DelaySendMouseClickToIE(&mock_, &loop_, 0, 100, 100,
+ simulate_input::LEFT)));
mock_.ExpectNewWindowWithIE(empty_page_url(), &new_window_mock);
EXPECT_CALL(new_window_mock, OnIELoad(testing::StrCaseEq(empty_page_url())))
diff --git a/chrome_frame/test/test_mock_with_web_server.cc b/chrome_frame/test/test_mock_with_web_server.cc
index 0611a9d..59faaab 100644
--- a/chrome_frame/test/test_mock_with_web_server.cc
+++ b/chrome_frame/test/test_mock_with_web_server.cc
@@ -203,11 +203,6 @@ ACTION_P6(DelaySendMouseClick, mock, loop, delay, x, y, button) {
&MockWebBrowserEventSink::SendMouseClick, x, y, button), delay);
}
-ACTION_P4(DelaySendChar, loop, delay, c, mod) {
- loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(
- simulate_input::SendCharA, c, mod), delay);
-}
-
ACTION_P3(DelaySendString, loop, delay, str) {
loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(
simulate_input::SendStringW, str), delay);
diff --git a/chrome_frame/test/test_mock_with_web_server.h b/chrome_frame/test/test_mock_with_web_server.h
index 99fc0fe..dfec957 100644
--- a/chrome_frame/test/test_mock_with_web_server.h
+++ b/chrome_frame/test/test_mock_with_web_server.h
@@ -123,6 +123,11 @@ ACTION_P5(ValidateWindowSize, mock, left, top, width, height) {
EXPECT_EQ(actual_height, height);
}
+ACTION_P4(DelaySendChar, loop, delay, c, mod) {
+ loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(
+ simulate_input::SendCharA, c, mod), delay);
+}
+
} // namespace chrome_frame_test
#endif // CHROME_FRAME_TEST_MOCK_WITH_WEB_SERVER_H_