Revision 23ecf31d3486c72b4fda870b0a5b5de5340aafb9 authored by Timothy Gu on 19 October 2018, 20:46:11 UTC, committed by Chromium WPT Sync on 19 October 2018, 20:46:11 UTC
This change aligns document.open() with the current HTML Standard, which mandates that in addition to setting the document's URL to the last-entered document's, the document's current history item's URL must also be updated à la history.replaceState(). To accomplish that, this CL reuses the logic in History::StateObjectAdded(), including the throttling behavior, for Document::open() as well. The update steps are run unconditionally, no matter what the document's current URL is, in order to have consistent behavior for other things in the history entry like POST form data, which document.open() now erases. This also means that document.open() now also counts as a navigation, just like history.replaceState(). Several browsertests are updated as such. In this CL, we also enables some WPTs that were previously disabled; in particular, reload.window.html has been enabled to converge to WebKit's behavior. Bug: 68833, 866274 Change-Id: Iea6d665fd97bcaee44bcfaa45f8e92c356003d8a
1 parent 64fed93
errors-manual.html
<!DOCTYPE html>
<meta charset=utf-8>
<title>Entries API: Errors manual test</title>
<link rel=help href="https://wicg.github.io/entries-api">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support.js"></script>
<script>
entry_test((t, entry) => {
entry.getFile(
NOT_FOUND_PATHS[0],
{},
t.unreached_func('getFile should fail'),
t.step_func(error => {
assert_equals(typeof error.name, 'string', 'Error has name property');
assert_equals(typeof error.message, 'string', 'Error has message property');
assert_equals(error.name, 'NotFoundError', 'error is NotFoundError');
t.done();
}));
}, 'Errors - NotFoundError');
entry_test((t, entry) => {
entry.getFile(
DIR_PATHS[0],
{},
t.unreached_func('getFile should fail'),
t.step_func(error => {
assert_equals(typeof error.name, 'string', 'Error has name property');
assert_equals(typeof error.message, 'string', 'Error has message property');
assert_equals(error.name, 'TypeMismatchError', 'error is TypeMismatchError');
t.done();
}));
}, 'Errors - TypeMismatchError');
entry_test((t, entry) => {
entry.getFile(
FILE_PATHS[0],
{create: true},
t.unreached_func('getFile should fail'),
t.step_func(error => {
assert_equals(typeof error.name, 'string', 'Error has name property');
assert_equals(typeof error.message, 'string', 'Error has message property');
assert_equals(error.name, 'SecurityError', 'error is SecurityError');
t.done();
}));
}, 'Errors - SecurityError');
entry_test((t, entry) => {
const reader = entry.createReader();
reader.readEntries(() => {}, t.unreached_func('readEntries should succeed'));
reader.readEntries(
t.unreached_func('readEntries() should fail if already reading'),
t.step_func(error => {
assert_equals(typeof error.name, 'string', 'Error has name property');
assert_equals(typeof error.message, 'string', 'Error has message property');
assert_equals(error.name, 'InvalidStateError', 'error is InvalidStateError');
t.done();
}));
}, 'Errors - InvalidStateError');
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...