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

Unified Diff: LayoutTests/fast/forms/form-submission-cancelable.html

Issue 1323573005: Fix flakiness of form-submission-cancelable.html. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/forms/form-submission-cancelable-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/form-submission-cancelable.html
diff --git a/LayoutTests/fast/forms/form-submission-cancelable.html b/LayoutTests/fast/forms/form-submission-cancelable.html
index 1d91a758fe410f39ed9c097cdd93059bc7254a08..7379bdd48ceac5b6baa15d2812e1c4ddb972ffba 100644
--- a/LayoutTests/fast/forms/form-submission-cancelable.html
+++ b/LayoutTests/fast/forms/form-submission-cancelable.html
@@ -4,11 +4,11 @@
<script src="../../resources/js-test.js"></script>
</head>
<body>
-<form method="GET" target="target">
+<form method="GET" target="target" action="data:text/html,a">
<input name="query" value="AAA" />
<input type="submit" id="submitButton"/>
</form>
-<form method="GET" target="target1">
+<form method="GET" target="target1" action="data:text/html,b">
<input name="query1" value="AAA" />
<input type="submit" id="submitButton1"/>
</form>
@@ -16,16 +16,6 @@
<iframe id="target1" name="target1"></iframe>
<script>
description('Test that form submit within onsubmit event handlers are not delayed and sends the form data when invoked');
-var count = 2;
-
-function asyncTest(query) {
- if (query === '?query=AAA' || query === '?query1=BBB') {
- if (--count == 0) {
- testPassed('Both query events received, with correct values: AAA and BBB');
- finishJSTest();
- }
- }
-}
document.forms[0].onsubmit = function (event) {
document.forms[0].submit();
@@ -39,19 +29,20 @@ document.forms[1].onsubmit = function (event) {
return true;
}
-document.getElementById('target').onload = function(event) {
- // This should return back query AAA
- asyncTest(event.target.contentWindow.location.search);
-}
+window.onload = function() {
+ document.getElementById('target').onload = function(event) {
+ // This should return back query AAA
+ shouldBeEqualToString('event.target.contentWindow.location.search', '?query=AAA');
+ document.getElementById('submitButton1').click();
+ }
-document.getElementById('target1').onload = function(event) {
- // This should return back query BBB
- asyncTest(event.target.contentWindow.location.search);
-}
+ document.getElementById('target1').onload = function(event) {
+ // This should return back query BBB
+ shouldBeEqualToString('event.target.contentWindow.location.search', '?query1=BBB');
+ finishJSTest();
+ }
-window.onload = function() {
document.getElementById('submitButton').click();
- document.getElementById('submitButton1').click();
}
if (window.testRunner)
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/forms/form-submission-cancelable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698