mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1475030 [wpt PR 11918] - Move web-platform-tests/html-imports/ into Blink's LayoutTests, a=testonly
Automatic update from web-platform-testsMove web-platform-tests/html-imports/ into Blink's LayoutTests As discussed on dom-dev: https://groups.google.com/a/chromium.org/d/msg/dom-dev/qfHM4fKckwk/nELu4mvaAwAJ There was already a hello.html + hello-parent.html in LayoutTests, so these are kept and already-in-import-map.html was tweaked slightly to use those instead. There was also an existing hello.css, which was different, but the test (import-attribute.html) doesn't depend on it. Change-Id: Ib97451ff33bae16a75a2c7c703a8bac270910e38 Reviewed-on: https://chromium-review.googlesource.com/1133161 Reviewed-by: Hayato Ito <hayato@chromium.org> Reviewed-by: Takayoshi Kochi <kochi@chromium.org> Commit-Queue: Philip Jägenstedt <foolip@chromium.org> Cr-Commit-Position: refs/heads/master@{#575207} -- wpt-commits: a270ae8074cbb78f568af90f511ff143cd7b3eec wpt-pr: 11918
This commit is contained in:
parent
77a6e8564f
commit
cae7459157
@ -276827,61 +276827,6 @@
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/META.yml": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/document/resources/body-only.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/document/resources/test-in-import.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/fetching/resources/async.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/fetching/resources/dynamic.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/fetching/resources/hello.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/fetching/resources/parent-of-hello.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/html-link-element/resources/body-only-0.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/html-link-element/resources/body-only-1.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/html-link-element/resources/body-only-2.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/html-link-element/resources/hello.css": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-longdesc/META.yml": [
|
||||
[
|
||||
{}
|
||||
@ -339794,30 +339739,6 @@
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/document/document-method-changes.html": [
|
||||
[
|
||||
"/html-imports/document/document-method-changes.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/fetching/already-in-import-map.html": [
|
||||
[
|
||||
"/html-imports/fetching/already-in-import-map.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/fetching/loading-attempt.html": [
|
||||
[
|
||||
"/html-imports/fetching/loading-attempt.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-imports/html-link-element/import-attribute.html": [
|
||||
[
|
||||
"/html-imports/html-link-element/import-attribute.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html-media-capture/capture_reflect.html": [
|
||||
[
|
||||
"/html-media-capture/capture_reflect.html",
|
||||
@ -573095,66 +573016,6 @@
|
||||
"51267d21c761c3ccaee34bc4d5e533e69d739bc5",
|
||||
"testharness"
|
||||
],
|
||||
"html-imports/META.yml": [
|
||||
"11323815db763cf9d0649abb86380139cf9c136c",
|
||||
"support"
|
||||
],
|
||||
"html-imports/document/document-method-changes.html": [
|
||||
"8a90989d87713f746a4a9d4d0d8c4816ba2beab3",
|
||||
"testharness"
|
||||
],
|
||||
"html-imports/document/resources/body-only.html": [
|
||||
"c3b2c7949a76a93f37d17ce9c73f9cbf409f71ae",
|
||||
"support"
|
||||
],
|
||||
"html-imports/document/resources/test-in-import.html": [
|
||||
"7a1e3187d5d622045131a4a983f269c141c6a504",
|
||||
"support"
|
||||
],
|
||||
"html-imports/fetching/already-in-import-map.html": [
|
||||
"ae688a3085030e42436256481111d4794102885e",
|
||||
"testharness"
|
||||
],
|
||||
"html-imports/fetching/loading-attempt.html": [
|
||||
"c2e55cc530dcf497e022b47aee69c81120bfdd45",
|
||||
"testharness"
|
||||
],
|
||||
"html-imports/fetching/resources/async.html": [
|
||||
"0c47a589bdeb3b284de1000849ec7a0387393732",
|
||||
"support"
|
||||
],
|
||||
"html-imports/fetching/resources/dynamic.html": [
|
||||
"dece37f1264025c6968b81252edf4ebc1f701adf",
|
||||
"support"
|
||||
],
|
||||
"html-imports/fetching/resources/hello.html": [
|
||||
"2c118b51566fc8dc7ecd6304e04d3b7ca5fa2244",
|
||||
"support"
|
||||
],
|
||||
"html-imports/fetching/resources/parent-of-hello.html": [
|
||||
"d824222626234a376b86edc75a8cd7bbf343111f",
|
||||
"support"
|
||||
],
|
||||
"html-imports/html-link-element/import-attribute.html": [
|
||||
"9cdfe3f3ab4dc09f3ba400921fcd2c02f5331da6",
|
||||
"testharness"
|
||||
],
|
||||
"html-imports/html-link-element/resources/body-only-0.html": [
|
||||
"29691598d52a661b961a3bdfaffeb410b5be37fa",
|
||||
"support"
|
||||
],
|
||||
"html-imports/html-link-element/resources/body-only-1.html": [
|
||||
"321d26a916eb54298c8e4f951c6a3f9b22f60524",
|
||||
"support"
|
||||
],
|
||||
"html-imports/html-link-element/resources/body-only-2.html": [
|
||||
"52a42561dc77affda708aff42e149880df55b4e9",
|
||||
"support"
|
||||
],
|
||||
"html-imports/html-link-element/resources/hello.css": [
|
||||
"fbbe647161c9b6994b36254a136e4eccd7d825e6",
|
||||
"support"
|
||||
],
|
||||
"html-longdesc/META.yml": [
|
||||
"0a540910326292561d9e3b31288db0f63ff5c904",
|
||||
"support"
|
||||
|
@ -1,2 +0,0 @@
|
||||
suggested_reviewers:
|
||||
- omo
|
@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>The import attribute</title>
|
||||
<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#interface-import">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<link id="importLink" rel="import" href="resources/body-only.html">
|
||||
<link rel="import" href="resources/test-in-import.html">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_throws('INVALID_STATE_ERR', function() { importLink.import.open(); }, 'document.open()');
|
||||
assert_throws('INVALID_STATE_ERR', function() { importLink.import.write('Hello'); }, 'document.write()');
|
||||
assert_throws('INVALID_STATE_ERR', function() { importLink.import.open(); }, 'document.close()');
|
||||
}, 'Throws an InvalidStateError exception if the Document is an import: From the master document');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,4 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body id="body-only">Hello</body>
|
||||
</html>
|
@ -1,13 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
test(function() {
|
||||
var doc = document.currentScript.ownerDocument;
|
||||
assert_throws('INVALID_STATE_ERR', function() { doc.open(); }, 'document.open()');
|
||||
assert_throws('INVALID_STATE_ERR', function() { doc.write('Hello'); }, 'document.write()');
|
||||
assert_throws('INVALID_STATE_ERR', function() { doc.open(); }, 'document.close()');
|
||||
}, 'Throws an InvalidStateError exception if the Document is an import: From an import');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,26 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Fetching import</title>
|
||||
<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#fetching-import">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<link id="first" rel="import" href="resources/hello.html">
|
||||
<link id="shouldBeInImportMap" rel="import" href="resources/hello.html">
|
||||
<link id="parentOfFirst" rel="import" href="resources/parent-of-hello.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true(window.first.import === window.shouldBeInImportMap.import);
|
||||
}, 'If LOCATION is already in the import map, let IMPORT be the imported document for LOCATION and stop. (1)');
|
||||
|
||||
test(function() {
|
||||
assert_true(window.first.import === window.parentOfFirst.import.getElementById('child').import);
|
||||
}, 'If LOCATION is already in the import map, let IMPORT be the imported document for LOCATION and stop. (2)');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,76 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Fetching import</title>
|
||||
<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#fetching-import">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script>
|
||||
var onloadWasCalledOnSuccess = false;
|
||||
var onerrorWasCalledOnSuccess = false;
|
||||
function helloLoadHandler() { onloadWasCalledOnSuccess = true; }
|
||||
function helloErrorHandler() { onerrorWasCalledOnSuccess = true; }
|
||||
|
||||
var onloadWasCalledOnFail = false;
|
||||
var onerrorWasCalledOnFail = false;
|
||||
function nosuchLoadHandler() { onloadWasCalledOnFail = true; }
|
||||
function nosuchErrorHandler() { onerrorWasCalledOnFail = true; }
|
||||
</script>
|
||||
|
||||
<link rel="import" href="resources/hello.html" onload="helloLoadHandler()" onerror="helloLoadHandler()">
|
||||
<link rel="import" href="resources/no-such.html" onload="nosuchLoadHandler()" onerror="nosuchErrorHandler()">
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true(onloadWasCalledOnSuccess);
|
||||
assert_false(onerrorWasCalledOnSuccess);
|
||||
}, 'The loading attempt must be considered successful if IMPORT is not null on the algorithm completion, and failed otherwise. (1)');
|
||||
|
||||
test(function() {
|
||||
assert_false(onloadWasCalledOnFail);
|
||||
assert_true(onerrorWasCalledOnFail);
|
||||
}, 'The loading attempt must be considered successful if IMPORT is not null on the algorithm completion, and failed otherwise. (2)');
|
||||
|
||||
t1 = async_test('The loading attempt must be considered successful if IMPORT is not null on the algorithm completion, and failed otherwise. (3)')
|
||||
t1.step(function() {
|
||||
var importElement = document.createElement('link');
|
||||
importElement.setAttribute('rel', 'import');
|
||||
importElement.setAttribute('href', 'resources/dynamic.html');
|
||||
importElement.addEventListener("error", assert_unreached);
|
||||
importElement.addEventListener("load", function() {
|
||||
t1.done();
|
||||
});
|
||||
|
||||
document.head.appendChild(importElement);
|
||||
});
|
||||
|
||||
var onloadWasCalledOnAsync = false;
|
||||
var onerrorWasCalledOnAsync = false;
|
||||
var asyncAttemptDone = function() { assert_unreached(); };
|
||||
|
||||
function asyncLoadHandler() {
|
||||
onloadWasCalledOnAsync = true;
|
||||
asyncAttemptDone();
|
||||
}
|
||||
function asyncErrorHandler() {
|
||||
onerrorWasCalledOnAsync = true;
|
||||
asyncAttemptDone();
|
||||
}
|
||||
|
||||
t2 = async_test('Every import that is not marked as async delays the load event in the Document.');
|
||||
asyncAttemptDone = function() {
|
||||
t2.step(function() {
|
||||
assert_true(onloadWasCalledOnAsync);
|
||||
assert_false(onerrorWasCalledOnAsync);
|
||||
t2.done();
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<link rel="import" href="resources/async.html" onload="asyncLoadHandler()" onerror="asyncErrorHandler()" async>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
</body>
|
||||
</html>
|
@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<body>Async</body>
|
@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<body>Dyamic</body>
|
@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<body>Hello</body>
|
@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<link id="child" rel="import" href="hello.html">
|
@ -1,43 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>The import attribute</title>
|
||||
<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#interface-import">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<link id="nonImportLink" rel="stylesheet" href="resources/hello.css">
|
||||
<link id="goOutFromDocument" rel="import" href="resources/body-only-0.html">
|
||||
<link id="importLink" rel="import" href="resources/body-only-1.html">
|
||||
<link id="anotherImportLink" rel="import" href="resources/body-only-2.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(nonImportLink.import, null);
|
||||
}, 'The import attribute must return null if the link does not represent an import.');
|
||||
|
||||
test(function() {
|
||||
var link = goOutFromDocument;
|
||||
assert_true(link.import != null);
|
||||
document.head.removeChild(link);
|
||||
assert_equals(link.import, null);
|
||||
}, 'The import attribute must return null if the link element is not in a Document.');
|
||||
|
||||
test(function() {
|
||||
assert_equals(importLink.import.body.id, 'body-only-1');
|
||||
}, 'The attribute must return the imported document for the import.');
|
||||
|
||||
test(function() {
|
||||
var importA = importLink.import;
|
||||
var importB = document.querySelector('#importLink').import;
|
||||
var anotherImport = document.querySelector('#anotherImportLink').import;
|
||||
assert_true(importA === importB);
|
||||
assert_true(importA !== anotherImport);
|
||||
}, 'The same object must be returned each time.');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,4 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body id="body-only-0">Hello</body>
|
||||
</html>
|
@ -1,4 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body id="body-only-1">Hello</body>
|
||||
</html>
|
@ -1,4 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body id="body-only-2">Hello</body>
|
||||
</html>
|
@ -1,3 +0,0 @@
|
||||
h1 {
|
||||
color: red;
|
||||
}
|
Loading…
Reference in New Issue
Block a user