mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
0
tests/wpt/web-platform-tests/html/semantics/.gitkeep
Normal file
0
tests/wpt/web-platform-tests/html/semantics/.gitkeep
Normal file
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Disabled elements</title>
|
||||
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
|
||||
<link rel=help href="https://html.spec.whatwg.org/multipage/#disabled-elements">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<button disabled>button</button>
|
||||
<input disabled>
|
||||
<select disabled>
|
||||
<optgroup label="options" disabled>
|
||||
<option value="option1" disabled>option1
|
||||
<option value="option2">option2
|
||||
</select>
|
||||
<textarea disabled>textarea</textarea>
|
||||
<fieldset disabled>
|
||||
<input type=radio name=c value=0 checked>
|
||||
<input type=radio name=c value=1>
|
||||
</fieldset>
|
||||
<a href="http://www.w3.org/" disabled>w3</a>
|
||||
<span tabindex=0 disabled>foobar</span>
|
||||
|
||||
<script>
|
||||
test(function(){
|
||||
assert_equals(document.activeElement, document.body);
|
||||
}, "The body element must be the active element if no element is focused");
|
||||
|
||||
["button", "input", "select", "optgroup", "option", "textarea", "input[type=radio]"].forEach(function(el) {
|
||||
test(function() {
|
||||
var element = document.querySelector(el);
|
||||
element.focus();
|
||||
assert_equals(document.activeElement, document.body, "activeElement after focus on a disabled <" + el + "> remains unchanged");
|
||||
}, "A disabled <" + el + "> should not be focusable");
|
||||
});
|
||||
|
||||
["a", "span"].forEach(function(el) {
|
||||
test(function() {
|
||||
var element = document.querySelector(el);
|
||||
element.focus();
|
||||
assert_equals(document.activeElement, element, "focus on a <" + el + "> with a disabled attribute should make it the activeElement");
|
||||
}, "A disabled <" + el + "> should be focusable");
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: Styling</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#styling">
|
||||
<link id="style1" rel="text" title="Intel" href="./support/unmatch.css">
|
||||
<link id="style2" rel="alternate stylesheet" type="text/css" title="" href="./support/emptytitle.css">
|
||||
<link id="style3" rel="alternate stylesheet" type="text/css" href="./support/notitle.css">
|
||||
<link id="style5" rel="stylesheet" type="text/css" href="./support/normal.css">
|
||||
<link id="style6" rel="alternate stylesheet" type="text/css" href="./support/normal.css" title="./support/alternate.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style id="style4" type="text/html">
|
||||
#test {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<style id="style7" type="text/css" media="all" title="./support/alternate.css">
|
||||
#test {
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test" style="display:none">STYLING TEST</div>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
var style = null,
|
||||
i;
|
||||
for (i = 1; i < 5; i++) {
|
||||
style = document.getElementById("style" + i);
|
||||
assert_equals(style.sheet, null, "The sheet attribute of style" + i + " should be null.");
|
||||
assert_false(style.disabled, "The disabled attribute of style" + i + " should be false.");
|
||||
}
|
||||
}, "The LinkStyle interface's sheet attribute must return null; the disabled attribute must be false");
|
||||
|
||||
test(function() {
|
||||
var style = document.createElement("style"),
|
||||
link = document.createElement("link");
|
||||
assert_equals(style.sheet, null, "The sheet attribute of the style element not in a document should be null.");
|
||||
assert_equals(link.sheet, null, "The sheet attribute of the link element not in a document should be null.");
|
||||
}, "The LinkStyle interface's sheet attribute must return null if the corresponding element is not in a Document");
|
||||
|
||||
test(function() {
|
||||
var style = null,
|
||||
i;
|
||||
for (i = 5; i < 8; i++) {
|
||||
style = document.getElementById("style" + i);
|
||||
assert_true(style.sheet instanceof StyleSheet, "The sheet attribute of style" + i + " should be a StyleSheet object.");
|
||||
assert_equals(style.disabled, style.sheet.disabled, "The disabled attribute of style" + i + " should equal to the same attribute of StyleSheet.");
|
||||
}
|
||||
}, "The LinkStyle interface's sheet attribute must return StyleSheet object; the disabled attribute must be same as the StyleSheet's disabled attribute");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("style2").title, "", "The title attribute of style2 is incorrect.");
|
||||
assert_equals(document.getElementById("style5").title, "", "The title attribute of style5 is incorrect.");
|
||||
assert_equals(document.getElementById("style6").title, "./support/alternate.css", "The title attribute of style6 is incorrect.");
|
||||
assert_equals(document.getElementById("style7").title, "./support/alternate.css", "The title attribute of style7 is incorrect.");
|
||||
}, "The title must be the same as the value of the element's title content attribute");
|
||||
|
||||
test(function() {
|
||||
assert_equals(document.getElementById("style5").media, "", "The media attribute of style5 is incorrect.");
|
||||
assert_equals(document.getElementById("style7").media, "all", "The media attribute of style7 is incorrect.");
|
||||
}, "The media must be the same as the value of the element's media content attribute, or the empty string if it is omitted");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,7 @@
|
|||
#test {
|
||||
color: yellow;
|
||||
background-color: blue;
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
font-size: .5em;
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
#test {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
#test {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
font-size: 10px;
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
#test {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
#test {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: base_href_empty</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<base id="base" href="" target="_blank">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<img id="test" src="/images/blue-100x100.png" style="display:none">
|
||||
|
||||
<script>
|
||||
var testElement,
|
||||
baseElement;
|
||||
|
||||
setup(function() {
|
||||
testElement = document.getElementById("test");
|
||||
baseElement = document.getElementById("base");
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_equals(baseElement.href, document.location.href, "The href of base element is incorrect.");
|
||||
}, "The value of the href attribute must be the document's address if it is empty");
|
||||
|
||||
test(function() {
|
||||
var exp = testElement.src.substring(0, testElement.src.lastIndexOf("/images/blue-100x100.png") + 1);
|
||||
assert_true(baseElement.href.indexOf(exp) != -1, "The src of img element is incorrect.");
|
||||
}, "The src attribute of the img element must relative to document's address");
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: base_href_specified</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<base id="base" href="http://{{domains[www]}}:{{ports[http][0]}}">
|
||||
<div id="log"></div>
|
||||
<img id="test" src="test.ico" style="display:none">
|
||||
|
||||
<script>
|
||||
var testElement;
|
||||
var baseElement;
|
||||
|
||||
setup(function() {
|
||||
testElement = document.getElementById("test");
|
||||
baseElement = document.getElementById("base");
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_equals(baseElement.href, "http://{{domains[www]}}:{{ports[http][0]}}/", "The href attribute of the base element is incorrect.");
|
||||
}, "The href attribute of the base element is specified");
|
||||
|
||||
test(function() {
|
||||
assert_equals(testElement.src, "http://{{domains[www]}}:{{ports[http][0]}}/test.ico", "The src attribute of the img element is incorrect.");
|
||||
}, "The src attribute of the img element must relative to the href attribute of the base element");
|
||||
</script>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: base_href_unspecified</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<base id="base" target="_blank">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
<img id="test" src="/images/blue-100x100.png" style="display:none">
|
||||
|
||||
<script>
|
||||
var testElement,
|
||||
baseElement;
|
||||
|
||||
setup(function () {
|
||||
testElement = document.getElementById("test");
|
||||
baseElement = document.getElementById("base");
|
||||
});
|
||||
|
||||
test(function() {
|
||||
assert_equals(baseElement.href, document.location.href, "Return the document base URL if the base element has no href content attribute.");
|
||||
}, "The value of the href attribute must be the document's address if it is unspecified");
|
||||
|
||||
test(function() {
|
||||
var exp = testElement.src.substring(0, testElement.src.lastIndexOf("/images/blue-100x100.png") + 1);
|
||||
assert_true(baseElement.href.indexOf(exp) != -1, "The src attribute of the img element is incorrect.");
|
||||
}, "The src attribute of the img element must relative to document's address");
|
||||
</script>
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: base_multiple</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-base-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body onload="on_load()">
|
||||
<div id="log"></div>
|
||||
<iframe id="test1" src="example.html" style="width:0;height:0" frameborder="0"></iframe>
|
||||
<iframe id="test2" src="example.html" name="targetWin" style="width:0;height:0" frameborder="0"></iframe>
|
||||
<script>
|
||||
var t = async_test("The attributes of the a element must be affected by the first base element"),
|
||||
doc1,
|
||||
fr2,
|
||||
a1;
|
||||
|
||||
function on_load() {
|
||||
setup(function (){
|
||||
doc1 = document.getElementById("test1").contentDocument;
|
||||
fr2 = document.getElementById("test2");
|
||||
a1 = doc1.getElementById("a1");
|
||||
});
|
||||
|
||||
fr2.addEventListener("load", function () {
|
||||
t.step(function () {
|
||||
var doc2 = fr2.contentDocument;
|
||||
assert_not_equals(doc2.location.href.indexOf("example2.html"), -1, "The target attribute does not impact the a element.");
|
||||
assert_equals(doc2.getElementById("d1").innerHTML, "PASS", "The opend page should be the example2.html.");
|
||||
});
|
||||
t.done();
|
||||
}, true);
|
||||
|
||||
a1.click();
|
||||
}
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Example</title>
|
||||
<base target="targetWin" href="">
|
||||
<base target="_self" href="http://www.example.com/">
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<a id="a1" href="example2.html" target="">click me</a>
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Example</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<div id="d1">PASS</div>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<title>link.relList: non-string contains</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#domtokenlist">
|
||||
<link rel="help" href="https://heycam.github.io/webidl/#ecmascript-binding">
|
||||
<link rel="help" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf#page=57">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link id="link" rel="undefined null 0 NaN Infinity">
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var list = document.getElementById("link").relList;
|
||||
assert_equals(list.contains(undefined), true); //"undefined"
|
||||
assert_equals(list.contains(null), true); //"null"
|
||||
assert_equals(list.contains(-0), true); //"0"
|
||||
assert_equals(list.contains(+0), true); //"0"
|
||||
assert_equals(list.contains(NaN), true); //"NaN"
|
||||
assert_equals(list.contains(+Infinity), true); //"Infinity"
|
||||
assert_equals(list.contains(-Infinity), false); //"-Infinity"
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<title>link: error events</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<script>
|
||||
//var t404 = async_test("Should get an error event for a 404 error.")
|
||||
//t404.step(function() {
|
||||
// var elt = document.createElement("link");
|
||||
// elt.onerror = t404.step_func(function() {
|
||||
// assert_true(true, "Got error event for 404 error.")
|
||||
// t404.done()
|
||||
// })
|
||||
// elt.rel = "stylesheet";
|
||||
// elt.href = 404 error;
|
||||
// document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
//})
|
||||
var tText = async_test("Should get an error event for a text/plain response.")
|
||||
tText.step(function() {
|
||||
var elt = document.createElement("link");
|
||||
elt.onerror = tText.step_func(function() {
|
||||
assert_true(true, "Got error event for 404 error.")
|
||||
tText.done()
|
||||
})
|
||||
elt.rel = "stylesheet";
|
||||
elt.href = "../../../../../common/css-red.txt";
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,22 @@
|
|||
[
|
||||
{
|
||||
"id": "standard-metadata-names",
|
||||
"original_id": "standard-metadata-names"
|
||||
},
|
||||
{
|
||||
"id": "other-metadata-names",
|
||||
"original_id": "other-metadata-names"
|
||||
},
|
||||
{
|
||||
"id": "pragma-directives",
|
||||
"original_id": "pragma-directives"
|
||||
},
|
||||
{
|
||||
"id": "other-pragma-directives",
|
||||
"original_id": "other-pragma-directives"
|
||||
},
|
||||
{
|
||||
"id": "charset",
|
||||
"original_id": "charset"
|
||||
}
|
||||
]
|
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html >
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="Content-Language" content="ko,zh,ja" >
|
||||
<title>Multiple languages in Content-Language meta element</title>
|
||||
<link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'>
|
||||
<link rel='help' href='https://html.spec.whatwg.org/multipage/#pragma-directives'>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<meta name='flags' content='dom'>
|
||||
<style type='text/css'>
|
||||
#colonlangcontroltest { color: red; font-weight: bold; width: 400px; }
|
||||
#colonlangcontroltest:lang(xx) { display:none; }
|
||||
.test div { width: 50px; }
|
||||
|
||||
#box:lang(ko) { width: 100px; }
|
||||
#box:lang(zh) { width: 100px; }
|
||||
#box:lang(ja) { width: 100px; }
|
||||
|
||||
/* styling for debugging related notes */
|
||||
.notes span:lang(ko) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
.notes span:lang(zh) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
.notes span:lang(ja) { background-color: #0000FF; color: white; padding: 0 5px; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div class="test"><div id="box"> </div></div>
|
||||
<p lang='xx' id='colonlangcontroltest'>This test failed because it relies on :lang for results, but :lang is not supported by this browser.</p>
|
||||
|
||||
|
||||
<!--Notes:
|
||||
|
||||
This test uses :lang to detect whether the language has been set. If :lang is not supported, a message will appear and the test will fail.
|
||||
|
||||
-->
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementById('colonlangcontroltest').offsetWidth, 0)
|
||||
assert_equals(document.getElementById('box').offsetWidth, 50);
|
||||
}, "The UA will not recognize a language declaration in the Content-Language meta element when more than one language is declared.");
|
||||
</script>
|
||||
|
||||
<div id='log'></div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>[style] Reference file</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<style>
|
||||
h4 {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<p>
|
||||
This page tests that Style written inside HTML comment is not applied
|
||||
</p>
|
||||
This test passes if the text below is <b>Green. NOT Red.</b>
|
||||
<h4>
|
||||
This is some text.
|
||||
</h4>
|
||||
</body>
|
|
@ -0,0 +1,18 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<link rel="match" href="html_style_in_comment-ref.html"/>
|
||||
<style type="text/css">
|
||||
h4 {color: green}
|
||||
<!--
|
||||
h4 {color: red}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p> This page tests that Style written inside HTML comment is not applied</p>
|
||||
This test passes if the text below is <b>Green. NOT Red.</b>
|
||||
<h4>
|
||||
This is some text.
|
||||
</h4>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<title>style: error events</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<div id="test">
|
||||
<script>
|
||||
//var t404 = async_test("Should get an error event for a 404 error.")
|
||||
//t404.step(function() {
|
||||
// var elt = document.createElement("style");
|
||||
// elt.onerror = t404.step_func(function() {
|
||||
// assert_true(true, "Got error event for 404 error.")
|
||||
// t404.done()
|
||||
// })
|
||||
// elt.appendChild(
|
||||
// document.createTextNode('@import 404 error;'));
|
||||
// document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
//})
|
||||
var tText = async_test("Should get an error event for a text/plain response.")
|
||||
tText.step(function() {
|
||||
var elt = document.createElement("style");
|
||||
elt.onerror = tText.step_func(function() {
|
||||
assert_true(true, "Got error event for 404 error.")
|
||||
tText.done()
|
||||
})
|
||||
elt.appendChild(
|
||||
document.createTextNode('@import "../../../../common/css-red.txt";'));
|
||||
document.getElementsByTagName("head")[0].appendChild(elt);
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: The style should not be applied if it is disabled</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#test {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<style id="style">
|
||||
#test {
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var testElement = document.getElementById("test");
|
||||
var style = document.getElementById("style");
|
||||
var width1, width2;
|
||||
|
||||
width1 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width1, "50px", "The style should be applied.");
|
||||
|
||||
style.disabled = true;
|
||||
width2 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width2, "100px", "The style should not be applied.");
|
||||
}, "The style is not applied when it is disabled");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: The style events</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var tLoad = async_test("If the style is loaded successfully, the 'load' event must be fired");
|
||||
var tError = async_test("If the style is loaded unsuccessfully, the 'error' event must be fired");
|
||||
|
||||
function onstyleload(e) {
|
||||
tLoad.done();
|
||||
}
|
||||
|
||||
function onstyleerror(e) {
|
||||
tError.done();
|
||||
}
|
||||
</script>
|
||||
<style onload="onstyleload()">
|
||||
#test {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<style onerror="onstyleerror()">
|
||||
@import url(nonexistent.css);
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: The style information must be applied to the environment specified by the media attribute</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-style-media">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#test {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<style id="style">
|
||||
#test {
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var testElement = document.getElementById("test");
|
||||
var style = document.getElementById("style");
|
||||
var width1, width2;
|
||||
|
||||
width1 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width1, "50px", "The style should be applied.");
|
||||
|
||||
style.media = "print";
|
||||
width2 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width2, "100px", "The style should not be applied.");
|
||||
}, "The style information must be applied to the environment specified by the media attribute");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: The scoped attribute must apply the style information only to its parent element</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-style-scoped">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#test {
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="test"></div>
|
||||
<div>
|
||||
<style id="style">
|
||||
#test {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<div>
|
||||
<script>
|
||||
test(function() {
|
||||
var testElement = document.getElementById("test");
|
||||
var style = document.getElementById("style");
|
||||
var width1, width2;
|
||||
|
||||
width1 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width1, "100px", "The style 'width' should be applied.");
|
||||
|
||||
style.scoped = true;
|
||||
width2 = window.getComputedStyle(testElement, false)["width"];
|
||||
assert_equals(width2, "50px", "The width should not be applied.");
|
||||
}, "The scoped attribute is present, the style information must be applied only to its parent element");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<title>title.text with comment and element children.</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
try {
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
while (title.childNodes.length)
|
||||
title.removeChild(title.childNodes[0]);
|
||||
title.appendChild(document.createComment("COMMENT"));
|
||||
title.appendChild(document.createTextNode("TEXT"));
|
||||
title.appendChild(document.createElement("a"))
|
||||
.appendChild(document.createTextNode("ELEMENT"))
|
||||
} catch (e) {
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(title.text, "TEXT");
|
||||
assert_equals(title.textContent, "TEXTELEMENT");
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,30 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>title.text with comment and element children.</title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
try {
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
while (title.childNodes.length)
|
||||
title.removeChild(title.childNodes[0]);
|
||||
title.appendChild(document.createComment("COMMENT"));
|
||||
title.appendChild(document.createTextNode("TEXT"));
|
||||
title.appendChild(document.createElement("a"))
|
||||
.appendChild(document.createTextNode("ELEMENT"))
|
||||
} catch (e) {
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(title.text, "TEXT");
|
||||
assert_equals(title.textContent, "TEXTELEMENT");
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<title> title.text and space normalization </title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByTagName("title")[0].text,
|
||||
" title.text and space normalization ");
|
||||
assert_equals(document.getElementsByTagName("title")[0].textContent,
|
||||
" title.text and space normalization ");
|
||||
assert_equals(document.getElementsByTagName("title")[0].firstChild.nodeValue,
|
||||
" title.text and space normalization ");
|
||||
}, "title.text and space normalization (markup)");
|
||||
[
|
||||
"one space", "two spaces",
|
||||
"one\ttab", "two\t\ttabs",
|
||||
"one\nnewline", "two\n\nnewlines",
|
||||
"one\fform feed", "two\f\fform feeds",
|
||||
"one\rcarriage return", "two\r\rcarriage returns"
|
||||
].forEach(function(str) {
|
||||
test(function() {
|
||||
document.title = str;
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
assert_equals(title.text, str);
|
||||
assert_equals(title.textContent, str);
|
||||
assert_equals(title.firstChild.nodeValue, str);
|
||||
}, "title.text and space normalization: " + format_value(str))
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,37 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title> title.text and space normalization </title>
|
||||
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-title-text"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(document.getElementsByTagName("title")[0].text,
|
||||
" title.text and space normalization ");
|
||||
assert_equals(document.getElementsByTagName("title")[0].textContent,
|
||||
" title.text and space normalization ");
|
||||
assert_equals(document.getElementsByTagName("title")[0].firstChild.nodeValue,
|
||||
" title.text and space normalization ");
|
||||
}, "title.text and space normalization (markup)");
|
||||
[
|
||||
"one space", "two spaces",
|
||||
"one\ttab", "two\t\ttabs",
|
||||
"one\nnewline", "two\n\nnewlines",
|
||||
"one\fform feed", "two\f\fform feeds",
|
||||
"one\rcarriage return", "two\r\rcarriage returns"
|
||||
].forEach(function(str) {
|
||||
test(function() {
|
||||
document.title = str;
|
||||
var title = document.getElementsByTagName("title")[0];
|
||||
assert_equals(title.text, str);
|
||||
assert_equals(title.textContent, str);
|
||||
assert_equals(title.firstChild.nodeValue, str);
|
||||
}, "title.text and space normalization: " + format_value(str))
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=UTF-8>
|
||||
<title>HTML Test: Text in the del element should be 'line-through'</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-del-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<p><del>crossed-off text</del></p>
|
||||
<div id="log"></div>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
var element = document.getElementsByTagName('del')[0],
|
||||
textDecoration = getComputedStyle(element).textDecorationLine ||
|
||||
getComputedStyle(element).textDecoration;
|
||||
assert_equals(textDecoration, 'line-through');
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=UTF-8>
|
||||
<title>HTML Test: Text in the ins element should be 'underline'</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ins-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<p><ins>underlined text</ins></p>
|
||||
<div id="log"></div>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
var element = document.getElementsByTagName('ins')[0],
|
||||
textDecoration = getComputedStyle(element).textDecorationLine ||
|
||||
getComputedStyle(element).textDecoration;
|
||||
assert_equals(textDecoration, 'underline');
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,10 @@
|
|||
[
|
||||
{
|
||||
"id": "authoring",
|
||||
"original_id": "authoring"
|
||||
},
|
||||
{
|
||||
"id": "processing-model-0",
|
||||
"original_id": "processing-model-0"
|
||||
}
|
||||
]
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Audio Test: audio_controls_present.html</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-controls" />
|
||||
<meta name="flags" content="" />
|
||||
<meta name="assert" content="Check if the controls attribute is present in the audio element that expecting the user agent exposes a controller user interface" />
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if a controller user interface appears below and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
|
||||
<audio id="m" controls>The user agent doesn't support media element.</audio>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Audio Test: audio_loop_base</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-loop" />
|
||||
<meta name="flags" content="" />
|
||||
<meta name="assert" content="Check if audio.loop is set to true that expecting the seeking event is fired more than once" />
|
||||
<meta name=timeout content=long>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<audio id="m" controls>The user agent doesn't support media element.</audio>
|
||||
<script type="text/javascript">
|
||||
var media = document.getElementById("m");
|
||||
var name = document.getElementsByName("assert")[0].content;
|
||||
var t = async_test(name);
|
||||
|
||||
var looped = false;
|
||||
|
||||
function startTest() {
|
||||
if (looped) {
|
||||
t.step(function() {
|
||||
assert_true(true, "looped");
|
||||
});
|
||||
t.done();
|
||||
media.pause();
|
||||
}
|
||||
|
||||
looped = true;
|
||||
}
|
||||
|
||||
media.addEventListener("seeking", startTest, false);
|
||||
media.loop = true;
|
||||
media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
media.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Audio Test: audio_loop_current_media_controller</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-loop" />
|
||||
<meta name="flags" content="" />
|
||||
<meta name="assert" content="Check if the audio element has a current media controller that expecting the loop attribute has no effect" />
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if the audio doesn't repeatly play and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
|
||||
<audio id="m" controls loop mediagroup="movie">The user agent doesn't support media element.</audio>
|
||||
<script type="text/javascript">
|
||||
var media = document.getElementById("m");
|
||||
var controller = new MediaController();
|
||||
|
||||
media.controller = controller;
|
||||
media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
media.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Audio Test: audio_muted_overriding_volume</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-muted" />
|
||||
<meta name="flags" content="" />
|
||||
<meta name="assert" content="Check if the muted attribute is present in the audio element with volume is set to loudest that expecting the user hears no sound" />
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if the audio is playing without sound output and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
|
||||
<audio id="m" controls muted>The user agent doesn't support media element.</audio>
|
||||
<script type="text/javascript">
|
||||
var media = document.getElementById("m");
|
||||
media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
media.volume = 1.0;
|
||||
media.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Audio Test: audio_muted_present</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-muted" />
|
||||
<meta name="flags" content="" />
|
||||
<meta name="assert" content="Check if the muted attribute is present in the audio element that expecting the user hears no sound" />
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if the audio is playing without sound output and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
|
||||
<audio id="m" controls muted>The user agent doesn't support media element.</audio>
|
||||
<script type="text/javascript">
|
||||
var media = document.getElementById("m");
|
||||
media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
media.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Audio Test: audio_volume_check</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
|
||||
<meta name="flags" content="" />
|
||||
<meta name="assert" content="Check that audio.volume returns the value of the muted content attribute" />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<audio id="m">The user agent doesn't support media element.</audio>
|
||||
<script type="text/javascript">
|
||||
var media = document.getElementById("m");
|
||||
var VOLUME = {
|
||||
'SILENT' : 0.0,
|
||||
'NORMAL' : 0.5,
|
||||
'LOUDEST' : 1.0,
|
||||
'LOWER' : -1.1,
|
||||
'UPPER' : 1.1,
|
||||
};
|
||||
|
||||
test(function() {
|
||||
assert_false(media.volume < VOLUME.SILENT || media.volume > VOLUME.LOUDEST, "media.volume outside the range 0.0 to 1.0 inclusive");
|
||||
}, "Check if the intial value of the audio.volume is in the range 0.0 to 1.0 inclusive");
|
||||
|
||||
function volume_setting(vol, name)
|
||||
{
|
||||
if (vol < VOLUME.SILENT || vol > VOLUME.LOUDEST) {
|
||||
try {
|
||||
media.volume = vol;
|
||||
test(function() {
|
||||
assert_true(false, "media.volume setting exception");
|
||||
}, name);
|
||||
} catch(e) {
|
||||
test(function() {
|
||||
// 1 should be e.IndexSizeError or e.INDEX_SIZE_ERR in previous spec
|
||||
assert_equals(e.code, 1, "media.volume setting exception");
|
||||
}, name);
|
||||
}
|
||||
} else {
|
||||
media.volume = vol;
|
||||
test(function() {
|
||||
assert_equals(media.volume, vol, "media.volume new value");
|
||||
}, name);
|
||||
}
|
||||
}
|
||||
|
||||
volume_setting(VOLUME.NORMAL, "Check if audio.volume is able to set to new value in the range 0.0 to 1.0");
|
||||
volume_setting(VOLUME.SILENT, "Check if media.volume is able to set to new value 0.0 as silent");
|
||||
volume_setting(VOLUME.LOUDEST, "Check if media.volume is able to set to new value 1.0 as loudest");
|
||||
volume_setting(VOLUME.LOWER, "Check if media.volume is set to new value less than 0.0 that expecting an IndexSizeError exception is to be thrown");
|
||||
volume_setting(VOLUME.UPPER, "Check if audio.volume is set to new value greater than 1.0 that expecting an IndexSizeError exception is to be thrown");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Audio Test: audio_volume_loudest</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
|
||||
<meta name="flags" content="" />
|
||||
<meta name="assert" content="Check if the volume attribute is set to 1.0 as loudest in the audio element that expecting the user hears sound loudly" />
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if the audio is playing with sound heard and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
|
||||
<audio id="m" controls>The user agent doesn't support media element.</audio>
|
||||
<script type="text/javascript">
|
||||
var media = document.getElementById("m");
|
||||
media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
media.volume = 1.0;
|
||||
media.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Audio Test: audio_volume_silent</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com" />
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-volume" />
|
||||
<meta name="flags" content="" />
|
||||
<meta name="assert" content="Check if the volume attribute is set to 0.0 as silent in the audio element that expecting the user hears no sound" />
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if the audio is playing without sound heard and the text 'The user agent doesn't support media element.' does not appear anywhere on this page</p>
|
||||
<audio id="m" controls volume=0.0>The user agent doesn't support media element.</audio>
|
||||
<script type="text/javascript">
|
||||
var media = document.getElementById("m");
|
||||
media.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
media.volume = 0.0;
|
||||
media.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,132 @@
|
|||
[
|
||||
{
|
||||
"id": "error-codes",
|
||||
"original_id": "error-codes"
|
||||
},
|
||||
{
|
||||
"id": "location-of-the-media-resource",
|
||||
"original_id": "location-of-the-media-resource"
|
||||
},
|
||||
{
|
||||
"id": "mime-types",
|
||||
"original_id": "mime-types"
|
||||
},
|
||||
{
|
||||
"id": "network-states",
|
||||
"original_id": "network-states"
|
||||
},
|
||||
{
|
||||
"id": "loading-the-media-resource",
|
||||
"original_id": "loading-the-media-resource"
|
||||
},
|
||||
{
|
||||
"id": "offsets-into-the-media-resource",
|
||||
"original_id": "offsets-into-the-media-resource"
|
||||
},
|
||||
{
|
||||
"id": "ready-states",
|
||||
"original_id": "ready-states"
|
||||
},
|
||||
{
|
||||
"id": "playing-the-media-resource",
|
||||
"original_id": "playing-the-media-resource"
|
||||
},
|
||||
{
|
||||
"id": "seeking",
|
||||
"original_id": "seeking"
|
||||
},
|
||||
{
|
||||
"id": "media-resources-with-multiple-media-tracks",
|
||||
"original_id": "media-resources-with-multiple-media-tracks",
|
||||
"children": [
|
||||
{
|
||||
"id": "audiotracklist-and-videotracklist-objects",
|
||||
"original_id": "audiotracklist-and-videotracklist-objects"
|
||||
},
|
||||
{
|
||||
"id": "selecting-specific-audio-and-video-tracks-declaratively",
|
||||
"original_id": "selecting-specific-audio-and-video-tracks-declaratively"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "synchronising-multiple-media-elements",
|
||||
"original_id": "synchronising-multiple-media-elements",
|
||||
"children": [
|
||||
{
|
||||
"id": "introduction-0",
|
||||
"original_id": "introduction-0"
|
||||
},
|
||||
{
|
||||
"id": "media-controllers",
|
||||
"original_id": "media-controllers"
|
||||
},
|
||||
{
|
||||
"id": "assigning-a-media-controller-declaratively",
|
||||
"original_id": "assigning-a-media-controller-declaratively"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "timed-text-tracks",
|
||||
"original_id": "timed-text-tracks",
|
||||
"children": [
|
||||
{
|
||||
"id": "text-track-model",
|
||||
"original_id": "text-track-model"
|
||||
},
|
||||
{
|
||||
"id": "sourcing-in-band-text-tracks",
|
||||
"original_id": "sourcing-in-band-text-tracks"
|
||||
},
|
||||
{
|
||||
"id": "sourcing-out-of-band-text-tracks",
|
||||
"original_id": "sourcing-out-of-band-text-tracks"
|
||||
},
|
||||
{
|
||||
"id": "guidelines-for-exposing-cues-in-various-formats-as-text-track-cues",
|
||||
"original_id": "guidelines-for-exposing-cues-in-various-formats-as-text-track-cues"
|
||||
},
|
||||
{
|
||||
"id": "text-track-api",
|
||||
"original_id": "text-track-api"
|
||||
},
|
||||
{
|
||||
"id": "text-tracks-describing-chapters",
|
||||
"original_id": "text-tracks-describing-chapters"
|
||||
},
|
||||
{
|
||||
"id": "cue-events",
|
||||
"original_id": "cue-events"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "user-interface",
|
||||
"original_id": "user-interface"
|
||||
},
|
||||
{
|
||||
"id": "time-ranges",
|
||||
"original_id": "time-ranges"
|
||||
},
|
||||
{
|
||||
"id": "event-definitions",
|
||||
"original_id": "event-definitions"
|
||||
},
|
||||
{
|
||||
"id": "mediaevents",
|
||||
"original_id": "mediaevents"
|
||||
},
|
||||
{
|
||||
"id": "security-and-privacy-considerations",
|
||||
"original_id": "security-and-privacy-considerations"
|
||||
},
|
||||
{
|
||||
"id": "best-practices-for-authors-using-media-elements",
|
||||
"original_id": "best-practices-for-authors-using-media-elements"
|
||||
},
|
||||
{
|
||||
"id": "best-practices-for-implementors-of-media-elements",
|
||||
"original_id": "best-practices-for-implementors-of-media-elements"
|
||||
}
|
||||
]
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<title>error</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function error_test(tagName, src) {
|
||||
test(function() {
|
||||
assert_equals(document.createElement(tagName).error, null);
|
||||
}, tagName + '.error initial value');
|
||||
|
||||
async_test(function(t) {
|
||||
var e = document.createElement(tagName);
|
||||
e.src = src;
|
||||
e.onloadeddata = t.step_func(function() {
|
||||
assert_equals(e.error, null);
|
||||
t.done();
|
||||
});
|
||||
}, tagName + '.error after successful load');
|
||||
|
||||
// TODO: MEDIA_ERR_ABORTED, MEDIA_ERR_NETWORK, MEDIA_ERR_DECODE
|
||||
|
||||
async_test(function(t) {
|
||||
var e = document.createElement(tagName);
|
||||
e.src = '';
|
||||
e.onerror = t.step_func(function() {
|
||||
assert_true(e.error instanceof MediaError);
|
||||
assert_equals(e.error.code, 4);
|
||||
assert_equals(e.error.code, e.error.MEDIA_ERR_SRC_NOT_SUPPORTED);
|
||||
t.done();
|
||||
});
|
||||
}, tagName + '.error after setting src to the empty string');
|
||||
}
|
||||
|
||||
error_test('audio', getAudioURI('/media/sound_5'));
|
||||
error_test('video', getVideoURI('/media/movie_5'));
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - canplay</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger canplay event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("canplay", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - canplay");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger canplay event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("canplay", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - canplay");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - canplay</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function () {
|
||||
var t = async_test("setting src attribute on non-autoplay audio should trigger canplay event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("canplay", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - canplay");
|
||||
|
||||
test(function () {
|
||||
var t = async_test("setting src attribute on non-autoplay video should trigger canplay event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("canplay", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - canplay");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - canplaythrough</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger canplaythrough event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("canplaythrough", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - canplaythrough");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger canplaythrough event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("canplaythrough", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - canplaythrough");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - canplaythrough</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay audio should trigger canplaythrough event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("canplaythrough", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - canplaythrough");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay video should trigger canplaythrough event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("canplaythrough", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - canplaythrough");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - loadeddata</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger loadeddata event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("loadeddata", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadeddata");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger loadeddata event", {timeout:5000});
|
||||
var a = document.getElementById("v");
|
||||
v.addEventListener("loadeddata", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadeddata");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - loadeddata</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay audio should trigger loadeddata event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("loadeddata", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadeddata");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay video should trigger loadeddata event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("loadeddata", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadeddata");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - loadedmetadata</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger loadedmetadata event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("loadedmetadata", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
});
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadedmetadata");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("loadedmetadata", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
});
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadedmetadata");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - loadedmetadata</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay audio should trigger loadedmetadata event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("loadedmetadata", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadedmetadata");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay video should trigger loadedmetadata event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("loadedmetadata", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events, loadedmetadata");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - loadstart</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger loadstart event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("loadstart", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadstart");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger loadstart event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("loadstart", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadstart");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - loadstart</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay audio should trigger loadstart event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("loadstart", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadstart");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay video should trigger loadstart event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("loadstart", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadstart");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,52 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - canplay, then canplaythrough</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger canplay then canplaythrough event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
var found_canplay = false;
|
||||
a.addEventListener("canplay", function() {
|
||||
found_canplay = true;
|
||||
});
|
||||
a.addEventListener("canplaythrough", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_canplay);
|
||||
});
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - canplay, then canplaythrough");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger canplay then canplaythrough event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
var found_canplay = false;
|
||||
v.addEventListener("canplay", function() {
|
||||
found_canplay = true;
|
||||
});
|
||||
v.addEventListener("canplaythrough", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_canplay);
|
||||
});
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - canplay, then canplaythrough");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,52 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - canplay, then playing</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger canplay then playing event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
var found_canplay = false;
|
||||
a.addEventListener("canplay", function() {
|
||||
found_canplay = true;
|
||||
});
|
||||
a.addEventListener("playing", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_canplay);
|
||||
});
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - canplay, then playing");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger canplay then playing event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
var found_canplay = false;
|
||||
v.addEventListener("canplay", function() {
|
||||
found_canplay = true;
|
||||
});
|
||||
v.addEventListener("playing", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_canplay);
|
||||
});
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - canplay, then playing");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,52 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - loadedmetadata, then loadeddata</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger loadedmetadata then loadeddata event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
var found_loadedmetadata = false;
|
||||
a.addEventListener("loadedmetadata", function() {
|
||||
found_loadedmetadata = true;
|
||||
});
|
||||
a.addEventListener("loadeddata", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_loadedmetadata);
|
||||
});
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadedmetadata, then loadeddata");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata then loadeddata event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
var found_loadedmetadata = false;
|
||||
v.addEventListener("loadedmetadata", function() {
|
||||
found_loadedmetadata = true;
|
||||
});
|
||||
v.addEventListener("loadeddata", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_loadedmetadata);
|
||||
});
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadedmetadata, then loadeddata");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,52 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - loadstart, then progress</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger loadstart then progress event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
var found_loadstart = false;
|
||||
a.addEventListener("loadstart", function() {
|
||||
found_loadstart = true;
|
||||
});
|
||||
a.addEventListener("progress", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_loadstart);
|
||||
});
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadstart, then progress");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger loadstart then progress event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
var found_loadstart = false;
|
||||
v.addEventListener("loadstart", function() {
|
||||
found_loadstart = true;
|
||||
});
|
||||
v.addEventListener("progress", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_loadstart);
|
||||
});
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadstart, then progress");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,48 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - pause</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("calling pause() on autoplay audio should trigger pause event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("pause", function() {
|
||||
t.step(function() {
|
||||
assert_true(true);
|
||||
});
|
||||
t.done();
|
||||
}, false);
|
||||
a.addEventListener("play", function() {
|
||||
a.pause(); // pause right after play
|
||||
});
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - pause");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("calling pause() on autoplay video should trigger pause event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("pause", function() {
|
||||
t.step(function() {
|
||||
assert_true(true);
|
||||
});
|
||||
t.done();
|
||||
}, false);
|
||||
v.addEventListener("play", function() {
|
||||
v.pause(); // pause right after play
|
||||
});
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - pause");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,40 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - pause</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("calling play() then pause() on non-autoplay audio should trigger pause event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("pause", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
a.play();
|
||||
a.pause();
|
||||
}, "audio events - pause");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("calling play() then pause() on non-autoplay video should trigger pause event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("pause", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
v.play();
|
||||
v.pause();
|
||||
}, "video events - pause");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - play</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger play event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("play", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - play");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger play event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("play", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - play");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,40 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - play</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("calling play() on audio should trigger play event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("play", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
a.play();
|
||||
}, "audio events - play");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("calling play() on video should trigger play event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("play", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
v.play();
|
||||
}, "video events - play");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - playing</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger playing event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("playing", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - playing");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger playing event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("playing", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - playing");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,40 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - playing</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("calling play() on audio should trigger playing event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("playing", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
});
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
a.play();
|
||||
}, "audio events - playing");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("calling play() on video should trigger playing event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("playing", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
});
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
v.play();
|
||||
}, "video events - playing");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - progress</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger progress event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("progress", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - progress");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger progress event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("progress", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - progress");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - progress</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay audio should trigger progress event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("progress", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - progress");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on non-autoplay video should trigger progress event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("progress", function() {
|
||||
t.done();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - progress");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,34 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - timeupdate</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" autoplay controls>
|
||||
</audio>
|
||||
<video id="v" autoplay controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var ta = async_test("setting src attribute on a sufficiently long autoplay audio should trigger timeupdate event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("timeupdate", function() {
|
||||
ta.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
|
||||
var tv = async_test("setting src attribute on a sufficiently long autoplay video should trigger timeupdate event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("timeupdate", function() {
|
||||
tv.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,40 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{audio,video} events - timeupdate</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/media.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p>
|
||||
<audio id="a" controls>
|
||||
</audio>
|
||||
<video id="v" controls>
|
||||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var t = async_test("calling play() on a sufficiently long audio should trigger timeupdate event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("timeupdate", function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
a.play();
|
||||
}, "audio events - timeupdate");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("calling play() on a sufficiently long video should trigger timeupdate event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("timeupdate", function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
v.play();
|
||||
}, "video events - timeupdate");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,72 @@
|
|||
<!doctype html>
|
||||
<title>volumechange event</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function volumechange_test(tagName) {
|
||||
async_test(function(t) {
|
||||
var e = document.createElement(tagName);
|
||||
assert_equals(e.volume, 1);
|
||||
e.volume = 0.5;
|
||||
assert_equals(e.volume, 0.5);
|
||||
e.onvolumechange = t.step_func(function() {
|
||||
assert_equals(e.volume, 0.5);
|
||||
e.volume = 1;
|
||||
assert_equals(e.volume, 1);
|
||||
e.onvolumechange = t.step_func(function() {
|
||||
assert_equals(e.volume, 1);
|
||||
t.done();
|
||||
});
|
||||
});
|
||||
}, "setting " + tagName + ".volume fires volumechange");
|
||||
|
||||
async_test(function(t) {
|
||||
var e = document.createElement(tagName);
|
||||
assert_false(e.muted);
|
||||
e.muted = true;
|
||||
assert_true(e.muted);
|
||||
e.onvolumechange = t.step_func(function() {
|
||||
assert_true(e.muted);
|
||||
e.muted = false;
|
||||
assert_false(e.muted);
|
||||
e.onvolumechange = t.step_func(function() {
|
||||
assert_false(e.muted);
|
||||
t.done();
|
||||
});
|
||||
});
|
||||
}, "setting " + tagName + ".muted fires volumechange");
|
||||
|
||||
async_test(function(t) {
|
||||
var e = document.createElement(tagName);
|
||||
e.volume = e.volume;
|
||||
e.muted = e.muted;
|
||||
e.onvolumechange = t.step_func(function() {
|
||||
assert_unreached();
|
||||
});
|
||||
var e2 = document.createElement(tagName);
|
||||
e2.muted = !e2.muted;
|
||||
e2.onvolumechange = t.step_func(function() {
|
||||
t.done();
|
||||
});
|
||||
}, "setting " + tagName + ".volume/muted to the same value does not fire volumechange");
|
||||
|
||||
async_test(function(t) {
|
||||
var e = document.createElement(tagName);
|
||||
e.muted = !e.muted;
|
||||
e.volume = 1 - e.volume;
|
||||
e.muted = !e.muted;
|
||||
e.volume = 1 - e.volume;
|
||||
var volumechange_count = 0;
|
||||
e.onvolumechange = t.step_func(function() {
|
||||
volumechange_count++;
|
||||
if (volumechange_count == 4) {
|
||||
t.done();
|
||||
}
|
||||
});
|
||||
}, "setting " + tagName + ".volume/muted repeatedly fires volumechange repeatedly");
|
||||
}
|
||||
|
||||
volumechange_test("audio");
|
||||
volumechange_test("video");
|
||||
</script>
|
|
@ -0,0 +1,46 @@
|
|||
<!doctype html>
|
||||
<title>Historical media element features should not be supported</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
function t(property, tagName) {
|
||||
var tagNames = tagName ? [tagName] : ['audio', 'video'];
|
||||
tagNames.forEach(function(tagName) {
|
||||
test(function() {
|
||||
assert_false(property in document.createElement(tagName));
|
||||
}, tagName + '.' + property + ' should not be supported');
|
||||
});
|
||||
}
|
||||
|
||||
t('bufferingRate'); // added in r678, removed in r2872.
|
||||
t('start'); // added in r692, removed in r2401.
|
||||
t('end'); // added in r692, removed in r2401.
|
||||
t('loopStart'); // added in r692, removed in r2401.
|
||||
t('loopEnd'); // added in r692, removed in r2401.
|
||||
t('loopCount'); // added in r692, replaced with playCount in r1105.
|
||||
t('currentLoop'); // added in r692, removed in r2401.
|
||||
t('addCuePoint'); // added in r721, replaced with addCueRange in r1106.
|
||||
t('removeCuePoint'); // added in r721, replaced with removeCueRanges in r1106.
|
||||
t('media', 'source'); // added in r724, removed in r8472.
|
||||
t('playCount'); // added in r1105, removed in r2401.
|
||||
t('addCueRange'); // added in r1106, removed in r5070.
|
||||
t('removeCueRanges'); // added in r1106, removed in r5070.
|
||||
t('pixelratio', 'source'); // added in r1629, removed in r2493.
|
||||
t('bufferedBytes'); // added in r1630, removed in r2405.
|
||||
t('totalBytes'); // added in r1630, removed in r2405.
|
||||
t('bufferingThrottled'); // added in r1632, removed in r2872.
|
||||
t('autobuffer'); // added in r2855, replaced with preload in r4811.
|
||||
t('startTime'); // added in r3035, replaced with initialTime in r5310.
|
||||
t('startOffsetTime'); // added in r5310, replaced with startDate in r7045.
|
||||
t('initialTime'); // added in r5310, removed in r7046.
|
||||
t('audio', 'video'); // added in r5636, replaced with muted in r5991.
|
||||
t('startDate'); // added in r7045, replaced with getStartDate() in r8113.
|
||||
|
||||
// TextTrackCue constructor: added in r5723, removed in r7742.
|
||||
test(function() {
|
||||
assert_throws(new TypeError(), function() {
|
||||
new TextTrackCue(0, 0, '');
|
||||
});
|
||||
}, 'TextTrackCue constructor should not be supported');
|
||||
</script>
|
|
@ -0,0 +1,116 @@
|
|||
<!doctype html>
|
||||
<title>HTMLMediaElement.addTextTrack</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var video = document.createElement('video');
|
||||
test(function(){
|
||||
assert_throws(new TypeError(), function(){
|
||||
video.addTextTrack('foo');
|
||||
});
|
||||
assert_throws(new TypeError(), function(){
|
||||
video.addTextTrack(undefined);
|
||||
});
|
||||
assert_throws(new TypeError(), function(){
|
||||
video.addTextTrack(null);
|
||||
});
|
||||
}, document.title + ' bogus first arg');
|
||||
|
||||
test(function(){
|
||||
assert_throws(new TypeError(), function(){
|
||||
video.addTextTrack('SUBTITLES');
|
||||
});
|
||||
}, document.title + ' uppercase first arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('subtitles');
|
||||
assert_equals(t.kind, 'subtitles');
|
||||
assert_equals(t.label, '');
|
||||
assert_equals(t.language, '');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' subtitles first arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('captions');
|
||||
assert_equals(t.kind, 'captions');
|
||||
assert_equals(t.label, '');
|
||||
assert_equals(t.language, '');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' captions first arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('descriptions');
|
||||
assert_equals(t.kind, 'descriptions');
|
||||
assert_equals(t.label, '');
|
||||
assert_equals(t.language, '');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' descriptions first arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('chapters');
|
||||
assert_equals(t.kind, 'chapters');
|
||||
assert_equals(t.label, '');
|
||||
assert_equals(t.language, '');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' chapters first arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('metadata');
|
||||
assert_equals(t.kind, 'metadata');
|
||||
assert_equals(t.label, '');
|
||||
assert_equals(t.language, '');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' metadata first arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('subtitles', undefined, undefined);
|
||||
assert_equals(t.kind, 'subtitles');
|
||||
assert_equals(t.label, '');
|
||||
assert_equals(t.language, '');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' undefined second and third arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('subtitles', null, null);
|
||||
assert_equals(t.kind, 'subtitles');
|
||||
assert_equals(t.label, 'null');
|
||||
assert_equals(t.language, 'null');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' null second and third arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('subtitles', 'foo', 'bar');
|
||||
assert_equals(t.kind, 'subtitles');
|
||||
assert_equals(t.label, 'foo');
|
||||
assert_equals(t.language, 'bar');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' foo and bar second and third arg');
|
||||
|
||||
test(function(){
|
||||
var t = video.addTextTrack('subtitles', 'foo');
|
||||
assert_equals(t.kind, 'subtitles');
|
||||
assert_equals(t.label, 'foo');
|
||||
assert_equals(t.language, '');
|
||||
assert_equals(t.mode, 'hidden');
|
||||
assert_true(t.cues instanceof TextTrackCueList);
|
||||
assert_equals(t.cues.length, 0);
|
||||
}, document.title + ' foo second arg, third arg omitted');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<title>HTMLMediaElement.textTracks</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
var video = document.createElement('video');
|
||||
test(function(){
|
||||
assert_equals(video.textTracks, video.textTracks);
|
||||
assert_equals(video.textTracks.length, 0);
|
||||
});
|
||||
|
||||
</script>
|
|
@ -0,0 +1,55 @@
|
|||
<!doctype html>
|
||||
<title>HTMLTrackElement.default</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
assert_equals(track['default'], false);
|
||||
assert_equals(track.getAttribute('default'), null);
|
||||
}, document.title + ' missing value');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('default', '');
|
||||
assert_equals(track['default'], true);
|
||||
assert_equals(track.getAttribute('default'), '');
|
||||
}, document.title + ' empty string content attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track['default'] = '';
|
||||
assert_equals(track['default'], false);
|
||||
assert_equals(track.getAttribute('default'), null);
|
||||
}, document.title + ' empty string IDL attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('default', 'foo');
|
||||
assert_equals(track['default'], true);
|
||||
assert_equals(track.getAttribute('default'), 'foo');
|
||||
}, document.title + ' foo in content attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track['default'] = 'foo';
|
||||
assert_equals(track['default'], true);
|
||||
assert_equals(track.getAttribute('default'), '');
|
||||
}, document.title + ' foo in IDL attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track['default'] = true;
|
||||
assert_equals(track['default'], true);
|
||||
assert_equals(track.getAttribute('default'), '');
|
||||
}, document.title + ' true in IDL attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('default', '');
|
||||
track['default'] = false;
|
||||
assert_equals(track['default'], false);
|
||||
assert_equals(track.getAttribute('default'), null);
|
||||
}, document.title + ' false in IDL attribute');
|
||||
</script>
|
|
@ -0,0 +1,146 @@
|
|||
<!doctype html>
|
||||
<title>HTMLTrackElement.kind</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
assert_equals(track.getAttribute('kind'), null);
|
||||
}, document.title + ' missing value');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'invalid');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
assert_equals(track.getAttribute('kind'), 'invalid');
|
||||
}, document.title + ' invalid value in content attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'CAPTIONS');
|
||||
assert_equals(track.kind, 'captions');
|
||||
assert_equals(track.getAttribute('kind'), 'CAPTIONS');
|
||||
}, document.title + ' content attribute uppercase');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'CAPT\u0130ONS');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
assert_equals(track.getAttribute('kind'), 'CAPT\u0130ONS');
|
||||
}, document.title + ' content attribute with uppercase turkish I (with dot)');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'capt\u0131ons');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
assert_equals(track.getAttribute('kind'), 'capt\u0131ons');
|
||||
}, document.title + ' content attribute with lowercase turkish i (dotless)');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'subtitles');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
assert_equals(track.getAttribute('kind'), 'subtitles');
|
||||
}, document.title + ' content attribute "subtitles"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'captions');
|
||||
assert_equals(track.kind, 'captions');
|
||||
assert_equals(track.getAttribute('kind'), 'captions');
|
||||
}, document.title + ' content attribute "captions"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'descriptions');
|
||||
assert_equals(track.kind, 'descriptions');
|
||||
assert_equals(track.getAttribute('kind'), 'descriptions');
|
||||
}, document.title + ' content attribute "descriptions"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'chapters');
|
||||
assert_equals(track.kind, 'chapters');
|
||||
assert_equals(track.getAttribute('kind'), 'chapters');
|
||||
}, document.title + ' content attribute "chapters"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'metadata');
|
||||
assert_equals(track.kind, 'metadata');
|
||||
assert_equals(track.getAttribute('kind'), 'metadata');
|
||||
}, document.title + ' content attribute "metadata"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('kind', 'captions\u0000');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
assert_equals(track.getAttribute('kind'), 'captions\u0000');
|
||||
}, document.title + ' content attribute "captions\\u0000"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'subtitles';
|
||||
assert_equals(track.getAttribute('kind'), 'subtitles');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
}, document.title + ' setting IDL attribute to "subtitles"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'captions';
|
||||
assert_equals(track.getAttribute('kind'), 'captions');
|
||||
assert_equals(track.kind, 'captions');
|
||||
}, document.title + ' setting IDL attribute to "captions"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'descriptions';
|
||||
assert_equals(track.getAttribute('kind'), 'descriptions');
|
||||
assert_equals(track.kind, 'descriptions');
|
||||
}, document.title + ' setting IDL attribute to "descriptions"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'chapters';
|
||||
assert_equals(track.getAttribute('kind'), 'chapters');
|
||||
assert_equals(track.kind, 'chapters');
|
||||
}, document.title + ' setting IDL attribute to "chapters"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'metadata';
|
||||
assert_equals(track.getAttribute('kind'), 'metadata');
|
||||
assert_equals(track.kind, 'metadata');
|
||||
}, document.title + ' setting IDL attribute to "metadata"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'CAPTIONS';
|
||||
assert_equals(track.getAttribute('kind'), 'CAPTIONS');
|
||||
assert_equals(track.kind, 'captions');
|
||||
}, document.title + ' setting IDL attribute to "CAPTIONS"');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'CAPT\u0130ONS';
|
||||
assert_equals(track.getAttribute('kind'), 'CAPT\u0130ONS');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
}, document.title + ' setting IDL attribute with uppercase turkish I (with dot)');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'capt\u0131ons';
|
||||
assert_equals(track.getAttribute('kind'), 'capt\u0131ons');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
}, document.title + ' setting IDL attribute with lowercase turkish I (dotless)');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.kind = 'captions\u0000';
|
||||
assert_equals(track.getAttribute('kind'), 'captions\u0000');
|
||||
assert_equals(track.kind, 'subtitles');
|
||||
}, document.title + ' setting IDL attribute with \\u0000');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,83 @@
|
|||
<!doctype html>
|
||||
<title>HTMLTrackElement.label</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
assert_equals(track.label, '');
|
||||
assert_equals(track.getAttribute('label'), null);
|
||||
}, document.title + ' missing value');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('label', '');
|
||||
assert_equals(track.label, '');
|
||||
assert_equals(track.getAttribute('label'), '');
|
||||
}, document.title + ' empty string content attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.label = '';
|
||||
assert_equals(track.label, '');
|
||||
assert_equals(track.getAttribute('label'), '');
|
||||
}, document.title + ' empty string IDL attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('label', 'foo');
|
||||
assert_equals(track.label, 'foo');
|
||||
assert_equals(track.getAttribute('label'), 'foo');
|
||||
}, document.title + ' lowercase content attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('label', 'FOO');
|
||||
assert_equals(track.label, 'FOO');
|
||||
assert_equals(track.getAttribute('label'), 'FOO');
|
||||
}, document.title + ' uppercase content attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('label', '\u0000');
|
||||
assert_equals(track.label, '\u0000');
|
||||
assert_equals(track.getAttribute('label'), '\u0000');
|
||||
}, document.title + '\\u0000 in content attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.label = 'foo';
|
||||
assert_equals(track.label, 'foo');
|
||||
assert_equals(track.getAttribute('label'), 'foo');
|
||||
}, document.title + ' lowercase IDL attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.label = 'FOO';
|
||||
assert_equals(track.label, 'FOO');
|
||||
assert_equals(track.getAttribute('label'), 'FOO');
|
||||
}, document.title + ' uppercase IDL attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.setAttribute('label', ' foo \n');
|
||||
assert_equals(track.label, ' foo \n');
|
||||
assert_equals(track.getAttribute('label'), ' foo \n');
|
||||
}, document.title + ' whitespace in content attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.label = ' foo \n';
|
||||
assert_equals(track.label, ' foo \n');
|
||||
assert_equals(track.getAttribute('label'), ' foo \n');
|
||||
}, document.title + ' whitespace in IDL attribute');
|
||||
|
||||
test(function(){
|
||||
var track = document.createElement('track');
|
||||
track.label = '\u0000';
|
||||
assert_equals(track.label, '\u0000');
|
||||
assert_equals(track.getAttribute('label'), '\u0000');
|
||||
}, document.title + ' \\u0000 in IDL attribute');
|
||||
|
||||
</script>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue