зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1910496 [wpt PR 47345] - Delete selectlist-form-state-restore WPT, a=testonly
Automatic update from web-platform-tests Delete selectlist-form-state-restore WPT We are replacing <selectlist> with base-select <select>, which we already have fast/forms/select/select-state-restore.html for. Fixed: 40203861 Change-Id: I4e0fe8dece5d920dde11c2520028f54b9b3795f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5747251 Reviewed-by: Di Zhang <dizhangg@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1334486} -- wpt-commits: 443756026d4bb921fdedb6e95f79c3af2157c7d0 wpt-pr: 47345
This commit is contained in:
Родитель
7d1d275dc3
Коммит
a205b9a72e
|
@ -1,39 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<title>HTMLSelectListElement Test: form state restore</title>
|
||||
<link rel="author" title="Ionel Popescu" href="mailto:iopopesc@microsoft.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<input id="emptyOnFirstVisit">
|
||||
<form action="support/back.html" id="form0">
|
||||
<selectlist id="selectlist0">
|
||||
<option>one</option>
|
||||
<option>two</option>
|
||||
<option>three</option>
|
||||
</selectlist>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
async_test(t => {
|
||||
window.onload = () => t.step_timeout(() => {
|
||||
let state = document.getElementById('emptyOnFirstVisit');
|
||||
let selectList = document.getElementById("selectlist0");
|
||||
|
||||
if (!state.value) {
|
||||
// First visit.
|
||||
t.step_timeout(() => {
|
||||
state.value = 'visited';
|
||||
assert_equals(selectList.value, "one");
|
||||
selectList.value = "two";
|
||||
// The form is submitted in a timeout to make sure that a new back/forward list item is created.
|
||||
document.getElementById('form0').submit();
|
||||
}, 0);
|
||||
} else {
|
||||
// Went back to this page again, and the form state should be restored.
|
||||
assert_equals(selectList.value, "two");
|
||||
t.done();
|
||||
}
|
||||
}, 1);
|
||||
}, "Test restoring state after form submission");
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче