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

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

Issue 200613004: Test flakiness fix for form submission cancelable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrected wrong return value for second query in the test Created 6 years, 9 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 | « no previous file | 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 9a41a572c7b79f01aa7122ce48873c5f97782a47..1d91a758fe410f39ed9c097cdd93059bc7254a08 100644
--- a/LayoutTests/fast/forms/form-submission-cancelable.html
+++ b/LayoutTests/fast/forms/form-submission-cancelable.html
@@ -17,6 +17,16 @@
<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();
document.forms[0].children.query.value = 'BBB';
@@ -30,20 +40,18 @@ document.forms[1].onsubmit = function (event) {
}
document.getElementById('target').onload = function(event) {
- shouldBeEqualToString('event.target.contentWindow.location.search', '?query=AAA');
- if (--count == 0)
- finishJSTest();
+ // This should return back query AAA
+ asyncTest(event.target.contentWindow.location.search);
}
document.getElementById('target1').onload = function(event) {
- shouldBeEqualToString('event.target.contentWindow.location.search', '?query1=BBB');
- if (--count == 0)
- finishJSTest();
+ // This should return back query BBB
+ asyncTest(event.target.contentWindow.location.search);
}
window.onload = function() {
- document.getElementById('submitButton1').click();
document.getElementById('submitButton').click();
+ document.getElementById('submitButton1').click();
}
if (window.testRunner)
« no previous file with comments | « no previous file | LayoutTests/fast/forms/form-submission-cancelable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698