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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html

Issue 2215023002: Fix test so that it doesn't rely on hash navigation during unload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html b/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html
index 5883612d88cb2fe7d6e5512f87dfc3299f8134d4..22f8993fa2f9b3b046e61625a82c968be618ed56 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html
@@ -44,41 +44,29 @@
console.log('Test if state of stateless form control types are not saved.');
jsTestIsAsync = true;
-function dumpFormState() {
- if (window.internals) {
- var statefulTypes = ['hidden', 'text', 'tel', 'url', 'email', 'number', 'range', 'checkbox',
- 'radio', 'file', 'select-one', 'select-multiple', 'textarea'];
- var statelessTypes = ['fieldset', 'password', 'submit', 'reset', 'button', 'keygen', 'output'];
+if (window.internals) {
+ var statefulTypes = ['hidden', 'text', 'tel', 'url', 'email', 'number', 'range', 'checkbox',
+ 'radio', 'file', 'select-one', 'select-multiple', 'textarea'];
+ var statelessTypes = ['fieldset', 'password', 'submit', 'reset', 'button', 'keygen', 'output'];
- var states = internals.formControlStateOfHistoryItem();
- for (var i = 0; i < statefulTypes.length; ++i) {
- if (states.indexOf(statefulTypes[i]) >= 0)
- testPassed('There is a state for ' + statefulTypes[i]);
- else
- testFailed('There no state for ' + statefulTypes[i]);
- }
+ var states = internals.formControlStateOfHistoryItem();
+ for (var i = 0; i < statefulTypes.length; ++i) {
+ if (states.indexOf(statefulTypes[i]) >= 0)
+ testPassed('There is a state for ' + statefulTypes[i]);
+ else
+ testFailed('There no state for ' + statefulTypes[i]);
+ }
- for (var i = 0; i < statelessTypes.length; ++i) {
- if (states.indexOf(statelessTypes[i]) < 0)
- testPassed('There is no state for ' + statelessTypes[i]);
- else
- testFailed('There is a state for ' + statelessTypes[i]);
- }
+ for (var i = 0; i < statelessTypes.length; ++i) {
+ if (states.indexOf(statelessTypes[i]) < 0)
+ testPassed('There is no state for ' + statelessTypes[i]);
+ else
+ testFailed('There is a state for ' + statelessTypes[i]);
}
- // Remove the input elements from the document to avoid a bunch of trailing
- // whitespace in the test output.
- document.body.removeChild(document.getElementById("elements"));
- finishJSTest();
}
-
-window.onload = function() {
- setTimeout(function() {
- location.reload();
- }, 0);
-};
-window.onunload = function() {
- dumpFormState();
- location.hash = "#done";
-};
+// Remove the input elements from the document to avoid a bunch of trailing
+// whitespace in the test output.
+document.body.removeChild(document.getElementById("elements"));
+finishJSTest();
</script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698