mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #7376 - servo:wpt_20150826, r=Ms2ger
Update web-platform-tests to revision acd60f9e55532f03fc905e61591b7fd7db2f08d1 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7376) <!-- Reviewable:end -->
This commit is contained in:
commit
e1122313f9
44 changed files with 544 additions and 663 deletions
|
@ -1049,6 +1049,10 @@
|
|||
"path": "screen-orientation/page-visibility-manual.html",
|
||||
"url": "/screen-orientation/page-visibility-manual.html"
|
||||
},
|
||||
{
|
||||
"path": "selection/dir-manual.html",
|
||||
"url": "/selection/dir-manual.html"
|
||||
},
|
||||
{
|
||||
"path": "svg/import/animate-dom-01-f-manual.svg",
|
||||
"url": "/svg/import/animate-dom-01-f-manual.svg"
|
||||
|
@ -12203,22 +12207,6 @@
|
|||
"path": "ambient-light/idlharness.html",
|
||||
"url": "/ambient-light/idlharness.html"
|
||||
},
|
||||
{
|
||||
"path": "animation-timing/callback-invoked.html",
|
||||
"url": "/animation-timing/callback-invoked.html"
|
||||
},
|
||||
{
|
||||
"path": "animation-timing/cancel-invoked.html",
|
||||
"url": "/animation-timing/cancel-invoked.html"
|
||||
},
|
||||
{
|
||||
"path": "animation-timing/idlharness.html",
|
||||
"url": "/animation-timing/idlharness.html"
|
||||
},
|
||||
{
|
||||
"path": "animation-timing/same-dispatch-time.html",
|
||||
"url": "/animation-timing/same-dispatch-time.html"
|
||||
},
|
||||
{
|
||||
"path": "battery-status/battery-interface-idlharness.html",
|
||||
"url": "/battery-status/battery-interface-idlharness.html"
|
||||
|
@ -15475,6 +15463,10 @@
|
|||
"path": "html/dom/elements/global-attributes/the-translate-attribute-012.html",
|
||||
"url": "/html/dom/elements/global-attributes/the-translate-attribute-012.html"
|
||||
},
|
||||
{
|
||||
"path": "html/editing/activation/click.html",
|
||||
"url": "/html/editing/activation/click.html"
|
||||
},
|
||||
{
|
||||
"path": "html/editing/dnd/dom/draggable.html",
|
||||
"url": "/html/editing/dnd/dom/draggable.html"
|
||||
|
@ -17843,6 +17835,26 @@
|
|||
"path": "html/syntax/serializing-html-fragments/outerHTML.html",
|
||||
"url": "/html/syntax/serializing-html-fragments/outerHTML.html"
|
||||
},
|
||||
{
|
||||
"path": "html/webappapis/animation-frames/callback-exception.html",
|
||||
"url": "/html/webappapis/animation-frames/callback-exception.html"
|
||||
},
|
||||
{
|
||||
"path": "html/webappapis/animation-frames/callback-invoked.html",
|
||||
"url": "/html/webappapis/animation-frames/callback-invoked.html"
|
||||
},
|
||||
{
|
||||
"path": "html/webappapis/animation-frames/cancel-invoked.html",
|
||||
"url": "/html/webappapis/animation-frames/cancel-invoked.html"
|
||||
},
|
||||
{
|
||||
"path": "html/webappapis/animation-frames/idlharness.html",
|
||||
"url": "/html/webappapis/animation-frames/idlharness.html"
|
||||
},
|
||||
{
|
||||
"path": "html/webappapis/animation-frames/same-dispatch-time.html",
|
||||
"url": "/html/webappapis/animation-frames/same-dispatch-time.html"
|
||||
},
|
||||
{
|
||||
"path": "html/webappapis/atob/base64.html",
|
||||
"url": "/html/webappapis/atob/base64.html"
|
||||
|
@ -24987,10 +24999,6 @@
|
|||
"path": "selection/deleteFromDocument.html",
|
||||
"url": "/selection/deleteFromDocument.html"
|
||||
},
|
||||
{
|
||||
"path": "selection/dir.manual.html",
|
||||
"url": "/selection/dir.manual.html"
|
||||
},
|
||||
{
|
||||
"path": "selection/extend.html",
|
||||
"url": "/selection/extend.html"
|
||||
|
@ -25139,10 +25147,6 @@
|
|||
"path": "shadow-dom/elements-and-dom-objects/the-content-html-element/test-003.html",
|
||||
"url": "/shadow-dom/elements-and-dom-objects/the-content-html-element/test-003.html"
|
||||
},
|
||||
{
|
||||
"path": "shadow-dom/elements-and-dom-objects/the-content-html-element/test-004.html",
|
||||
"url": "/shadow-dom/elements-and-dom-objects/the-content-html-element/test-004.html"
|
||||
},
|
||||
{
|
||||
"path": "shadow-dom/elements-and-dom-objects/the-content-html-element/test-005.html",
|
||||
"url": "/shadow-dom/elements-and-dom-objects/the-content-html-element/test-005.html"
|
||||
|
@ -25159,10 +25163,6 @@
|
|||
"path": "shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-002.html",
|
||||
"url": "/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-002.html"
|
||||
},
|
||||
{
|
||||
"path": "shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003.html",
|
||||
"url": "/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-003.html"
|
||||
},
|
||||
{
|
||||
"path": "shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-004.html",
|
||||
"url": "/shadow-dom/elements-and-dom-objects/the-shadow-html-element/test-004.html"
|
||||
|
@ -25671,6 +25671,10 @@
|
|||
"path": "webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html",
|
||||
"url": "/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html"
|
||||
},
|
||||
{
|
||||
"path": "webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html",
|
||||
"url": "/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html"
|
||||
},
|
||||
{
|
||||
"path": "webgl/bufferSubData.html",
|
||||
"url": "/webgl/bufferSubData.html"
|
||||
|
@ -27555,6 +27559,10 @@
|
|||
"path": "workers/semantics/encodings/004.html",
|
||||
"url": "/workers/semantics/encodings/004.html"
|
||||
},
|
||||
{
|
||||
"path": "workers/semantics/encodings/004.worker.js",
|
||||
"url": "/workers/semantics/encodings/004.worker"
|
||||
},
|
||||
{
|
||||
"path": "workers/semantics/interface-objects/001.worker.js",
|
||||
"url": "/workers/semantics/interface-objects/001.worker"
|
||||
|
@ -29097,14 +29105,7 @@
|
|||
]
|
||||
},
|
||||
"local_changes": {
|
||||
"deleted": [
|
||||
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-002.html",
|
||||
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-006.html",
|
||||
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-004.html",
|
||||
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-003.html",
|
||||
"2dcontext/transformations/canvas_transformations_reset_001.htm",
|
||||
"shadow-dom/shadow-trees/hosting-multiple-shadow-trees-005.html"
|
||||
],
|
||||
"deleted": [],
|
||||
"items": {},
|
||||
"reftest_nodes": {}
|
||||
},
|
||||
|
@ -34582,7 +34583,7 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"rev": "58133dd71b16037669a0aa011b2afd448b52d434",
|
||||
"rev": "acd60f9e55532f03fc905e61591b7fd7db2f08d1",
|
||||
"url_base": "/",
|
||||
"version": 2
|
||||
}
|
|
@ -9,3 +9,15 @@
|
|||
[XMLHttpRequest: send() - charset parameter of Content-Type 6]
|
||||
expected: FAIL
|
||||
|
||||
[charset given but wrong, fix it (unknown MIME, bogus charset)]
|
||||
expected: FAIL
|
||||
|
||||
[charset given but wrong, fix it (known MIME, bogus charset)]
|
||||
expected: FAIL
|
||||
|
||||
[charset given but wrong, fix it (known MIME, actual charset)]
|
||||
expected: FAIL
|
||||
|
||||
[If multiple charset parameters are given, all should be rewritten]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
[Document.currentScript.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Script script-window-error]
|
||||
expected: FAIL
|
||||
|
||||
[Script script-svg]
|
||||
expected: NOTRUN
|
||||
|
|
@ -5,3 +5,4 @@
|
|||
|
||||
[document.forms iteration]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -8978,3 +8978,4 @@
|
|||
|
||||
[HTMLOptionElement interface: new Option() must inherit property "index" with the proper type (7)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[callback-exception.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[requestAnimationFrame callback exceptions are reported to error handler]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -1 +1 @@
|
|||
84c4a26e4d05015da4cbbf1f120b317a23bec0b4
|
||||
a1cd27e6a3b961129fd4710513cc29e4f7c9cc67
|
|
@ -924,3 +924,12 @@
|
|||
[Parsing: <sc:\\../> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <file:...> against <http://www.example.com/test>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <file:..> against <http://www.example.com/test>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <file:a> against <http://www.example.com/test>]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[url-constructor.html]
|
||||
type: testharness
|
||||
expected: CRASH
|
||||
[Parsing: <http://f:999999/c> against <http://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -56,3 +56,4 @@
|
|||
|
||||
[CloseEvent interface: existence and properties of interface prototype object]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[004.worker]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
|
@ -166,7 +166,7 @@ The way to contribute is just as usual:
|
|||
* Fork this repository (and make sure you're still relatively in sync
|
||||
with it if you forked a while ago).
|
||||
* Create a branch for your changes:
|
||||
`git checkout -b your-name/topic`.
|
||||
`git checkout -b topic`.
|
||||
* Make your changes.
|
||||
* Run the lint script described below.
|
||||
* Commit locally and push that to your repo.
|
||||
|
|
59
tests/wpt/web-platform-tests/XMLHttpRequest/send-content-type-charset.htm
Normal file → Executable file
59
tests/wpt/web-platform-tests/XMLHttpRequest/send-content-type-charset.htm
Normal file → Executable file
|
@ -10,7 +10,8 @@
|
|||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function request(input, output) {
|
||||
function request(input, output, title) {
|
||||
title = title || document.title + ' - ' + input;
|
||||
test(function() {
|
||||
var client = new XMLHttpRequest()
|
||||
client.open("POST", "resources/content.py", false)
|
||||
|
@ -19,39 +20,63 @@
|
|||
client.send("TEST")
|
||||
assert_equals(client.responseText, "TEST")
|
||||
assert_equals(client.getResponseHeader("x-request-content-type"), output)
|
||||
})
|
||||
}, title)
|
||||
}
|
||||
request(
|
||||
"text/x-pink-unicorn; charset=windows-1252; charset=bogus; notrelated; charset=ascii",
|
||||
"text/x-pink-unicorn; charset=UTF-8; charset=UTF-8; notrelated; charset=UTF-8"
|
||||
)
|
||||
|
||||
request(
|
||||
"text; charset=ascii",
|
||||
"text; charset=ascii"
|
||||
"text; charset=ascii",
|
||||
"header with invalid MIME type is not changed"
|
||||
)
|
||||
request(
|
||||
"charset=ascii",
|
||||
"charset=ascii"
|
||||
"charset=ascii",
|
||||
"known charset but bogus header - missing MIME type"
|
||||
)
|
||||
request(
|
||||
"text/x-thepiano;charset= waddup",
|
||||
"text/x-thepiano;charset=UTF-8"
|
||||
)
|
||||
request(
|
||||
"text/x-pink-unicorn",
|
||||
"text/x-pink-unicorn"
|
||||
"charset=bogus",
|
||||
"charset=bogus",
|
||||
"bogus charset and bogus header - missing MIME type"
|
||||
)
|
||||
request(
|
||||
"text/plain;charset=utf-8",
|
||||
"text/plain;charset=utf-8"
|
||||
"text/plain;charset=utf-8",
|
||||
"Correct text/plain MIME with charset"
|
||||
)
|
||||
request(
|
||||
"text/x-pink-unicorn",
|
||||
"text/x-pink-unicorn",
|
||||
"If no charset= param is given, implementation should not add one - unknown MIME"
|
||||
)
|
||||
request(
|
||||
"text/plain",
|
||||
"text/plain",
|
||||
"If no charset= param is given, implementation should not add one - known MIME"
|
||||
)
|
||||
request(
|
||||
"text/x-thepiano;charset= waddup",
|
||||
"text/x-thepiano;charset=UTF-8",
|
||||
"charset given but wrong, fix it (unknown MIME, bogus charset)"
|
||||
)
|
||||
request( /**/
|
||||
"text/plain;charset=utf-8;charset=waddup",
|
||||
"text/plain;charset=UTF-8;charset=UTF-8"
|
||||
"text/plain;charset=UTF-8;charset=UTF-8",
|
||||
"charset given but wrong, fix it (known MIME, bogus charset)"
|
||||
)
|
||||
request(
|
||||
"text/plain;charset=shift-jis",
|
||||
"text/plain;charset=UTF-8",
|
||||
"charset given but wrong, fix it (known MIME, actual charset)"
|
||||
)
|
||||
request(
|
||||
"text/x-pink-unicorn; charset=windows-1252; charset=bogus; notrelated; charset=ascii",
|
||||
"text/x-pink-unicorn; charset=UTF-8; charset=UTF-8; notrelated; charset=UTF-8",
|
||||
"If multiple charset parameters are given, all should be rewritten"
|
||||
)
|
||||
request(
|
||||
null,
|
||||
"text/plain;charset=UTF-8"
|
||||
"text/plain;charset=UTF-8",
|
||||
"No content type set, give MIME and charset"
|
||||
)
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -129,7 +129,7 @@ var commandTests = {
|
|||
indent: [],
|
||||
insertHorizontalRule: ["id"],
|
||||
insertHTML: ["<b>hi</b>"],
|
||||
insertImage: ["http://example.com/some-image"],
|
||||
insertImage: ["../images/green.png"],
|
||||
insertLineBreak: [],
|
||||
insertOrderedList: [],
|
||||
insertParagraph: [],
|
||||
|
|
|
@ -7,39 +7,185 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var expected = [
|
||||
"parse-inline",
|
||||
"parse-ext",
|
||||
"dom-inline",
|
||||
"dom-ext",
|
||||
];
|
||||
var tests = {};
|
||||
expected.forEach(function(id) {
|
||||
tests[id] = async_test("Script " + id);
|
||||
var data = {
|
||||
"parse-inline" : [],
|
||||
"parse-ext" : [],
|
||||
"dom-inline" : [],
|
||||
"dom-ext" : [],
|
||||
"nested" : ["nested-outer","nested-inner","nested-outer"],
|
||||
"script-exec" : ["script-exec-before-after","script-exec-before-after"],
|
||||
"script-load-error" : [null],
|
||||
"script-window-error" : ["script-error-compile","script-error-runtime"],
|
||||
"timeout" : [null],
|
||||
"eval" : [],
|
||||
"xhr-test" : [],
|
||||
"script-svg" : [],
|
||||
"script-async" : [],
|
||||
"script-defer" : []
|
||||
};
|
||||
|
||||
var expected = {};
|
||||
var actual = {};
|
||||
|
||||
Object.keys(data).forEach(function(id) {
|
||||
var test_expected = data[id];
|
||||
if(test_expected.length == 0) {
|
||||
test_expected = [id];
|
||||
}
|
||||
expected[id] = test_expected;
|
||||
actual[id] = [];
|
||||
});
|
||||
function verifyScript(id) {
|
||||
|
||||
var tests = {};
|
||||
setup({allow_uncaught_exception : true});
|
||||
|
||||
Object.keys(expected).forEach(function(id) {
|
||||
var testmsg = "Script " + id;
|
||||
tests[id] = async_test(testmsg);
|
||||
});
|
||||
|
||||
function verify(id) {
|
||||
tests[id].step(function() {
|
||||
assert_equals(document.currentScript, document.getElementById(id));
|
||||
this.done();
|
||||
});
|
||||
actual[id].push(document.currentScript);
|
||||
})
|
||||
}
|
||||
|
||||
function finish(id) {
|
||||
tests[id].step(function() {
|
||||
assert_array_equals(actual[id],expected[id].map(function(id) {
|
||||
return document.getElementById(id);
|
||||
}));
|
||||
this.done();
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Test parser inserted scripts -->
|
||||
<script id="parse-inline">
|
||||
verifyScript("parse-inline");
|
||||
verify('parse-inline');
|
||||
finish('parse-inline')
|
||||
</script>
|
||||
<script id="parse-ext" src="data:text/plain,verifyScript('parse-ext');"></script>
|
||||
<script id="parse-ext" src="data:text/plain,verify('parse-ext')"></script>
|
||||
<script>finish('parse-ext');</script>
|
||||
|
||||
<!-- Test DOM inserted scripts -->
|
||||
<script>
|
||||
var s = document.createElement("script");
|
||||
s.textContent = "verifyScript('dom-inline');";
|
||||
s.textContent = "verify('dom-inline');";
|
||||
s.id = "dom-inline";
|
||||
document.body.appendChild(s);
|
||||
finish('dom-inline');
|
||||
|
||||
s = document.createElement("script");
|
||||
s.src = "data:text/plain,verifyScript('dom-ext');";
|
||||
s.src = "data:text/plain,verify('dom-ext');";
|
||||
s.id = "dom-ext";
|
||||
s.onload = function() {
|
||||
finish('dom-ext');
|
||||
}
|
||||
document.body.appendChild(s);
|
||||
</script>
|
||||
|
||||
<!-- Test Nested scripts -->
|
||||
<script id="nested-outer">
|
||||
verify("nested");
|
||||
var s = document.createElement("script");
|
||||
s.textContent = "verify('nested')";
|
||||
s.id = "nested-inner";
|
||||
document.body.appendChild(s);
|
||||
verify("nested");
|
||||
finish('nested');
|
||||
</script>
|
||||
|
||||
<!-- Test beforescriptexecute and afterscriptexecute -->
|
||||
<script id="script-exec-before-after">
|
||||
function verifyScriptExec(e) {
|
||||
verify('script-exec');
|
||||
}
|
||||
|
||||
document.addEventListener('beforescriptexecute', verifyScriptExec, false);
|
||||
document.addEventListener('afterscriptexecute', verifyScriptExec, false);
|
||||
|
||||
var s = document.createElement("script");
|
||||
s.id = "script-exec-test";
|
||||
s.textContent = "function nop() { return false }";
|
||||
document.body.appendChild(s);
|
||||
|
||||
document.removeEventListener('beforescriptexecute', verifyScriptExec);
|
||||
document.removeEventListener('afterscriptexecute', verifyScriptExec);
|
||||
|
||||
finish('script-exec');
|
||||
</script>
|
||||
|
||||
<!-- Test script load error event listener -->
|
||||
<script>
|
||||
function testLoadFail() {
|
||||
verify('script-load-error');
|
||||
finish('script-load-error');
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="http://some.nonexistant.test/fail" id="script-load-error" onerror="testLoadFail()">
|
||||
</script>
|
||||
|
||||
<!-- Test for runtime and compile time errors -->
|
||||
<script>
|
||||
window.onerror = function() {
|
||||
verify('script-window-error');
|
||||
}
|
||||
|
||||
var s = document.createElement("script");
|
||||
s.id = "script-error-compile";
|
||||
s.textContent = "{";
|
||||
document.body.appendChild(s);
|
||||
|
||||
window.onerror = function() {
|
||||
verify('script-window-error');
|
||||
}
|
||||
|
||||
s = document.createElement("script");
|
||||
s.id = "script-error-runtime";
|
||||
s.textContent = "undefinedfn();";
|
||||
document.body.appendChild(s);
|
||||
|
||||
finish('script-window-error');
|
||||
</script>
|
||||
|
||||
<!-- Verify in setTimeout -->
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
verify('timeout');
|
||||
finish('timeout');
|
||||
},0);
|
||||
</script>
|
||||
|
||||
<!-- Verify in eval -->
|
||||
<script id="eval">
|
||||
eval('verify("eval")');
|
||||
finish("eval");
|
||||
</script>
|
||||
|
||||
<!-- Verify in synchronous xhr -->
|
||||
<script id="xhr-test">
|
||||
var request = new XMLHttpRequest();
|
||||
request.open('GET','/',false);
|
||||
request.send(null);
|
||||
|
||||
if(request.status === 200) {
|
||||
verify('xhr-test');
|
||||
finish('xhr-test');
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Testing script within svg -->
|
||||
<svg>
|
||||
<script id="script-svg">
|
||||
verify('script-svg');
|
||||
finish('script-svg');
|
||||
</script>
|
||||
</svg>
|
||||
|
||||
<!-- Test script async and defer -->
|
||||
<script id='script-async' async src='data:text/plain,verify("script-async"),finish("script-async")'></script>
|
||||
|
||||
<script id='script-defer' defer src='data:text/plain,verify("script-defer"),finish("script-defer")'></script>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>HTMLElement#click</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var element = document.createElement("div");
|
||||
var received = false;
|
||||
element.addEventListener("click", this.step_func(function(e) {
|
||||
received = true;
|
||||
assert_false(e.isTrusted, "Event should not be trusted")
|
||||
}));
|
||||
element.click();
|
||||
assert_true(received, "click event should have been dispatched synchronously");
|
||||
})
|
||||
</script>
|
|
@ -25,6 +25,10 @@
|
|||
var base = document.createElement("base");
|
||||
base.setAttribute("href", "/foo/bar");
|
||||
document.head.appendChild(base);
|
||||
t1.add_cleanup(function () {
|
||||
document.head.removeChild(base);
|
||||
});
|
||||
|
||||
assert_resolve_url(document, location.href.replace(location.pathname, "/foo"));
|
||||
assert_equals(document.baseURI, base.href, "The document base URL should be URL of the first base element that has an href attribute.");
|
||||
});
|
||||
|
@ -55,10 +59,10 @@
|
|||
var iframe = document.createElement("iframe");
|
||||
iframe.onload = this.step_func_done(function () {
|
||||
var doc = iframe.contentDocument;
|
||||
var base = doc.body.appendChild(document.createElement("base"));
|
||||
var base = doc.body.appendChild(doc.createElement("base"));
|
||||
base.href = "sub/";
|
||||
assert_resolve_url(doc, location.href.replace("/document-base-url.html", "/sub"));
|
||||
assert_equals(doc.baseURI, document.baseURI);
|
||||
assert_equals(doc.baseURI, document.baseURI.replace("/document-base-url.html", "/sub/"));
|
||||
});
|
||||
iframe.setAttribute("src", "about:blank");
|
||||
document.body.appendChild(iframe);
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>requestAnimationFrame callback exception reported to error handler</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://w3c.github.io/web-performance/specs/RequestAnimationFrame/Overview.html#dom-windowanimationtiming-requestanimationframe"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var custom_exception = 'requestAnimationFrameException';
|
||||
setup({allow_uncaught_exception : true});
|
||||
async_test(function (t) {
|
||||
addEventListener("error",function(e) {
|
||||
t.step(function() {
|
||||
assert_equals(e.error.message, custom_exception);
|
||||
t.done();
|
||||
})
|
||||
});
|
||||
window.requestAnimationFrame(function () {
|
||||
throw new Error(custom_exception);
|
||||
});
|
||||
}, "requestAnimationFrame callback exceptions are reported to error handler");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -15,12 +15,12 @@
|
|||
var manifestFilenameB = subType + "/test-v-128k-320x240-30fps-10kfr-manifest.json";
|
||||
|
||||
var expectationsA = {
|
||||
webm: "{ [0.000, 2.022) }",
|
||||
webm: "{ [0.000, 2.023) }",
|
||||
mp4: "{ [0.000, 2.043) }",
|
||||
};
|
||||
|
||||
var expectationsB = {
|
||||
webm: "{ [0.000, 2.000) }",
|
||||
webm: "{ [0.000, 2.001) }",
|
||||
mp4: "{ [0.000, 2.000) }",
|
||||
};
|
||||
|
||||
|
@ -99,7 +99,7 @@
|
|||
test.waitForExpectedEvents(function()
|
||||
{
|
||||
var expectationsAV = {
|
||||
webm: ["{ [0.000, 2.003) }", "{ [0.000, 2.022) }"],
|
||||
webm: ["{ [0.000, 2.003) }", "{ [0.000, 2.023) }"],
|
||||
mp4: ["{ [0.000, 2.000) }", "{ [0.000, 2.043) }"],
|
||||
};
|
||||
|
||||
|
|
|
@ -32,132 +32,69 @@ function assert_promise_rejects(promise, code, description) {
|
|||
});
|
||||
}
|
||||
|
||||
// Asserts that two objects |actual| and |expected| are weakly equal under the
|
||||
// following definition:
|
||||
// Helper for testing with Headers objects. Compares Headers instances
|
||||
// by serializing |expected| and |actual| to arrays and comparing.
|
||||
function assert_header_equals(actual, expected, description) {
|
||||
assert_class_string(actual, "Headers", description);
|
||||
var header, actual_headers = [], expected_headers = [];
|
||||
for (header of actual)
|
||||
actual_headers.push(header[0] + ": " + header[1]);
|
||||
for (header of expected)
|
||||
expected_headers.push(header[0] + ": " + header[1]);
|
||||
assert_array_equals(actual_headers, expected_headers,
|
||||
description + " Headers differ.");
|
||||
}
|
||||
|
||||
// Helper for testing with Response objects. Compares simple
|
||||
// attributes defined on the interfaces, as well as the headers. It
|
||||
// does not compare the response bodies.
|
||||
function assert_response_equals(actual, expected, description) {
|
||||
assert_class_string(actual, "Response", description);
|
||||
["type", "url", "status", "ok", "statusText"].forEach(function(attribute) {
|
||||
assert_equals(actual[attribute], expected[attribute],
|
||||
description + " Attributes differ: " + attribute + ".");
|
||||
});
|
||||
assert_header_equals(actual.headers, expected.headers, description);
|
||||
}
|
||||
|
||||
// Assert that the two arrays |actual| and |expected| contain the same
|
||||
// set of Responses as determined by assert_response_equals. The order
|
||||
// is not significant.
|
||||
//
|
||||
// |a| and |b| are weakly equal if any of the following are true:
|
||||
// 1. If |a| is not an 'object', and |a| === |b|.
|
||||
// 2. If |a| is an 'object', and all of the following are true:
|
||||
// 2.1 |a.p| is weakly equal to |b.p| for all own properties |p| of |a|.
|
||||
// 2.2 Every own property of |b| is an own property of |a|.
|
||||
//
|
||||
// This is a replacement for the the version of assert_object_equals() in
|
||||
// testharness.js. The latter doesn't handle own properties correctly. I.e. if
|
||||
// |a.p| is not an own property, it still requires that |b.p| be an own
|
||||
// property.
|
||||
//
|
||||
// Note that |actual| must not contain cyclic references.
|
||||
self.assert_object_equals = function(actual, expected, description) {
|
||||
var object_stack = [];
|
||||
// |expected| is assumed to not contain any duplicates.
|
||||
function assert_response_array_equivalent(actual, expected, description) {
|
||||
assert_true(Array.isArray(actual), description);
|
||||
assert_equals(actual.length, expected.length, description);
|
||||
expected.forEach(function(expected_element) {
|
||||
// assert_response_in_array treats the first argument as being
|
||||
// 'actual', and the second as being 'expected array'. We are
|
||||
// switching them around because we want to be resilient
|
||||
// against the |actual| array containing duplicates.
|
||||
assert_response_in_array(expected_element, actual, description);
|
||||
});
|
||||
}
|
||||
|
||||
function _is_equal(actual, expected, prefix) {
|
||||
if (typeof actual !== 'object') {
|
||||
assert_equals(actual, expected, prefix);
|
||||
return;
|
||||
}
|
||||
assert_true(typeof expected === 'object', prefix);
|
||||
assert_equals(object_stack.indexOf(actual), -1,
|
||||
prefix + ' must not contain cyclic references.');
|
||||
// Asserts that two arrays |actual| and |expected| contain the same
|
||||
// set of Responses as determined by assert_response_equals(). The
|
||||
// corresponding elements must occupy corresponding indices in their
|
||||
// respective arrays.
|
||||
function assert_response_array_equals(actual, expected, description) {
|
||||
assert_true(Array.isArray(actual), description);
|
||||
assert_equals(actual.length, expected.length, description);
|
||||
actual.forEach(function(value, index) {
|
||||
assert_response_equals(value, expected[index],
|
||||
description + " : object[" + index + "]");
|
||||
});
|
||||
}
|
||||
|
||||
object_stack.push(actual);
|
||||
|
||||
Object.getOwnPropertyNames(expected).forEach(function(property) {
|
||||
assert_own_property(actual, property, prefix);
|
||||
_is_equal(actual[property], expected[property],
|
||||
prefix + '.' + property);
|
||||
});
|
||||
Object.getOwnPropertyNames(actual).forEach(function(property) {
|
||||
assert_own_property(expected, property, prefix);
|
||||
});
|
||||
|
||||
object_stack.pop();
|
||||
}
|
||||
|
||||
function _brand(object) {
|
||||
return Object.prototype.toString.call(object).match(/^\[object (.*)\]$/)[1];
|
||||
}
|
||||
|
||||
_is_equal(actual, expected,
|
||||
(description ? description + ': ' : '') + _brand(expected));
|
||||
};
|
||||
|
||||
// Equivalent to assert_in_array, but uses a weaker equivalence relation
|
||||
// (assert_object_equals) than '==='.
|
||||
function assert_object_in_array(actual, expected_array, description) {
|
||||
assert_true(expected_array.some(function(element) {
|
||||
try {
|
||||
assert_object_equals(actual, element);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
// Equivalent to assert_in_array, but uses assert_response_equals.
|
||||
function assert_response_in_array(actual, expected_array, description) {
|
||||
assert_true(expected_array.some(function(element) {
|
||||
try {
|
||||
assert_response_equals(actual, element);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}), description);
|
||||
}
|
||||
|
||||
// Assert that the two arrays |actual| and |expected| contain the same set of
|
||||
// elements as determined by assert_object_equals. The order is not significant.
|
||||
//
|
||||
// |expected| is assumed to not contain any duplicates as determined by
|
||||
// assert_object_equals().
|
||||
function assert_array_equivalent(actual, expected, description) {
|
||||
assert_true(Array.isArray(actual), description);
|
||||
assert_equals(actual.length, expected.length, description);
|
||||
expected.forEach(function(expected_element) {
|
||||
// assert_in_array treats the first argument as being 'actual', and the
|
||||
// second as being 'expected array'. We are switching them around because
|
||||
// we want to be resilient against the |actual| array containing
|
||||
// duplicates.
|
||||
assert_object_in_array(expected_element, actual, description);
|
||||
});
|
||||
}
|
||||
|
||||
// Asserts that two arrays |actual| and |expected| contain the same set of
|
||||
// elements as determined by assert_object_equals(). The corresponding elements
|
||||
// must occupy corresponding indices in their respective arrays.
|
||||
function assert_array_objects_equals(actual, expected, description) {
|
||||
assert_true(Array.isArray(actual), description);
|
||||
assert_equals(actual.length, expected.length, description);
|
||||
actual.forEach(function(value, index) {
|
||||
assert_object_equals(value, expected[index],
|
||||
description + ' : object[' + index + ']');
|
||||
});
|
||||
}
|
||||
|
||||
// Asserts that |object| that is an instance of some interface has the attribute
|
||||
// |attribute_name| following the conditions specified by WebIDL, but it's
|
||||
// acceptable that the attribute |attribute_name| is an own property of the
|
||||
// object because we're in the middle of moving the attribute to a prototype
|
||||
// chain. Once we complete the transition to prototype chains,
|
||||
// assert_will_be_idl_attribute must be replaced with assert_idl_attribute
|
||||
// defined in testharness.js.
|
||||
//
|
||||
// FIXME: Remove assert_will_be_idl_attribute once we complete the transition
|
||||
// of moving the DOM attributes to prototype chains. (http://crbug.com/43394)
|
||||
function assert_will_be_idl_attribute(object, attribute_name, description) {
|
||||
assert_true(typeof object === "object", description);
|
||||
|
||||
assert_true("hasOwnProperty" in object, description);
|
||||
|
||||
// Do not test if |attribute_name| is not an own property because
|
||||
// |attribute_name| is in the middle of the transition to a prototype
|
||||
// chain. (http://crbug.com/43394)
|
||||
|
||||
assert_true(attribute_name in object, description);
|
||||
}
|
||||
|
||||
// Stringifies a DOM object. This function stringifies not only own properties
|
||||
// but also DOM attributes which are on a prototype chain. Note that
|
||||
// JSON.stringify only stringifies own properties.
|
||||
function stringifyDOMObject(object)
|
||||
{
|
||||
function deepCopy(src) {
|
||||
if (typeof src != "object")
|
||||
return src;
|
||||
var dst = Array.isArray(src) ? [] : {};
|
||||
for (var property in src) {
|
||||
dst[property] = deepCopy(src[property]);
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
return JSON.stringify(deepCopy(object));
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ var vary_entries = [
|
|||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.matchAll('not-present-in-the-cache')
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result, [],
|
||||
'Cache.matchAll should resolve with an empty array on failure.');
|
||||
});
|
||||
|
@ -126,23 +126,23 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.matchAll(entries.a.request.url)
|
||||
.then(function(result) {
|
||||
assert_array_objects_equals(result, [entries.a.response],
|
||||
'Cache.matchAll should match by URL.');
|
||||
assert_response_array_equals(result, [entries.a.response],
|
||||
'Cache.matchAll should match by URL.');
|
||||
});
|
||||
}, 'Cache.matchAll with URL');
|
||||
|
||||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.match(entries.a.request.url)
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, entries.a.response,
|
||||
'Cache.match should match by URL.');
|
||||
assert_response_equals(result, entries.a.response,
|
||||
'Cache.match should match by URL.');
|
||||
});
|
||||
}, 'Cache.match with URL');
|
||||
|
||||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.matchAll(entries.a.request)
|
||||
.then(function(result) {
|
||||
assert_array_objects_equals(
|
||||
assert_response_array_equals(
|
||||
result, [entries.a.response],
|
||||
'Cache.matchAll should match by Request.');
|
||||
});
|
||||
|
@ -151,15 +151,15 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.match(entries.a.request)
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, entries.a.response,
|
||||
'Cache.match should match by Request.');
|
||||
assert_response_equals(result, entries.a.response,
|
||||
'Cache.match should match by Request.');
|
||||
});
|
||||
}, 'Cache.match with Request');
|
||||
|
||||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.matchAll(new Request(entries.a.request.url))
|
||||
.then(function(result) {
|
||||
assert_array_objects_equals(
|
||||
assert_response_array_equals(
|
||||
result, [entries.a.response],
|
||||
'Cache.matchAll should match by Request.');
|
||||
});
|
||||
|
@ -168,8 +168,8 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.match(new Request(entries.a.request.url))
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, entries.a.response,
|
||||
'Cache.match should match by Request.');
|
||||
assert_response_equals(result, entries.a.response,
|
||||
'Cache.match should match by Request.');
|
||||
});
|
||||
}, 'Cache.match with new Request');
|
||||
|
||||
|
@ -177,7 +177,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
return cache.matchAll(entries.a.request,
|
||||
{ignoreSearch: true})
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result,
|
||||
[
|
||||
entries.a.response,
|
||||
|
@ -194,7 +194,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
return cache.match(entries.a.request,
|
||||
{ignoreSearch: true})
|
||||
.then(function(result) {
|
||||
assert_object_in_array(
|
||||
assert_response_in_array(
|
||||
result,
|
||||
[
|
||||
entries.a.response,
|
||||
|
@ -211,7 +211,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
return cache.matchAll(entries.a_with_query.request,
|
||||
{ignoreSearch: true})
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result,
|
||||
[
|
||||
entries.a.response,
|
||||
|
@ -227,7 +227,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
return cache.match(entries.a_with_query.request,
|
||||
{ignoreSearch: true})
|
||||
.then(function(result) {
|
||||
assert_object_in_array(
|
||||
assert_response_in_array(
|
||||
result,
|
||||
[
|
||||
entries.a.response,
|
||||
|
@ -242,7 +242,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.matchAll(entries.cat.request.url + '#mouse')
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result,
|
||||
[
|
||||
entries.cat.response,
|
||||
|
@ -254,15 +254,15 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.match(entries.cat.request.url + '#mouse')
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, entries.cat.response,
|
||||
'Cache.match should ignore URL fragment.');
|
||||
assert_response_equals(result, entries.cat.response,
|
||||
'Cache.match should ignore URL fragment.');
|
||||
});
|
||||
}, 'Cache.match with URL containing fragment');
|
||||
|
||||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.matchAll('http')
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result, [],
|
||||
'Cache.matchAll should treat query as a URL and not ' +
|
||||
'just a string fragment.');
|
||||
|
@ -282,7 +282,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.matchAll(entries.secret_cat.request.url)
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result, [entries.secret_cat.response],
|
||||
'Cache.matchAll should not ignore embedded credentials');
|
||||
});
|
||||
|
@ -291,7 +291,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(simple_entries, function(cache, entries) {
|
||||
return cache.match(entries.secret_cat.request.url)
|
||||
.then(function(result) {
|
||||
assert_object_equals(
|
||||
assert_response_equals(
|
||||
result, entries.secret_cat.response,
|
||||
'Cache.match should not ignore embedded credentials');
|
||||
});
|
||||
|
@ -300,7 +300,7 @@ prepopulated_cache_test(simple_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(vary_entries, function(cache, entries) {
|
||||
return cache.matchAll('http://example.com/c')
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result,
|
||||
[
|
||||
entries.vary_cookie_absent.response
|
||||
|
@ -316,7 +316,7 @@ prepopulated_cache_test(vary_entries, function(cache, entries) {
|
|||
{headers: {'Cookies': 'none-of-the-above'}}));
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result,
|
||||
[
|
||||
],
|
||||
|
@ -331,7 +331,7 @@ prepopulated_cache_test(vary_entries, function(cache, entries) {
|
|||
{headers: {'Cookies': 'is-for-cookie'}}));
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result,
|
||||
[entries.vary_cookie_is_cookie.response],
|
||||
'Cache.matchAll should match the entire header if a vary header ' +
|
||||
|
@ -342,7 +342,7 @@ prepopulated_cache_test(vary_entries, function(cache, entries) {
|
|||
prepopulated_cache_test(vary_entries, function(cache, entries) {
|
||||
return cache.match('http://example.com/c')
|
||||
.then(function(result) {
|
||||
assert_object_in_array(
|
||||
assert_response_in_array(
|
||||
result,
|
||||
[
|
||||
entries.vary_cookie_absent.response
|
||||
|
@ -355,7 +355,7 @@ prepopulated_cache_test(vary_entries, function(cache, entries) {
|
|||
return cache.matchAll('http://example.com/c',
|
||||
{ignoreVary: true})
|
||||
.then(function(result) {
|
||||
assert_array_equivalent(
|
||||
assert_response_array_equivalent(
|
||||
result,
|
||||
[
|
||||
entries.vary_cookie_is_cookie.response,
|
||||
|
@ -383,7 +383,7 @@ cache_test(function(cache) {
|
|||
return cache.match(request.url);
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_object_equals(
|
||||
assert_response_equals(
|
||||
result, response,
|
||||
'Cache.match should return a Response object that has the same ' +
|
||||
'properties as the stored response.');
|
||||
|
|
|
@ -30,9 +30,9 @@ cache_test(function(cache) {
|
|||
return cache.match(test_url);
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, response,
|
||||
'Cache.put should update the cache with ' +
|
||||
'new request and response.');
|
||||
assert_response_equals(result, response,
|
||||
'Cache.put should update the cache with ' +
|
||||
'new request and response.');
|
||||
return result.text();
|
||||
})
|
||||
.then(function(body) {
|
||||
|
@ -75,9 +75,9 @@ cache_test(function(cache) {
|
|||
return cache.match(test_url);
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, response,
|
||||
'Cache.put should update the cache with ' +
|
||||
'new Request and Response.');
|
||||
assert_response_equals(result, response,
|
||||
'Cache.put should update the cache with ' +
|
||||
'new Request and Response.');
|
||||
});
|
||||
}, 'Cache.put with a Response containing an empty URL');
|
||||
|
||||
|
@ -118,9 +118,9 @@ cache_test(function(cache) {
|
|||
return cache.match(test_url);
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, response,
|
||||
'Cache.put should update the cache with ' +
|
||||
'new request and response.');
|
||||
assert_response_equals(result, response,
|
||||
'Cache.put should update the cache with ' +
|
||||
'new request and response.');
|
||||
return result.text();
|
||||
})
|
||||
.then(function(body) {
|
||||
|
@ -142,9 +142,9 @@ cache_test(function(cache) {
|
|||
return cache.match(test_url);
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, alternate_response,
|
||||
'Cache.put should replace existing ' +
|
||||
'response with new response.');
|
||||
assert_response_equals(result, alternate_response,
|
||||
'Cache.put should replace existing ' +
|
||||
'response with new response.');
|
||||
return result.text();
|
||||
})
|
||||
.then(function(body) {
|
||||
|
@ -168,9 +168,9 @@ cache_test(function(cache) {
|
|||
return cache.match(test_url);
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, alternate_response,
|
||||
'Cache.put should replace existing ' +
|
||||
'response with new response.');
|
||||
assert_response_equals(result, alternate_response,
|
||||
'Cache.put should replace existing ' +
|
||||
'response with new response.');
|
||||
return result.text();
|
||||
})
|
||||
.then(function(body) {
|
||||
|
@ -248,9 +248,9 @@ cache_test(function(cache) {
|
|||
return cache.match(new URL('relative-url', location.href).href);
|
||||
})
|
||||
.then(function(result) {
|
||||
assert_object_equals(result, response,
|
||||
'Cache.put should accept a relative URL ' +
|
||||
'as the request.');
|
||||
assert_response_equals(result, response,
|
||||
'Cache.put should accept a relative URL ' +
|
||||
'as the request.');
|
||||
});
|
||||
}, 'Cache.put with a relative URL');
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ cache_test(function(cache) {
|
|||
return self.caches.match(transaction.request);
|
||||
})
|
||||
.then(function(response) {
|
||||
assert_object_equals(response, transaction.response,
|
||||
'The response should not have changed.');
|
||||
assert_response_equals(response, transaction.response,
|
||||
'The response should not have changed.');
|
||||
});
|
||||
}, 'CacheStorageMatch with no cache name provided');
|
||||
|
||||
|
@ -49,8 +49,8 @@ cache_test(function(cache) {
|
|||
return self.caches.match(transaction.request);
|
||||
})
|
||||
.then(function(response) {
|
||||
assert_object_equals(response, transaction.response,
|
||||
'The response should not have changed.');
|
||||
assert_response_equals(response, transaction.response,
|
||||
'The response should not have changed.');
|
||||
});
|
||||
}, 'CacheStorageMatch from one of many caches');
|
||||
|
||||
|
@ -70,8 +70,8 @@ promise_test(function(test) {
|
|||
return self.caches.match(transaction.request, {cacheName: 'x'});
|
||||
})
|
||||
.then(function(response) {
|
||||
assert_object_equals(response, transaction.response,
|
||||
'The response should not have changed.');
|
||||
assert_response_equals(response, transaction.response,
|
||||
'The response should not have changed.');
|
||||
})
|
||||
.then(function() {
|
||||
return self.caches.match(transaction.request, {cacheName: 'y'});
|
||||
|
@ -89,8 +89,8 @@ cache_test(function(cache) {
|
|||
return self.caches.match(transaction.request);
|
||||
})
|
||||
.then(function(response) {
|
||||
assert_object_equals(response, transaction.response,
|
||||
'The response should not have changed.');
|
||||
assert_response_equals(response, transaction.response,
|
||||
'The response should not have changed.');
|
||||
});
|
||||
}, 'CacheStorageMatch a string request');
|
||||
|
||||
|
|
|
@ -1,163 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_10_04_04</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#content-element">
|
||||
<meta name="assert" content="The content HTML element: reset-style-inheritance attribute">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../testcommon.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
d.body.innerHTML =
|
||||
'<ul id="shHost">' +
|
||||
'<li id="li1" class="shadow">1</li>' +
|
||||
'<li id="li2" class="shadow2">2</li>' +
|
||||
'<li id="li3" class="shadow">3</li>' +
|
||||
'<li id="li4">4</li>' +
|
||||
'<li id="li5" class="shadow">5</li>' +
|
||||
'<li id="li6" class="shadow2">6</li>' +
|
||||
'</ul>';
|
||||
|
||||
|
||||
var defHeight1 = d.querySelector('#li1').offsetHeight;
|
||||
var defHeight2 = d.querySelector('#li2').offsetHeight;
|
||||
var defHeight3 = d.querySelector('#li3').offsetHeight;
|
||||
var defHeight4 = d.querySelector('#li4').offsetHeight;
|
||||
var defHeight5 = d.querySelector('#li5').offsetHeight;
|
||||
var defHeight6 = d.querySelector('#li6').offsetHeight;
|
||||
|
||||
assert_true(defHeight1 > 0, 'Point 1: Element height should be greater than zero');
|
||||
assert_true(defHeight2 > 0, 'Point 2: Element height should be greater than zero');
|
||||
assert_true(defHeight3 > 0, 'Point 3: Element height should be greater than zero');
|
||||
assert_true(defHeight4 > 0, 'Point 4: Element height should be greater than zero');
|
||||
assert_true(defHeight5 > 0, 'Point 5: Element height should be greater than zero');
|
||||
assert_true(defHeight6 > 0, 'Point 6: Element height should be greater than zero');
|
||||
|
||||
var host = d.querySelector('#shHost');
|
||||
|
||||
d.body.setAttribute('style', 'font-size: 30px');
|
||||
|
||||
var height1 = d.querySelector('#li1').offsetHeight;
|
||||
var height2 = d.querySelector('#li2').offsetHeight;
|
||||
var height3 = d.querySelector('#li3').offsetHeight;
|
||||
var height4 = d.querySelector('#li4').offsetHeight;
|
||||
var height5 = d.querySelector('#li5').offsetHeight;
|
||||
var height6 = d.querySelector('#li6').offsetHeight;
|
||||
|
||||
|
||||
assert_true(height1 > defHeight1, 'Point 11: Element height should be changed');
|
||||
assert_true(height2 > defHeight2, 'Point 12: Element height should be changed');
|
||||
assert_true(height3 > defHeight3, 'Point 13: Element height should be changed');
|
||||
assert_true(height4 > defHeight4, 'Point 14: Element height should be changed');
|
||||
assert_true(height5 > defHeight5, 'Point 15: Element height should be changed');
|
||||
assert_true(height6 > defHeight6, 'Point 16: Element height should be changed');
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML ='<ul><content select=".shadow" reset-style-inheritance=true></content></ul>';
|
||||
s.appendChild(div);
|
||||
|
||||
assert_equals(d.querySelector('#li1').offsetHeight, defHeight1, 'Point 21: Inherited ' +
|
||||
'element style should be reset');
|
||||
assert_equals(d.querySelector('#li3').offsetHeight, defHeight3, 'Point 22: Inherited ' +
|
||||
'element style should be reset');
|
||||
assert_equals(d.querySelector('#li5').offsetHeight, defHeight5, 'Point 23: Inherited ' +
|
||||
'element style should be reset');
|
||||
|
||||
assert_equals(d.querySelector('#li2').offsetHeight, 0, 'Point 24: Element shouldn\'t be rendered');
|
||||
assert_equals(d.querySelector('#li4').offsetHeight, 0, 'Point 25: Element shouldn\'t be rendered');
|
||||
assert_equals(d.querySelector('#li6').offsetHeight, 0, 'Point 26: Element shouldn\'t be rendered');
|
||||
|
||||
}), 'A_10_04_04_T01');
|
||||
|
||||
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
d.body.innerHTML =
|
||||
'<ul id="shHost">' +
|
||||
'<li id="li1" class="shadow">1</li>' +
|
||||
'<li id="li2" class="shadow2">2</li>' +
|
||||
'<li id="li3" class="shadow">3</li>' +
|
||||
'<li id="li4">4</li>' +
|
||||
'<li id="li5" class="shadow">5</li>' +
|
||||
'<li id="li6" class="shadow2">6</li>' +
|
||||
'</ul>';
|
||||
|
||||
|
||||
var defHeight1 = d.querySelector('#li1').offsetHeight;
|
||||
var defHeight2 = d.querySelector('#li2').offsetHeight;
|
||||
var defHeight3 = d.querySelector('#li3').offsetHeight;
|
||||
var defHeight4 = d.querySelector('#li4').offsetHeight;
|
||||
var defHeight5 = d.querySelector('#li5').offsetHeight;
|
||||
var defHeight6 = d.querySelector('#li6').offsetHeight;
|
||||
|
||||
assert_true(defHeight1 > 0, 'Point 1: Element height should be greater than zero');
|
||||
assert_true(defHeight2 > 0, 'Point 2: Element height should be greater than zero');
|
||||
assert_true(defHeight3 > 0, 'Point 3: Element height should be greater than zero');
|
||||
assert_true(defHeight4 > 0, 'Point 4: Element height should be greater than zero');
|
||||
assert_true(defHeight5 > 0, 'Point 5: Element height should be greater than zero');
|
||||
assert_true(defHeight6 > 0, 'Point 6: Element height should be greater than zero');
|
||||
|
||||
var host = d.querySelector('#shHost');
|
||||
|
||||
d.body.setAttribute('style', 'font-size: 30px');
|
||||
|
||||
var height1 = d.querySelector('#li1').offsetHeight;
|
||||
var height2 = d.querySelector('#li2').offsetHeight;
|
||||
var height3 = d.querySelector('#li3').offsetHeight;
|
||||
var height4 = d.querySelector('#li4').offsetHeight;
|
||||
var height5 = d.querySelector('#li5').offsetHeight;
|
||||
var height6 = d.querySelector('#li6').offsetHeight;
|
||||
|
||||
|
||||
assert_true(height1 > defHeight1, 'Point 11: Element height should be changed');
|
||||
assert_true(height2 > defHeight2, 'Point 12: Element height should be changed');
|
||||
assert_true(height3 > defHeight3, 'Point 13: Element height should be changed');
|
||||
assert_true(height4 > defHeight4, 'Point 14: Element height should be changed');
|
||||
assert_true(height5 > defHeight5, 'Point 15: Element height should be changed');
|
||||
assert_true(height6 > defHeight6, 'Point 16: Element height should be changed');
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML ='<ul><content select=".shadow" reset-style-inheritance></content></ul>';
|
||||
s.appendChild(div);
|
||||
|
||||
assert_equals(d.querySelector('#li1').offsetHeight, defHeight1, 'Point 21: Inherited ' +
|
||||
'element style should be reset');
|
||||
assert_equals(d.querySelector('#li3').offsetHeight, defHeight3, 'Point 22: Inherited ' +
|
||||
'element style should be reset');
|
||||
assert_equals(d.querySelector('#li5').offsetHeight, defHeight5, 'Point 23: Inherited ' +
|
||||
'element style should be reset');
|
||||
|
||||
assert_equals(d.querySelector('#li2').offsetHeight, 0, 'Point 24: Element shouldn\'t be rendered');
|
||||
assert_equals(d.querySelector('#li4').offsetHeight, 0, 'Point 25: Element shouldn\'t be rendered');
|
||||
assert_equals(d.querySelector('#li6').offsetHeight, 0, 'Point 26: Element shouldn\'t be rendered');
|
||||
|
||||
}), 'A_10_04_04_T02');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,189 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Distributed under both the W3C Test Suite License [1] and the W3C
|
||||
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
|
||||
policies and contribution forms [3].
|
||||
|
||||
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
|
||||
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
|
||||
[3] http://www.w3.org/2004/10/27-testcases
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Shadow DOM Test: A_10_05_03</title>
|
||||
<link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
||||
<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#shadow-element">
|
||||
<meta name="assert" content="The shadow HTML element: reset-style-inheritance attribute">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../testcommon.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
// test reset-style-inheritance=true
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
d.body.innerHTML =
|
||||
'<ul id="shHost">' +
|
||||
'<li id="li1" class="shadow">1</li>' +
|
||||
'<li id="li2" class="shadow2">2</li>' +
|
||||
'<li id="li3" class="shadow">3</li>' +
|
||||
'<li id="li4">4</li>' +
|
||||
'<li id="li5" class="shadow">5</li>' +
|
||||
'<li id="li6" class="shadow2">6</li>' +
|
||||
'</ul>';
|
||||
|
||||
|
||||
var defHeight1 = d.querySelector('#li1').offsetHeight;
|
||||
var defHeight2 = d.querySelector('#li2').offsetHeight;
|
||||
var defHeight3 = d.querySelector('#li3').offsetHeight;
|
||||
var defHeight4 = d.querySelector('#li4').offsetHeight;
|
||||
var defHeight5 = d.querySelector('#li5').offsetHeight;
|
||||
var defHeight6 = d.querySelector('#li6').offsetHeight;
|
||||
|
||||
assert_true(defHeight1 > 0, 'Point 1: Element height should be greater than zero');
|
||||
assert_true(defHeight2 > 0, 'Point 2: Element height should be greater than zero');
|
||||
assert_true(defHeight3 > 0, 'Point 3: Element height should be greater than zero');
|
||||
assert_true(defHeight4 > 0, 'Point 4: Element height should be greater than zero');
|
||||
assert_true(defHeight5 > 0, 'Point 5: Element height should be greater than zero');
|
||||
assert_true(defHeight6 > 0, 'Point 6: Element height should be greater than zero');
|
||||
|
||||
var host = d.querySelector('#shHost');
|
||||
|
||||
d.body.setAttribute('style', 'font-size: 30px');
|
||||
|
||||
var height1 = d.querySelector('#li1').offsetHeight;
|
||||
var height2 = d.querySelector('#li2').offsetHeight;
|
||||
var height3 = d.querySelector('#li3').offsetHeight;
|
||||
var height4 = d.querySelector('#li4').offsetHeight;
|
||||
var height5 = d.querySelector('#li5').offsetHeight;
|
||||
var height6 = d.querySelector('#li6').offsetHeight;
|
||||
|
||||
|
||||
assert_true(height1 > defHeight1, 'Point 11: Element height should be changed');
|
||||
assert_true(height2 > defHeight2, 'Point 12: Element height should be changed');
|
||||
assert_true(height3 > defHeight3, 'Point 13: Element height should be changed');
|
||||
assert_true(height4 > defHeight4, 'Point 14: Element height should be changed');
|
||||
assert_true(height5 > defHeight5, 'Point 15: Element height should be changed');
|
||||
assert_true(height6 > defHeight6, 'Point 16: Element height should be changed');
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML ='<ul><content select=".shadow"></content></ul>';
|
||||
s.appendChild(div);
|
||||
|
||||
assert_equals(d.querySelector('#li1').offsetHeight, height1, 'Point 21: Element height should not be changed');
|
||||
assert_equals(d.querySelector('#li3').offsetHeight, height3, 'Point 22: Element height should not be changed');
|
||||
assert_equals(d.querySelector('#li5').offsetHeight, height5, 'Point 23: Element height should not be changed');
|
||||
|
||||
assert_equals(d.querySelector('#li2').offsetHeight, 0, 'Point 24: Element shouldn\'t be rendered');
|
||||
assert_equals(d.querySelector('#li4').offsetHeight, 0, 'Point 25: Element shouldn\'t be rendered');
|
||||
assert_equals(d.querySelector('#li6').offsetHeight, 0, 'Point 26: Element shouldn\'t be rendered');
|
||||
|
||||
//Young tree
|
||||
var s2 = host.createShadowRoot();
|
||||
|
||||
var div2 = d.createElement('div');
|
||||
div2.innerHTML = '<shadow reset-style-inheritance=true></shadow>';
|
||||
s2.appendChild(div2);
|
||||
|
||||
//styles should be reset
|
||||
assert_equals(d.querySelector('#li1').offsetHeight, defHeight1, 'Point 31: Inherited ' +
|
||||
'element style should be reset');
|
||||
assert_equals(d.querySelector('#li3').offsetHeight, defHeight3, 'Point 32: Inherited ' +
|
||||
'element style should be reset');
|
||||
assert_equals(d.querySelector('#li5').offsetHeight, defHeight5, 'Point 33: Inherited ' +
|
||||
'element style should be reset');
|
||||
|
||||
}), 'A_10_05_03_T01');
|
||||
|
||||
|
||||
//test reset-style-inheritance
|
||||
test(unit(function (ctx) {
|
||||
|
||||
var d = newRenderedHTMLDocument(ctx);
|
||||
|
||||
d.body.innerHTML =
|
||||
'<ul id="shHost">' +
|
||||
'<li id="li1" class="shadow">1</li>' +
|
||||
'<li id="li2" class="shadow2">2</li>' +
|
||||
'<li id="li3" class="shadow">3</li>' +
|
||||
'<li id="li4">4</li>' +
|
||||
'<li id="li5" class="shadow">5</li>' +
|
||||
'<li id="li6" class="shadow2">6</li>' +
|
||||
'</ul>';
|
||||
|
||||
|
||||
var defHeight1 = d.querySelector('#li1').offsetHeight;
|
||||
var defHeight2 = d.querySelector('#li2').offsetHeight;
|
||||
var defHeight3 = d.querySelector('#li3').offsetHeight;
|
||||
var defHeight4 = d.querySelector('#li4').offsetHeight;
|
||||
var defHeight5 = d.querySelector('#li5').offsetHeight;
|
||||
var defHeight6 = d.querySelector('#li6').offsetHeight;
|
||||
|
||||
assert_true(defHeight1 > 0, 'Point 1: Element height should be greater than zero');
|
||||
assert_true(defHeight2 > 0, 'Point 2: Element height should be greater than zero');
|
||||
assert_true(defHeight3 > 0, 'Point 3: Element height should be greater than zero');
|
||||
assert_true(defHeight4 > 0, 'Point 4: Element height should be greater than zero');
|
||||
assert_true(defHeight5 > 0, 'Point 5: Element height should be greater than zero');
|
||||
assert_true(defHeight6 > 0, 'Point 6: Element height should be greater than zero');
|
||||
|
||||
var host = d.querySelector('#shHost');
|
||||
|
||||
d.body.setAttribute('style', 'font-size: 30px');
|
||||
|
||||
var height1 = d.querySelector('#li1').offsetHeight;
|
||||
var height2 = d.querySelector('#li2').offsetHeight;
|
||||
var height3 = d.querySelector('#li3').offsetHeight;
|
||||
var height4 = d.querySelector('#li4').offsetHeight;
|
||||
var height5 = d.querySelector('#li5').offsetHeight;
|
||||
var height6 = d.querySelector('#li6').offsetHeight;
|
||||
|
||||
|
||||
assert_true(height1 > defHeight1, 'Point 11: Element height should be changed');
|
||||
assert_true(height2 > defHeight2, 'Point 12: Element height should be changed');
|
||||
assert_true(height3 > defHeight3, 'Point 13: Element height should be changed');
|
||||
assert_true(height4 > defHeight4, 'Point 14: Element height should be changed');
|
||||
assert_true(height5 > defHeight5, 'Point 15: Element height should be changed');
|
||||
assert_true(height6 > defHeight6, 'Point 16: Element height should be changed');
|
||||
|
||||
//Shadow root to play with
|
||||
var s = host.createShadowRoot();
|
||||
|
||||
var div = d.createElement('div');
|
||||
div.innerHTML ='<ul><content select=".shadow"></content></ul>';
|
||||
s.appendChild(div);
|
||||
|
||||
assert_equals(d.querySelector('#li1').offsetHeight, height1, 'Point 21: Element height should not be changed');
|
||||
assert_equals(d.querySelector('#li3').offsetHeight, height3, 'Point 22: Element height should not be changed');
|
||||
assert_equals(d.querySelector('#li5').offsetHeight, height5, 'Point 23: Element height should not be changed');
|
||||
|
||||
assert_equals(d.querySelector('#li2').offsetHeight, 0, 'Point 24: Element shouldn\'t be rendered');
|
||||
assert_equals(d.querySelector('#li4').offsetHeight, 0, 'Point 25: Element shouldn\'t be rendered');
|
||||
assert_equals(d.querySelector('#li6').offsetHeight, 0, 'Point 26: Element shouldn\'t be rendered');
|
||||
|
||||
//Young tree
|
||||
var s2 = host.createShadowRoot();
|
||||
|
||||
var div2 = d.createElement('div');
|
||||
div2.innerHTML = '<shadow reset-style-inheritance></shadow>';
|
||||
s2.appendChild(div2);
|
||||
|
||||
//styles should be reset
|
||||
assert_equals(d.querySelector('#li1').offsetHeight, defHeight1, 'Point 31: Inherited ' +
|
||||
'element style should be reset');
|
||||
assert_equals(d.querySelector('#li3').offsetHeight, defHeight3, 'Point 32: Inherited ' +
|
||||
'element style should be reset');
|
||||
assert_equals(d.querySelector('#li5').offsetHeight, defHeight5, 'Point 33: Inherited ' +
|
||||
'element style should be reset');
|
||||
|
||||
}), 'A_10_05_03_T02');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -35,7 +35,7 @@ A_05_05_01_T01.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #volume-slider-thumb relative target #volume-slider-thumb
|
||||
//For #volume-slider-thumb relative target #volume-slider-thumb
|
||||
roots.volumeShadowRoot.querySelector('#volume-slider-thumb').addEventListener('click',
|
||||
A_05_05_01_T01.step_func(function(event) {
|
||||
invoked = true;
|
||||
|
@ -68,7 +68,7 @@ A_05_05_01_T02.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #volume-shadow-root relative target #volume-slider-thumb
|
||||
//For #volume-shadow-root relative target #volume-slider-thumb
|
||||
roots.volumeShadowRoot.addEventListener('click',
|
||||
A_05_05_01_T02.step_func(function(event) {
|
||||
invoked = true;
|
||||
|
@ -101,13 +101,13 @@ A_05_05_01_T03.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #volume-slider relative target #volume-slider
|
||||
//For #volume-slider relative target #volume-shadow-host
|
||||
roots.playerShadowRoot.querySelector('#volume-slider').addEventListener('click',
|
||||
A_05_05_01_T03.step_func(function(event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
|
||||
'Wrong target');
|
||||
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.currentTarget.getAttribute('id'), 'volume-slider',
|
||||
'Wrong currentTarget');
|
||||
}), false);
|
||||
|
||||
|
@ -135,13 +135,13 @@ A_05_05_01_T04.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #volume-slider-container relative target #volume-slider
|
||||
//For #volume-slider-container relative target #volume-shadow-host
|
||||
roots.playerShadowRoot.querySelector('#volume-slider-container').addEventListener('click',
|
||||
A_05_05_01_T04.step_func(function(event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
|
||||
'Wrong target');
|
||||
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.currentTarget.getAttribute('id'), 'volume-slider-container',
|
||||
'Wrong currentTarget');
|
||||
}), false);
|
||||
|
||||
|
@ -168,13 +168,13 @@ A_05_05_01_T05.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #controls relative target #volume-slider
|
||||
//For #controls relative target #volume-shadow-host
|
||||
roots.playerShadowRoot.querySelector('#controls').addEventListener('click',
|
||||
A_05_05_01_T05.step_func(function(event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
|
||||
'Wrong target');
|
||||
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.currentTarget.getAttribute('id'), 'controls',
|
||||
'Wrong currentTarget');
|
||||
}), false);
|
||||
|
||||
|
@ -201,13 +201,13 @@ A_05_05_01_T06.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #player-shadow-root relative target #volume-slider
|
||||
roots.playerShadowRoot.addEventListener('click',
|
||||
//For #player-shadow-host relative target #player-shadow-host
|
||||
d.querySelector('#player-shadow-host').addEventListener('click',
|
||||
A_05_05_01_T06.step_func(function(event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
|
||||
'Wrong target');
|
||||
assert_true(event.currentTarget.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.currentTarget.getAttribute('id'), 'player-shadow-host',
|
||||
'Wrong currentTarget');
|
||||
}), false);
|
||||
|
||||
|
@ -235,13 +235,13 @@ A_05_05_01_T07.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #player relative target #player
|
||||
//For #player relative target #player-shadow-host
|
||||
d.querySelector('#player').addEventListener('click',
|
||||
A_05_05_01_T07.step_func(function(event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'player',
|
||||
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
|
||||
'Wrong target');
|
||||
assert_true(event.currentTarget.getAttribute('id'), 'player',
|
||||
assert_equals(event.currentTarget.getAttribute('id'), 'player',
|
||||
'Wrong currentTarget');
|
||||
}), false);
|
||||
|
||||
|
|
|
@ -60,11 +60,11 @@ A_05_01_04_T02.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #volume-shadow-root relative target is #volume-slider-thumb
|
||||
roots.volumeShadowRoot.addEventListener('click',
|
||||
//For #volume-shadow-host relative target is #volume-shadow-host
|
||||
roots.playerShadowRoot.querySelector('#volume-shadow-host').addEventListener('click',
|
||||
A_05_01_04_T02.step_func(function (event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider-thumb',
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
|
||||
'Wrong related target');
|
||||
}), false);
|
||||
|
||||
|
@ -90,11 +90,11 @@ A_05_01_04_T03.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #volume-slider relative target is #volume-slider
|
||||
//For #volume-slider relative target is #volume-shadow-host
|
||||
roots.playerShadowRoot.querySelector('#volume-slider').addEventListener('click',
|
||||
A_05_01_04_T03.step_func(function (event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
|
||||
'Wrong related target');
|
||||
}), false);
|
||||
|
||||
|
@ -118,11 +118,11 @@ A_05_01_04_T04.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #volume-slider-container relative target is #volume-slider
|
||||
//For #volume-slider-container relative target is #volume-shadow-host
|
||||
roots.playerShadowRoot.querySelector('#volume-slider-container').addEventListener('click',
|
||||
A_05_01_04_T04.step_func(function (event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
|
||||
'Wrong related target');
|
||||
}), false);
|
||||
|
||||
|
@ -146,11 +146,11 @@ A_05_01_04_T05.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #controls relative target is #volume-slider
|
||||
//For #controls relative target is #volume-shadow-host
|
||||
roots.playerShadowRoot.querySelector('#controls').addEventListener('click',
|
||||
A_05_01_04_T05.step_func(function (event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
|
||||
'Wrong related target');
|
||||
}), false);
|
||||
|
||||
|
@ -174,11 +174,11 @@ A_05_01_04_T06.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #player-shadow-root relative target is #volume-slider
|
||||
//For #player-shadow-host relative target is #player-shadow-host
|
||||
roots.playerShadowRoot.addEventListener('click',
|
||||
A_05_01_04_T06.step_func(function (event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-slider',
|
||||
assert_equals(event.target.getAttribute('id'), 'volume-shadow-host',
|
||||
'Wrong related target');
|
||||
}), false);
|
||||
|
||||
|
@ -203,11 +203,11 @@ A_05_01_04_T07.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #player relative target is #player
|
||||
//For #player relative target is #player-shadow-host
|
||||
d.querySelector('#player').addEventListener('click',
|
||||
A_05_01_04_T07.step_func(function (event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'player',
|
||||
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
|
||||
'Wrong related target');
|
||||
}), false);
|
||||
|
||||
|
@ -344,11 +344,11 @@ A_05_01_04_T12.step(unit(function (ctx) {
|
|||
//expected result of what relative target should be see
|
||||
//see at http://www.w3.org/TR/shadow-dom/#event-retargeting-example
|
||||
|
||||
//For #player relative target is #player
|
||||
//For #player relative target is #player-shadow-host
|
||||
d.querySelector('#player').addEventListener('click',
|
||||
A_05_01_04_T12.step_func(function (event) {
|
||||
invoked = true;
|
||||
assert_equals(event.target.getAttribute('id'), 'player',
|
||||
assert_equals(event.target.getAttribute('id'), 'player-shadow-host',
|
||||
'Wrong related target');
|
||||
}), false);
|
||||
|
||||
|
|
|
@ -228,30 +228,30 @@ function createTestMediaPlayer(d) {
|
|||
d.body.innerHTML = '' +
|
||||
'<div id="player">' +
|
||||
'<input type="checkbox" id="outside-control">' +
|
||||
'<div id="player-shadow-root">' +
|
||||
'<div id="player-shadow-host">' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
var playerShadowRoot = d.querySelector('#player-shadow-root').createShadowRoot();
|
||||
var playerShadowRoot = d.querySelector('#player-shadow-host').createShadowRoot();
|
||||
playerShadowRoot.innerHTML = '' +
|
||||
'<div id="controls">' +
|
||||
'<button class="play-button">PLAY</button>' +
|
||||
'<input type="range" id="timeline">' +
|
||||
'<div id="timeline-shadow-root">' +
|
||||
'<div tabindex="0" id="timeline">' +
|
||||
'<div id="timeline-shadow-host">' +
|
||||
'</div>' +
|
||||
'</input>' +
|
||||
'</div>' +
|
||||
'<div class="volume-slider-container" id="volume-slider-container">' +
|
||||
'<input type="range" class="volume-slider" id="volume-slider">' +
|
||||
'<div id="volume-shadow-root">' +
|
||||
'<div tabindex="0" class="volume-slider" id="volume-slider">' +
|
||||
'<div id="volume-shadow-host">' +
|
||||
'</div>' +
|
||||
'</input>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
var timeLineShadowRoot = playerShadowRoot.querySelector('#timeline-shadow-root').createShadowRoot();
|
||||
var timeLineShadowRoot = playerShadowRoot.querySelector('#timeline-shadow-host').createShadowRoot();
|
||||
timeLineShadowRoot.innerHTML = '<div class="slider-thumb" id="timeline-slider-thumb"></div>';
|
||||
|
||||
var volumeShadowRoot = playerShadowRoot.querySelector('#volume-shadow-root').createShadowRoot();
|
||||
var volumeShadowRoot = playerShadowRoot.querySelector('#volume-shadow-host').createShadowRoot();
|
||||
volumeShadowRoot.innerHTML = '<div class="slider-thumb" id="volume-slider-thumb"></div>';
|
||||
|
||||
return {
|
||||
|
|
|
@ -115,6 +115,11 @@ class Webidl2Regexp(Regexp):
|
|||
pattern = "webidl2\.js"
|
||||
error = "WEBIDL2.JS"
|
||||
|
||||
class ConsoleRegexp(Regexp):
|
||||
pattern = "console\.[a-zA-Z]+\s*\("
|
||||
error = "CONSOLE"
|
||||
file_extensions = [".html", ".htm", ".js", ".xht", ".html", ".svg"]
|
||||
|
||||
class PrintRegexp(Regexp):
|
||||
pattern = "print(?:\s|\s*\()"
|
||||
error = "PRINT STATEMENT"
|
||||
|
@ -126,6 +131,7 @@ regexps = [item() for item in
|
|||
CRRegexp,
|
||||
W3CTestOrgRegexp,
|
||||
Webidl2Regexp,
|
||||
ConsoleRegexp,
|
||||
PrintRegexp]]
|
||||
|
||||
def check_regexp_line(path, f):
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -233,6 +233,11 @@ class WebTestRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||
self.logger.debug("%s %s" % (request.method, request.request_path))
|
||||
handler = self.server.router.get_handler(request)
|
||||
|
||||
# If the handler we used for the request had a non-default base path
|
||||
# set update the doc_root of the request to reflect this
|
||||
if hasattr(handler, "base_path") and handler.base_path:
|
||||
request.doc_root = handler.base_path
|
||||
|
||||
if self.server.latency is not None:
|
||||
if callable(self.server.latency):
|
||||
latency = self.server.latency()
|
||||
|
|
|
@ -12,7 +12,7 @@ var args = [
|
|||
/* numbers */
|
||||
[NaN, 0], [+Infinity, 0], [-Infinity, 0], [+0, 0], [-0, 0],
|
||||
[-0.4, 0], [-0.9, 0], [1.1, 1], [2.9, 2],
|
||||
[1, 1], [-0xF1000000, 0xF000000],
|
||||
[1, 1], [-0xF1000000, 0],
|
||||
/* strings */
|
||||
["1", 1], ["1e2", 100],
|
||||
/* null, undefined, booleans */
|
||||
|
|
|
@ -12,7 +12,7 @@ var args = [
|
|||
/* numbers */
|
||||
[NaN, 0], [+Infinity, 0], [-Infinity, 0], [+0, 0], [-0, 0], // Step 2
|
||||
[-0.4, 0], [-0.9, 0], [1.1, 1], [2.9, 2], // Step 3
|
||||
[1, 1], [-0xF1000000, 0xF000000], // Step 4
|
||||
[1, 1], [-0xF1000000, 0], // Step 4
|
||||
/* strings */
|
||||
["1", 1], ["1e2", 100],
|
||||
/* null, undefined, booleans */
|
||||
|
|
|
@ -258,6 +258,9 @@ test.txt s:http h:www.example.com p:/test.txt
|
|||
\u4E2D/test.txt s:http h:www.example.com p:/%E4%B8%AD/test.txt
|
||||
http://www.example2.com s:http h:www.example2.com p:/
|
||||
//www.example2.com s:http h:www.example2.com p:/
|
||||
file:... s:file h: p:/...
|
||||
file:.. s:file h: p:/
|
||||
file:a s:file h: p:/a
|
||||
|
||||
# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test currentTime at completion of OfflineAudioContext rendering</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
promise_test(function() {
|
||||
// sampleRate is a power of two so that time can be represented exactly
|
||||
// in double currentTime.
|
||||
var context = new OfflineAudioContext(1, 1, 65536);
|
||||
return context.startRendering().
|
||||
then(function(buffer) {
|
||||
assert_equals(buffer.length, 1, "buffer length");
|
||||
assert_equals(context.currentTime, 128 / context.sampleRate,
|
||||
"currentTime at completion");
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
importScripts("/resources/testharness.js");
|
||||
test(function() {
|
||||
assert_equals("ÿ", "\ufffd");
|
||||
}, "Decoding invalid utf-8");
|
||||
done();
|
Loading…
Add table
Add a link
Reference in a new issue