Bug 1102907 - Update web-platform-tests to revision 6e35a4cd58f8fa507fc90b9d7b7ff28153759cac, a=testonly

This commit is contained in:
James Graham 2015-01-13 09:42:41 +00:00
Родитель 2f219284b3
Коммит bd14f99bee
25 изменённых файлов: 271 добавлений и 15235 удалений

Просмотреть файл

@ -1003,18 +1003,6 @@
{
"url": "/app-uri/resources/icons/w3c-48.png"
},
{
"url": "/app-uri/resources/idlharness.js"
},
{
"url": "/app-uri/resources/testharness.css"
},
{
"url": "/app-uri/resources/testharness.js"
},
{
"url": "/app-uri/resources/testharnessreport.js"
},
{
"url": "/battery-status/battery-interface.js"
},
@ -2779,24 +2767,6 @@
{
"url": "/old-tests/submission/Infraware/Session_History/contents/Session_History/css/result.css"
},
{
"url": "/old-tests/submission/Infraware/Session_History/resources/WebIDLParser.js"
},
{
"url": "/old-tests/submission/Infraware/Session_History/resources/idlharness.js"
},
{
"url": "/old-tests/submission/Infraware/Session_History/resources/readme.md"
},
{
"url": "/old-tests/submission/Infraware/Session_History/resources/testharness.css"
},
{
"url": "/old-tests/submission/Infraware/Session_History/resources/testharness.js"
},
{
"url": "/old-tests/submission/Infraware/Session_History/resources/testharnessreport.js"
},
{
"url": "/old-tests/submission/Microsoft/dragdrop/dragdrop_support.js"
},
@ -4288,6 +4258,9 @@
{
"url": "/workers/semantics/encodings/003-1.py"
},
{
"url": "/workers/semantics/interface-objects/001.worker.js"
},
{
"url": "/workers/semantics/multiple-workers/004-2.js"
},
@ -17278,9 +17251,6 @@
{
"url": "/workers/semantics/encodings/004.html"
},
{
"url": "/workers/semantics/interface-objects/001.html"
},
{
"url": "/workers/semantics/interface-objects/002.html"
},
@ -17928,6 +17898,6 @@
"deleted": [],
"items": {}
},
"rev": "a84b794c43954b4465eb9b967cc934875952fc40",
"rev": "6e35a4cd58f8fa507fc90b9d7b7ff28153759cac",
"url_base": "/"
}

Просмотреть файл

@ -19,101 +19,101 @@
setup({explicit_done: true});
function testException(exception, global, desc) {
// https://heycam.github.io/webidl/#es-exception-objects
// (as of 2015-01-03): "The value of the internal [[Prototype]] property of a
// DOMException object MUST be the DOMException prototype object from the
// global environment the exception object is associated with."
test(function() {
assert_equals(global.Object.getPrototypeOf(exception),
global.DOMException.prototype);
}, desc + "Object.getPrototypeOf(exception) === DOMException.prototype");
// https://heycam.github.io/webidl/#es-exception-objects
// (as of 2015-01-03): "The value of the internal [[Prototype]] property of a
// DOMException object MUST be the DOMException prototype object from the
// global environment the exception object is associated with."
test(function() {
assert_equals(global.Object.getPrototypeOf(exception),
global.DOMException.prototype);
}, desc + "Object.getPrototypeOf(exception) === DOMException.prototype");
// https://heycam.github.io/webidl/#es-creating-throwing-exceptions
// (as of 2015-01-03): "Call the [[DefineOwnProperty]] internal method of /O/
// passing “name”, Property Descriptor { [[Value]]: /N/, [[Writable]]: true,
// [[Enumerable]]: true, [[Configurable]]: true }, and false as arguments."
test(function() {
assert_true(exception.hasOwnProperty("name"));
}, desc + "exception.hasOwnProperty(\"name\")");
// https://heycam.github.io/webidl/#es-creating-throwing-exceptions
// (as of 2015-01-03): "Call the [[DefineOwnProperty]] internal method of /O/
// passing “name”, Property Descriptor { [[Value]]: /N/, [[Writable]]: true,
// [[Enumerable]]: true, [[Configurable]]: true }, and false as arguments."
test(function() {
assert_true(exception.hasOwnProperty("name"));
}, desc + "exception.hasOwnProperty(\"name\")");
test(function() {
assert_equals(exception.name, "HierarchyRequestError");
}, desc + "exception.name === \"HierarchyRequestError\"");
test(function() {
assert_equals(exception.name, "HierarchyRequestError");
}, desc + "exception.name === \"HierarchyRequestError\"");
test(function() {
var desc = global.Object.getOwnPropertyDescriptor(exception, "name");
assert_true(desc.writable, "must be writable");
assert_true(desc.enumerable, "must be enumerable");
assert_true(desc.configurable, "must be configurable");
}, desc + "Object.getOwnPropertyDescriptor(exception, \"name\")");
test(function() {
var desc = global.Object.getOwnPropertyDescriptor(exception, "name");
assert_true(desc.writable, "must be writable");
assert_true(desc.enumerable, "must be enumerable");
assert_true(desc.configurable, "must be configurable");
}, desc + "Object.getOwnPropertyDescriptor(exception, \"name\")");
// https://heycam.github.io/webidl/#es-creating-throwing-exceptions
// (as of 2015-01-03): "If the optional user agent-defined message /M/ was
// specified, then this list has a single element whose value is the result
// of converting /M/ to a String value. Otherwise, the list is empty."
//
// https://heycam.github.io/webidl/#es-DOMException-constructor-object
// (as of 2015-01-03): "Call the [[DefineOwnProperty]] internal method of /O/
// passing “message”, Property Descriptor { [[Value]]: /S/,
// [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }, and
// false as arguments."
test(function() {
if (exception.hasOwnProperty("message")) {
var desc = global.Object.getOwnPropertyDescriptor(exception, "message");
assert_true(desc.writable, "must be writable");
assert_false(desc.enumerable, "must not be enumerable");
assert_true(desc.configurable, "must be configurable");
}
}, desc + "Object.getOwnPropertyDescriptor(exception, \"message\")");
// https://heycam.github.io/webidl/#es-creating-throwing-exceptions
// (as of 2015-01-03): "If the optional user agent-defined message /M/ was
// specified, then this list has a single element whose value is the result
// of converting /M/ to a String value. Otherwise, the list is empty."
//
// https://heycam.github.io/webidl/#es-DOMException-constructor-object
// (as of 2015-01-03): "Call the [[DefineOwnProperty]] internal method of /O/
// passing “message”, Property Descriptor { [[Value]]: /S/,
// [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }, and
// false as arguments."
test(function() {
if (exception.hasOwnProperty("message")) {
var desc = global.Object.getOwnPropertyDescriptor(exception, "message");
assert_true(desc.writable, "must be writable");
assert_false(desc.enumerable, "must not be enumerable");
assert_true(desc.configurable, "must be configurable");
}
}, desc + "Object.getOwnPropertyDescriptor(exception, \"message\")");
test(function() {
if (exception.hasOwnProperty("message")) {
// Can't test anything more specific, since it's implementation-defined :(
assert_equals(typeof exception.message, "string");
} else {
// Error.prototype.message
assert_equals(exception.message, "");
}
}, desc + "typeof exception.message === \"string\"");
test(function() {
if (exception.hasOwnProperty("message")) {
// Can't test anything more specific, since it's implementation-defined :(
assert_equals(typeof exception.message, "string");
} else {
// Error.prototype.message
assert_equals(exception.message, "");
}
}, desc + "typeof exception.message === \"string\"");
// https://heycam.github.io/webidl/#es-exception-objects
// (as of 2015-01-03): "The class string of a DOMException object MUST be
// “DOMException”."
test(function() {
assert_equals(global.Object.prototype.toString.call(exception),
"[object DOMException]");
}, desc + "Object.prototype.toString.call(exception) === \"[object DOMException]\"");
// https://heycam.github.io/webidl/#es-exception-objects
// (as of 2015-01-03): "The class string of a DOMException object MUST be
// “DOMException”."
test(function() {
assert_equals(global.Object.prototype.toString.call(exception),
"[object DOMException]");
}, desc + "Object.prototype.toString.call(exception) === \"[object DOMException]\"");
// https://heycam.github.io/webidl/#es-creating-throwing-exceptions
// (as of 2015-01-03): "Call the [[DefineOwnProperty]] internal method of /O/
// passing “code”, Property Descriptor { [[Value]]: /code/,
// [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }, and
// false as arguments."
test(function() {
assert_equals(exception.code, global.DOMException.HIERARCHY_REQUEST_ERR);
}, desc + "exception.code === DOMException.HIERARCHY_REQUEST_ERR");
// https://heycam.github.io/webidl/#es-creating-throwing-exceptions
// (as of 2015-01-03): "Call the [[DefineOwnProperty]] internal method of /O/
// passing “code”, Property Descriptor { [[Value]]: /code/,
// [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }, and
// false as arguments."
test(function() {
assert_equals(exception.code, global.DOMException.HIERARCHY_REQUEST_ERR);
}, desc + "exception.code === DOMException.HIERARCHY_REQUEST_ERR");
test(function() {
var desc = global.Object.getOwnPropertyDescriptor(exception, "name");
assert_true(desc.writable, "must be writable");
assert_true(desc.enumerable, "must be enumerable");
assert_true(desc.configurable, "must be configurable");
}, desc + "Object.getOwnPropertyDescriptor(exception, \"code\")");
test(function() {
var desc = global.Object.getOwnPropertyDescriptor(exception, "name");
assert_true(desc.writable, "must be writable");
assert_true(desc.enumerable, "must be enumerable");
assert_true(desc.configurable, "must be configurable");
}, desc + "Object.getOwnPropertyDescriptor(exception, \"code\")");
}
// Test in current window
var exception = null;
try {
// This should throw a HierarchyRequestError in every browser since the
// Stone Age, so we're really only testing exception-throwing details.
document.documentElement.appendChild(document);
// This should throw a HierarchyRequestError in every browser since the
// Stone Age, so we're really only testing exception-throwing details.
document.documentElement.appendChild(document);
} catch(e) {
exception = e;
exception = e;
}
testException(exception, window, "");
@ -121,16 +121,16 @@ testException(exception, window, "");
var iframe = document.createElement("iframe");
iframe.src = "about:blank";
iframe.onload = function() {
var exception = null;
try {
iframe.contentDocument.documentElement.appendChild(iframe.contentDocument);
} catch(e) {
exception = e;
}
testException(exception, iframe.contentWindow, "In iframe: ");
var exception = null;
try {
iframe.contentDocument.documentElement.appendChild(iframe.contentDocument);
} catch(e) {
exception = e;
}
testException(exception, iframe.contentWindow, "In iframe: ");
document.body.removeChild(iframe);
done();
document.body.removeChild(iframe);
done();
};
document.body.appendChild(iframe);
</script>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,92 +0,0 @@
html {
font-family:DejaVu Sans, Bitstream Vera Sans, Arial, Sans;
}
#log .warning,
#log .warning a {
color: black;
background: yellow;
}
#log .error,
#log .error a {
color: white;
background: red;
}
#log pre {
border: 1px solid black;
padding: 1em;
}
section#summary {
margin-bottom:1em;
}
table#results {
border-collapse:collapse;
table-layout:fixed;
width:100%;
}
table#results th:first-child,
table#results td:first-child {
width:4em;
}
table#results th:last-child,
table#results td:last-child {
width:50%;
}
table#results.assertions th:last-child,
table#results.assertions td:last-child {
width:35%;
}
table#results th {
padding:0;
padding-bottom:0.5em;
border-bottom:medium solid black;
}
table#results td {
padding:1em;
padding-bottom:0.5em;
border-bottom:thin solid black;
}
tr.pass > td:first-child {
color:green;
}
tr.fail > td:first-child {
color:red;
}
tr.timeout > td:first-child {
color:red;
}
tr.notrun > td:first-child {
color:blue;
}
.pass > td:first-child, .fail > td:first-child, .timeout > td:first-child, .notrun > td:first-child {
font-variant:small-caps;
}
table#results span {
display:block;
}
table#results span.expected {
font-family:DejaVu Sans Mono, Bitstream Vera Sans Mono, Monospace;
white-space:pre;
}
table#results span.actual {
font-family:DejaVu Sans Mono, Bitstream Vera Sans Mono, Monospace;
white-space:pre;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,380 +0,0 @@
/*
* This file is intended for vendors to implement
* code needed to integrate testharness.js tests with their own test systems.
*
* The default implementation extracts metadata from the tests and validates
* it against the cached version that should be present in the test source
* file. If the cache is not found or is out of sync, source code suitable for
* caching the metadata is optionally generated.
*
* The cached metadata is present for extraction by test processing tools that
* are unable to execute javascript.
*
* Metadata is attached to tests via the properties parameter in the test
* constructor. See testharness.js for details.
*
* Typically test system integration will attach callbacks when each test has
* run, using add_result_callback(callback(test)), or when the whole test file
* has completed, using
* add_completion_callback(callback(tests, harness_status)).
*
* For more documentation about the callback functions and the
* parameters they are called with see testharness.js
*/
var metadata_generator = {
currentMetadata: {},
cachedMetadata: false,
metadataProperties: ['help', 'assert', 'author'],
error: function(message) {
var messageElement = document.createElement('p');
messageElement.setAttribute('class', 'error');
this.appendText(messageElement, message);
var summary = document.getElementById('summary');
if (summary) {
summary.parentNode.insertBefore(messageElement, summary);
}
else {
document.body.appendChild(messageElement);
}
},
/**
* Ensure property value has contact information
*/
validateContact: function(test, propertyName) {
var result = true;
var value = test.properties[propertyName];
var values = Array.isArray(value) ? value : [value];
for (var index = 0; index < values.length; index++) {
value = values[index];
var re = /(\S+)(\s*)<(.*)>(.*)/;
if (! re.test(value)) {
re = /(\S+)(\s+)(http[s]?:\/\/)(.*)/
if (! re.test(value)) {
this.error('Metadata property "' + propertyName +
'" for test: "' + test.name +
'" must have name and contact information ' +
'("name <email>" or "name http(s)://")');
result = false;
}
}
}
return result;
},
/**
* Extract metadata from test object
*/
extractFromTest: function(test) {
var testMetadata = {};
// filter out metadata from other properties in test
for (var metaIndex = 0; metaIndex < this.metadataProperties.length;
metaIndex++) {
var meta = this.metadataProperties[metaIndex];
if (test.properties.hasOwnProperty(meta)) {
if ('author' == meta) {
this.validateContact(test, meta);
}
testMetadata[meta] = test.properties[meta];
}
}
return testMetadata;
},
/**
* Compare cached metadata to extracted metadata
*/
validateCache: function() {
for (var testName in this.currentMetadata) {
if (! this.cachedMetadata.hasOwnProperty(testName)) {
return false;
}
var testMetadata = this.currentMetadata[testName];
var cachedTestMetadata = this.cachedMetadata[testName];
delete this.cachedMetadata[testName];
for (var metaIndex = 0; metaIndex < this.metadataProperties.length;
metaIndex++) {
var meta = this.metadataProperties[metaIndex];
if (cachedTestMetadata.hasOwnProperty(meta) &&
testMetadata.hasOwnProperty(meta)) {
if (Array.isArray(cachedTestMetadata[meta])) {
if (! Array.isArray(testMetadata[meta])) {
return false;
}
if (cachedTestMetadata[meta].length ==
testMetadata[meta].length) {
for (var index = 0;
index < cachedTestMetadata[meta].length;
index++) {
if (cachedTestMetadata[meta][index] !=
testMetadata[meta][index]) {
return false;
}
}
}
else {
return false;
}
}
else {
if (Array.isArray(testMetadata[meta])) {
return false;
}
if (cachedTestMetadata[meta] != testMetadata[meta]) {
return false;
}
}
}
else if (cachedTestMetadata.hasOwnProperty(meta) ||
testMetadata.hasOwnProperty(meta)) {
return false;
}
}
}
for (var testName in this.cachedMetadata) {
return false;
}
return true;
},
appendText: function(elemement, text) {
elemement.appendChild(document.createTextNode(text));
},
jsonifyArray: function(arrayValue, indent) {
var output = '[';
if (1 == arrayValue.length) {
output += JSON.stringify(arrayValue[0]);
}
else {
for (var index = 0; index < arrayValue.length; index++) {
if (0 < index) {
output += ',\n ' + indent;
}
output += JSON.stringify(arrayValue[index]);
}
}
output += ']';
return output;
},
jsonifyObject: function(objectValue, indent) {
var output = '{';
var count = 0;
for (var property in objectValue) {
++count;
if (Array.isArray(objectValue[property]) ||
('object' == typeof(value))) {
++count;
}
}
if (1 == count) {
for (var property in objectValue) {
output += ' "' + property + '": '
+ JSON.stringify(objectValue[property])
+ ' ';
}
}
else {
var first = true;
for (var property in objectValue) {
if (! first) {
output += ',';
}
first = false;
output += '\n ' + indent + '"' + property + '": ';
var value = objectValue[property];
if (Array.isArray(value)) {
output += this.jsonifyArray(value, indent +
' '.substr(0, 5 + property.length));
}
else if ('object' == typeof(value)) {
output += this.jsonifyObject(value, indent + ' ');
}
else {
output += JSON.stringify(value);
}
}
if (1 < output.length) {
output += '\n' + indent;
}
}
output += '}';
return output;
},
/**
* Generate javascript source code for captured metadata
* Metadata is in pretty-printed JSON format
*/
generateSource: function() {
var source =
'<script id="metadata_cache">/*\n' +
this.jsonifyObject(this.currentMetadata, '') + '\n' +
'*/</script>\n';
return source;
},
/**
* Add element containing metadata source code
*/
addSourceElement: function(event) {
var sourceWrapper = document.createElement('div');
sourceWrapper.setAttribute('id', 'metadata_source');
var instructions = document.createElement('p');
if (this.cachedMetadata) {
this.appendText(instructions,
'Replace the existing <script id="metadata_cache"> element ' +
'in the test\'s <head> with the following:');
}
else {
this.appendText(instructions,
'Copy the following into the <head> element of the test ' +
'or the test\'s metadata sidecar file:');
}
sourceWrapper.appendChild(instructions);
var sourceElement = document.createElement('pre');
this.appendText(sourceElement, this.generateSource());
sourceWrapper.appendChild(sourceElement);
var messageElement = document.getElementById('metadata_issue');
messageElement.parentNode.insertBefore(sourceWrapper,
messageElement.nextSibling);
messageElement.parentNode.removeChild(messageElement);
(event.preventDefault) ? event.preventDefault() :
event.returnValue = false;
},
/**
* Extract the metadata cache from the cache element if present
*/
getCachedMetadata: function() {
var cacheElement = document.getElementById('metadata_cache');
if (cacheElement) {
var cacheText = cacheElement.firstChild.nodeValue;
var openBrace = cacheText.indexOf('{');
var closeBrace = cacheText.lastIndexOf('}');
if ((-1 < openBrace) && (-1 < closeBrace)) {
cacheText = cacheText.slice(openBrace, closeBrace + 1);
try {
this.cachedMetadata = JSON.parse(cacheText);
}
catch (exc) {
this.cachedMetadata = 'Invalid JSON in Cached metadata. ';
}
}
else {
this.cachedMetadata = 'Metadata not found in cache element. ';
}
}
},
/**
* Main entry point, extract metadata from tests, compare to cached version
* if present.
* If cache not present or differs from extrated metadata, generate an error
*/
process: function(tests, harness_status) {
for (var index = 0; index < tests.length; index++) {
var test = tests[index];
if (this.currentMetadata.hasOwnProperty(test.name)) {
this.error('Duplicate test name: ' + test.name);
}
else {
this.currentMetadata[test.name] = this.extractFromTest(test);
}
}
this.getCachedMetadata();
var message = null;
var messageClass = 'warning';
var showSource = false;
if (0 == tests.length) {
if (this.cachedMetadata) {
message = 'Cached metadata present but no tests. ';
}
}
else if (1 == tests.length) {
if (this.cachedMetadata) {
message = 'Single test files should not have cached metadata. ';
}
else {
var testMetadata = this.currentMetadata[tests[0].name];
var hasMetadata = false;
for (var meta in testMetadata) {
hasMetadata |= testMetadata.hasOwnProperty(meta);
}
if (hasMetadata) {
message = 'Single tests should not have metadata. ' +
'Move metadata to <head>. ';
}
}
}
else {
if (this.cachedMetadata) {
messageClass = 'error';
if ('string' == typeof(this.cachedMetadata)) {
message = this.cachedMetadata;
showSource = true;
}
else if (! this.validateCache()) {
message = 'Cached metadata out of sync. ';
showSource = true;
}
}
}
if (message) {
var messageElement = document.createElement('p');
messageElement.setAttribute('id', 'metadata_issue');
messageElement.setAttribute('class', messageClass);
this.appendText(messageElement, message);
if (showSource) {
var link = document.createElement('a');
this.appendText(link, 'Click for source code.');
link.setAttribute('href', '#');
link.setAttribute('onclick',
'metadata_generator.addSourceElement(event)');
messageElement.appendChild(link);
}
var summary = document.getElementById('summary');
if (summary) {
summary.parentNode.insertBefore(messageElement, summary);
}
else {
var log = document.getElementById('log');
if (log) {
log.appendChild(messageElement);
}
}
}
},
setup: function() {
add_completion_callback(
function (tests, harness_status) {
metadata_generator.process(tests, harness_status)
});
}
}
metadata_generator.setup();
// vim: set expandtab shiftwidth=4 tabstop=4:

Просмотреть файл

@ -31,7 +31,7 @@
}
}
var reportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=take&timeout=3&reportID=" + reportID;
var reportLocation = location.protocol + "//" + location.host + "/content-security-policy/support/report.py?op=take&timeout=5&reportID=" + reportID;
var reportTest = async_test("Violation report status OK.");
reportTest.step(function () {

Просмотреть файл

@ -185,6 +185,28 @@ generation. This is supported through the
[wptserve](http://github.com/w3c/wptserve) server. Several scenarios
in particular are common:
### Standalone workers tests
Tests that only require assertions in a dedicated worker scope can use
standalone workers tests. In this case, the test is a JavaScript file
with extension `.worker.js` that imports `testharness.js`. The test can
then use all the usual APIs, and can be run from the path to the
JavaScript file with the `.js` removed.
For example, one could write a test for the `Blob` constructor by
creating a `FileAPI/Blob-constructor.worker.js` as follows:
importScripts("/resources/testharness.js");
test(function () {
var blob = new Blob();
assert_equals(blob.size, 0);
assert_equals(blob.type, "");
assert_false(blob.isClosed);
}, "The Blob constructor.");
done();
This test could then be run from `FileAPI/Blob-constructor.worker`.
### Tests Involving Multiple Origins
In the test environment, five subdomains are available; `www`, `www1`,

Просмотреть файл

@ -58,7 +58,7 @@ function test_getElementsByTagNameNS(context, element) {
var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "abc"))
this.add_cleanup(function() {element.removeChild(t)})
assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "abc"), [t]);
assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "ABC"), []);
assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "ABC"), []);
assert_array_equals(context.getElementsByTagNameNS("test", "ABC"), []);
}, "abc element in html namespace")

Просмотреть файл

@ -6,30 +6,47 @@
<div id="log"></div>
<iframe src=about:blank></iframe>
<script>
var frameDoc = frames[0].document;
for (var p in creators) {
var creator = creators[p];
test(function() {
var s = frameDoc[creator]("a")
assert_equals(s.ownerDocument, frameDoc)
assert_throws("NOT_FOUND_ERR", function() { document.body.removeChild(s) })
assert_equals(s.ownerDocument, frameDoc)
}, "Passing a detached " + p + " with a different node document to removeChild should not affect it.")
test(function() {
var s = frameDoc[creator]("b")
frameDoc.body.appendChild(s)
assert_equals(s.ownerDocument, frameDoc)
assert_throws("NOT_FOUND_ERR", function() { document.body.removeChild(s) })
assert_equals(s.ownerDocument, frameDoc)
}, "Passing a non-detached " + p + " with a different node document to removeChild should not affect it.")
test(function() {
var s = frameDoc[creator]("test")
frameDoc.body.appendChild(s)
assert_equals(s.ownerDocument, frameDoc)
assert_throws("NOT_FOUND_ERR", function() { s.removeChild(frameDoc) })
assert_throws("NOT_FOUND_ERR", function() { s.removeChild(document) })
}, "Calling removeChild on a " + p + " with no children should throw NOT_FOUND_ERR.")
}
var documents = [
[function() { return document }, "the main document"],
[function() { return frames[0].document }, "a frame document"],
[function() { return document.implementation.createHTMLDocument() },
"a synthetic document"],
];
documents.forEach(function(d) {
var get = d[0], description = d[1]
for (var p in creators) {
var creator = creators[p];
test(function() {
var doc = get();
var s = doc[creator]("a")
assert_equals(s.ownerDocument, doc)
assert_throws("NOT_FOUND_ERR", function() { document.body.removeChild(s) })
assert_equals(s.ownerDocument, doc)
}, "Passing a detached " + p + " from " + description +
" to removeChild should not affect it.")
test(function() {
var doc = get();
var s = doc[creator]("b")
doc.documentElement.appendChild(s)
assert_equals(s.ownerDocument, doc)
assert_throws("NOT_FOUND_ERR", function() { document.body.removeChild(s) })
assert_equals(s.ownerDocument, doc)
}, "Passing a non-detached " + p + " from " + description +
" to removeChild should not affect it.")
test(function() {
var doc = get();
var s = doc[creator]("test")
doc.body.appendChild(s)
assert_equals(s.ownerDocument, doc)
assert_throws("NOT_FOUND_ERR", function() { s.removeChild(doc) })
}, "Calling removeChild on a " + p + " from " + description +
" with no children should throw NOT_FOUND_ERR.")
}
});
test(function() {
assert_throws(new TypeError(), function() { document.body.removeChild(null) })
assert_throws(new TypeError(), function() { document.body.removeChild({'a':'b'}) })

Просмотреть файл

@ -5,32 +5,43 @@
<div id="log"></div>
<script>
var d = new Date();
var localTimeFormatted = ("0" + (d.getHours())).slice(-2)
+ ":" + ("0" + (d.getMinutes())).slice(-2);
var last_modified = document.lastModified;
var initial_modified = Date.parse(last_modified) / 1000;
var expected = Math.round(d / 1000);
test(function() {
assert_equals(document.lastModified.substring(11, 16), localTimeFormatted,
"Hours and minutes should match local time.");
}, "Date returned by lastModified is in the user's local time zone.");
var lastMod = document.lastModified;
var pattern = /[0-9]{2}\/[0-9]{2}\/[0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2}/
var currentDate = new Date();
var month = ("0" + (currentDate.getMonth() + 1)).slice(-2)
var day = ("0" + (currentDate.getDate())).slice(-2)
var year = currentDate.getFullYear().toString()
var hours = ("0" + (currentDate.getHours())).slice(-2)
var minutes = ("0" + (currentDate.getMinutes())).slice(-2)
var seconds = ("0" + (currentDate.getSeconds())).slice(-2);
assert_approx_equals(initial_modified, expected, 2.5);
}, "Date returned by lastModified is current at page load");
var pattern = /[0-9]{2}\/[0-9]{2}\/[0-9]{4} ([0-9]{2}):([0-9]{2}):([0-9]{2})/
test(function() {
assert_regexp_match(lastMod, pattern,
"Format should match the pattern \"NN/NN/NNNN NN:NN:NN\".");
assert_approx_equals(Date.parse(document.lastModified), currentDate, 10);
assert_regexp_match(last_modified, pattern,
"Format should match the pattern \"NN/NN/NNNN NN:NN:NN\".");
}, "Date returned by lastModified is in the form \"MM/DD/YYYY hh:mm:ss\".");
var t = async_test('Date returned by lastModified is current.');
var old = Date.parse(document.lastModified);
var hours = d.getHours()
var minutes = d.getMinutes()
var seconds = d.getSeconds()
test(function() {
var local_time = hours * 60 * 60 + minutes * 60 + seconds;
var m = pattern.exec(last_modified);
var last_modified_time = parseInt(m[1]) * 60 * 60 + parseInt(m[2]) * 60 + parseInt(m[3]);
assert_approx_equals(last_modified_time, local_time, 2,
"Hours and minutes should match local time.");
}, "Date returned by lastModified is in the user's local time zone.");
var t = async_test("Date returned by lastModified is current after timeout.");
setTimeout(function() {
t.step(function() {
assert_approx_equals(Date.parse(document.lastModified), old + 2000, 300);
var new_modified = Date.parse(document.lastModified) / 1000;
var new_expected = Math.round(new Date() / 1000);
assert_approx_equals(new_modified, new_expected, 2.5,
"(initial value was " + initial_modified + ")");
t.done();
});
}, 2000);
}, 4000);
</script>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,116 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Sample HTML5 API Tests</title>
</head>
<body onload="load_test_attr.done()">
<h1>Sample HTML5 API Tests</h1>
<div id="log"></div>
<script src="testharness.js"></script>
<script src="testharnessreport.js"></script>
<script>
setup_run = false;
setup(function() {
setup_run = true;
});
test(function() {assert_true(setup_run)}, "Setup function ran");
// Two examples for testing events from handler and attributes
var load_test_event = async_test("window onload event fires when set from the handler");
function windowLoad()
{
load_test_event.done();
}
on_event(window, "load", windowLoad);
// see the body onload below
var load_test_attr = async_test("body element fires the onload event set from the attribute");
</script>
<script>
function bodyElement()
{
assert_equals(document.body, document.getElementsByTagName("body")[0]);
}
test(bodyElement, "document.body should be the first body element in the document");
test(function() {
assert_equals(1,1);
assert_equals(NaN, NaN, "NaN case");
assert_equals(0, 0, "Zero case");
}, "assert_equals tests")
test(function() {
assert_equals(-0, 0, "Zero case");
}, "assert_equals tests expected to fail")
test(function() {
assert_not_equals({}, {}, "object case");
assert_not_equals(-0, 0, "Zero case");
}, "assert_not_equals tests")
function testAssertPass()
{
assert_true(true);
}
test(testAssertPass, "assert_true expected to pass");
function testAssertFalse()
{
assert_true(false, "false should not be true");
}
test(testAssertFalse, "assert_true expected to fail");
function basicAssertObjectEquals()
{
assert_object_equals([1, 2, [1, 2]], { 0: 1, 1: 2, 2: { 0: 1, 1: 2} }, "array is equal to object")
}
test(basicAssertObjectEquals, "basic assert_object_equals test");
function testAssertInherits() {
var A = function(){this.a = "a"}
A.prototype = {b:"b"}
var a = new A();
assert_exists(a, "a");
assert_not_exists(a, "b");
assert_inherits(a, "b");
}
test(testAssertInherits, "test for assert[_not]_exists and insert_inherits")
test(function()
{
var a = document.createElement("a")
var b = document.createElement("b")
assert_throws("NOT_FOUND_ERR", function(){a.removeChild(b)});
}, "Test throw DOM exception")
test(function()
{
var a = document.createTextNode("a")
var b = document.createElement("b")
assert_throws("NOT_FOUND_ERR", function(){a.appendChild(b)});
}, "Test throw DOM exception expected to fail")
test(function()
{
var e = {code:0, name:"TEST_ERR", TEST_ERR:0}
assert_throws("TEST_ERR", function() {throw e});
}, "Test assert_throws with non-DOM-exception expected to Fail");
var t = async_test("Test step_func")
setTimeout(t.step_func(function (){assert_true(true); t.done();}, 0));
async_test("test should timeout (fail) with the default of 2 seconds").step(function(){});
async_test("test should timeout (fail) with a custom set timeout value of 1 second",
{timeout:1000}).step(function(){});
async_test("async test that is never started, should have status Not Run", {timeout:1000});
</script>
</body>
</html>

Просмотреть файл

@ -1,19 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Sample HTML5 API Tests</title>
</head>
<body onload="load_test_attr.done()">
<h1>Sample HTML5 API Tests</h1>
<p>There should be two results</p>
<div id="log"></div>
<script src="testharness.js"></script>
<script src="testharnessreport.js"></script>
<script>
setup({explicit_done:true})
test(function() {assert_true(true)}, "Test defined before onload");
onload = function() {test(function (){assert_true(true)}, "Test defined after onload");
done();
}
</script>

Просмотреть файл

@ -1,17 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Sample HTML5 API Tests</title>
</head>
<script src="testharness.js"></script>
<body onload="load_test_attr.done()">
<h1>Sample HTML5 API Tests</h1>
<div id="log"></div>
<script>
setup({explicit_timeout:true});
var t = async_test("This test should give a status of 'Not Run' without a delay");
timeout();
</script>
</body>
</html>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,19 +0,0 @@
## Introdution ##
testharness.js provides a framework for writing low-level tests of
browser functionality in javascript. It provides a convenient API for
making asseertions and is intended to work for both simple synchronous
tests and for tests of asynchronous behaviour.
## Getting Started ##
To use testharness.js you must include two scripts, in the order given:
``` html
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
```
## Full documentation ##
Full documentation of the API is kept in the source of testharness.js

Просмотреть файл

@ -1,92 +0,0 @@
html {
font-family:DejaVu Sans, Bitstream Vera Sans, Arial, Sans;
}
#log .warning,
#log .warning a {
color: black;
background: yellow;
}
#log .error,
#log .error a {
color: white;
background: red;
}
#log pre {
border: 1px solid black;
padding: 1em;
}
section#summary {
margin-bottom:1em;
}
table#results {
border-collapse:collapse;
table-layout:fixed;
width:100%;
}
table#results th:first-child,
table#results td:first-child {
width:4em;
}
table#results th:last-child,
table#results td:last-child {
width:50%;
}
table#results.assertions th:last-child,
table#results.assertions td:last-child {
width:35%;
}
table#results th {
padding:0;
padding-bottom:0.5em;
border-bottom:medium solid black;
}
table#results td {
padding:1em;
padding-bottom:0.5em;
border-bottom:thin solid black;
}
tr.pass > td:first-child {
color:green;
}
tr.fail > td:first-child {
color:red;
}
tr.timeout > td:first-child {
color:red;
}
tr.notrun > td:first-child {
color:blue;
}
.pass > td:first-child, .fail > td:first-child, .timeout > td:first-child, .notrun > td:first-child {
font-variant:small-caps;
}
table#results span {
display:block;
}
table#results span.expected {
font-family:DejaVu Sans Mono, Bitstream Vera Sans Mono, Monospace;
white-space:pre;
}
table#results span.actual {
font-family:DejaVu Sans Mono, Bitstream Vera Sans Mono, Monospace;
white-space:pre;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,380 +0,0 @@
/*
* This file is intended for vendors to implement
* code needed to integrate testharness.js tests with their own test systems.
*
* The default implementation extracts metadata from the tests and validates
* it against the cached version that should be present in the test source
* file. If the cache is not found or is out of sync, source code suitable for
* caching the metadata is optionally generated.
*
* The cached metadata is present for extraction by test processing tools that
* are unable to execute javascript.
*
* Metadata is attached to tests via the properties parameter in the test
* constructor. See testharness.js for details.
*
* Typically test system integration will attach callbacks when each test has
* run, using add_result_callback(callback(test)), or when the whole test file
* has completed, using
* add_completion_callback(callback(tests, harness_status)).
*
* For more documentation about the callback functions and the
* parameters they are called with see testharness.js
*/
var metadata_generator = {
currentMetadata: {},
cachedMetadata: false,
metadataProperties: ['help', 'assert', 'author'],
error: function(message) {
var messageElement = document.createElement('p');
messageElement.setAttribute('class', 'error');
this.appendText(messageElement, message);
var summary = document.getElementById('summary');
if (summary) {
summary.parentNode.insertBefore(messageElement, summary);
}
else {
document.body.appendChild(messageElement);
}
},
/**
* Ensure property value has contact information
*/
validateContact: function(test, propertyName) {
var result = true;
var value = test.properties[propertyName];
var values = Array.isArray(value) ? value : [value];
for (var index = 0; index < values.length; index++) {
value = values[index];
var re = /(\S+)(\s*)<(.*)>(.*)/;
if (! re.test(value)) {
re = /(\S+)(\s+)(http[s]?:\/\/)(.*)/
if (! re.test(value)) {
this.error('Metadata property "' + propertyName +
'" for test: "' + test.name +
'" must have name and contact information ' +
'("name <email>" or "name http(s)://")');
result = false;
}
}
}
return result;
},
/**
* Extract metadata from test object
*/
extractFromTest: function(test) {
var testMetadata = {};
// filter out metadata from other properties in test
for (var metaIndex = 0; metaIndex < this.metadataProperties.length;
metaIndex++) {
var meta = this.metadataProperties[metaIndex];
if (test.properties.hasOwnProperty(meta)) {
if ('author' == meta) {
this.validateContact(test, meta);
}
testMetadata[meta] = test.properties[meta];
}
}
return testMetadata;
},
/**
* Compare cached metadata to extracted metadata
*/
validateCache: function() {
for (var testName in this.currentMetadata) {
if (! this.cachedMetadata.hasOwnProperty(testName)) {
return false;
}
var testMetadata = this.currentMetadata[testName];
var cachedTestMetadata = this.cachedMetadata[testName];
delete this.cachedMetadata[testName];
for (var metaIndex = 0; metaIndex < this.metadataProperties.length;
metaIndex++) {
var meta = this.metadataProperties[metaIndex];
if (cachedTestMetadata.hasOwnProperty(meta) &&
testMetadata.hasOwnProperty(meta)) {
if (Array.isArray(cachedTestMetadata[meta])) {
if (! Array.isArray(testMetadata[meta])) {
return false;
}
if (cachedTestMetadata[meta].length ==
testMetadata[meta].length) {
for (var index = 0;
index < cachedTestMetadata[meta].length;
index++) {
if (cachedTestMetadata[meta][index] !=
testMetadata[meta][index]) {
return false;
}
}
}
else {
return false;
}
}
else {
if (Array.isArray(testMetadata[meta])) {
return false;
}
if (cachedTestMetadata[meta] != testMetadata[meta]) {
return false;
}
}
}
else if (cachedTestMetadata.hasOwnProperty(meta) ||
testMetadata.hasOwnProperty(meta)) {
return false;
}
}
}
for (var testName in this.cachedMetadata) {
return false;
}
return true;
},
appendText: function(elemement, text) {
elemement.appendChild(document.createTextNode(text));
},
jsonifyArray: function(arrayValue, indent) {
var output = '[';
if (1 == arrayValue.length) {
output += JSON.stringify(arrayValue[0]);
}
else {
for (var index = 0; index < arrayValue.length; index++) {
if (0 < index) {
output += ',\n ' + indent;
}
output += JSON.stringify(arrayValue[index]);
}
}
output += ']';
return output;
},
jsonifyObject: function(objectValue, indent) {
var output = '{';
var count = 0;
for (var property in objectValue) {
++count;
if (Array.isArray(objectValue[property]) ||
('object' == typeof(value))) {
++count;
}
}
if (1 == count) {
for (var property in objectValue) {
output += ' "' + property + '": '
+ JSON.stringify(objectValue[property])
+ ' ';
}
}
else {
var first = true;
for (var property in objectValue) {
if (! first) {
output += ',';
}
first = false;
output += '\n ' + indent + '"' + property + '": ';
var value = objectValue[property];
if (Array.isArray(value)) {
output += this.jsonifyArray(value, indent +
' '.substr(0, 5 + property.length));
}
else if ('object' == typeof(value)) {
output += this.jsonifyObject(value, indent + ' ');
}
else {
output += JSON.stringify(value);
}
}
if (1 < output.length) {
output += '\n' + indent;
}
}
output += '}';
return output;
},
/**
* Generate javascript source code for captured metadata
* Metadata is in pretty-printed JSON format
*/
generateSource: function() {
var source =
'<script id="metadata_cache">/*\n' +
this.jsonifyObject(this.currentMetadata, '') + '\n' +
'*/</script>\n';
return source;
},
/**
* Add element containing metadata source code
*/
addSourceElement: function(event) {
var sourceWrapper = document.createElement('div');
sourceWrapper.setAttribute('id', 'metadata_source');
var instructions = document.createElement('p');
if (this.cachedMetadata) {
this.appendText(instructions,
'Replace the existing <script id="metadata_cache"> element ' +
'in the test\'s <head> with the following:');
}
else {
this.appendText(instructions,
'Copy the following into the <head> element of the test ' +
'or the test\'s metadata sidecar file:');
}
sourceWrapper.appendChild(instructions);
var sourceElement = document.createElement('pre');
this.appendText(sourceElement, this.generateSource());
sourceWrapper.appendChild(sourceElement);
var messageElement = document.getElementById('metadata_issue');
messageElement.parentNode.insertBefore(sourceWrapper,
messageElement.nextSibling);
messageElement.parentNode.removeChild(messageElement);
(event.preventDefault) ? event.preventDefault() :
event.returnValue = false;
},
/**
* Extract the metadata cache from the cache element if present
*/
getCachedMetadata: function() {
var cacheElement = document.getElementById('metadata_cache');
if (cacheElement) {
var cacheText = cacheElement.firstChild.nodeValue;
var openBrace = cacheText.indexOf('{');
var closeBrace = cacheText.lastIndexOf('}');
if ((-1 < openBrace) && (-1 < closeBrace)) {
cacheText = cacheText.slice(openBrace, closeBrace + 1);
try {
this.cachedMetadata = JSON.parse(cacheText);
}
catch (exc) {
this.cachedMetadata = 'Invalid JSON in Cached metadata. ';
}
}
else {
this.cachedMetadata = 'Metadata not found in cache element. ';
}
}
},
/**
* Main entry point, extract metadata from tests, compare to cached version
* if present.
* If cache not present or differs from extrated metadata, generate an error
*/
process: function(tests, harness_status) {
for (var index = 0; index < tests.length; index++) {
var test = tests[index];
if (this.currentMetadata.hasOwnProperty(test.name)) {
this.error('Duplicate test name: ' + test.name);
}
else {
this.currentMetadata[test.name] = this.extractFromTest(test);
}
}
this.getCachedMetadata();
var message = null;
var messageClass = 'warning';
var showSource = false;
if (0 == tests.length) {
if (this.cachedMetadata) {
message = 'Cached metadata present but no tests. ';
}
}
else if (1 == tests.length) {
if (this.cachedMetadata) {
message = 'Single test files should not have cached metadata. ';
}
else {
var testMetadata = this.currentMetadata[tests[0].name];
var hasMetadata = false;
for (var meta in testMetadata) {
hasMetadata |= testMetadata.hasOwnProperty(meta);
}
if (hasMetadata) {
message = 'Single tests should not have metadata. ' +
'Move metadata to <head>. ';
}
}
}
else {
if (this.cachedMetadata) {
messageClass = 'error';
if ('string' == typeof(this.cachedMetadata)) {
message = this.cachedMetadata;
showSource = true;
}
else if (! this.validateCache()) {
message = 'Cached metadata out of sync. ';
showSource = true;
}
}
}
if (message) {
var messageElement = document.createElement('p');
messageElement.setAttribute('id', 'metadata_issue');
messageElement.setAttribute('class', messageClass);
this.appendText(messageElement, message);
if (showSource) {
var link = document.createElement('a');
this.appendText(link, 'Click for source code.');
link.setAttribute('href', '#');
link.setAttribute('onclick',
'metadata_generator.addSourceElement(event)');
messageElement.appendChild(link);
}
var summary = document.getElementById('summary');
if (summary) {
summary.parentNode.insertBefore(messageElement, summary);
}
else {
var log = document.getElementById('log');
if (log) {
log.appendChild(messageElement);
}
}
}
},
setup: function() {
add_completion_callback(
function (tests, harness_status) {
metadata_generator.process(tests, harness_status)
});
}
}
metadata_generator.setup();
// vim: set expandtab shiftwidth=4 tabstop=4:

Просмотреть файл

@ -17,13 +17,6 @@ setup(function() {
}
});
function Entry(name, startTime, initiatorType)
{
this.name = name;
this.startTime = startTime;
this.initiatorType = initiatorType;
};
function resolve(path) {
var a = document.createElement("a");
a.href = path;
@ -86,7 +79,10 @@ onload = function()
break;
}
expected_entry = new Entry(url, startTime, type);
expected_entry = {name:url,
startTime: startTime,
initiatorType: type};
switch (type) {
case "link":
poll_for_stylesheet_load(expected_entry);
@ -161,24 +157,25 @@ function resource_load(expected)
assert_equals(actual.name, expected.name);
assert_equals(actual.initiatorType, expected_type);
assert_equals(actual.entryType, "resource");
assert_approx_equals(actual.startTime, expected.startTime, TEST_ALLOWED_TIMING_DELTA);
assert_greater_than_equal(actual.startTime, expected.startTime, "startTime is after the script to initiate the load ran");
assert_equals(actual.duration, (actual.responseEnd - actual.startTime));
this.done();
});
t["timing_attrs"].step(function test() {
var actual = window.performance.getEntriesByName(expected.name)[0];
assert_equals(actual.redirectStart, 0);
assert_equals(actual.redirectEnd, 0);
assert_equals(actual.redirectStart, 0, "redirectStart time");
assert_equals(actual.redirectEnd, 0, "redirectEnd time");
assert_true(actual.secureConnectionStart == undefined ||
actual.secureConnectionStart == 0);
assert_greater_than_equal(actual.domainLookupStart, actual.fetchStart);
assert_greater_than_equal(actual.domainLookupEnd, actual.domainLookupStart);
assert_greater_than_equal(actual.connectStart, actual.domainLookupEnd);
assert_greater_than_equal(actual.connectEnd, actual.connectStart);
assert_greater_than_equal(actual.requestStart, actual.connectEnd);
assert_greater_than_equal(actual.responseStart, actual.requestStart);
assert_greater_than_equal(actual.responseEnd, actual.responseStart);
actual.secureConnectionStart == 0, "secureConnectionStart time");
assert_equals(actual.fetchStart, actual.startTime, "fetchStart is equal to startTime");
assert_greater_than_equal(actual.domainLookupStart, actual.fetchStart, "domainLookupStart after fetchStart");
assert_greater_than_equal(actual.domainLookupEnd, actual.domainLookupStart, "domainLookupEnd after domainLookupStart");
assert_greater_than_equal(actual.connectStart, actual.domainLookupEnd, "connectStart after domainLookupEnd");
assert_greater_than_equal(actual.connectEnd, actual.connectStart, "connectEnd after connectStart");
assert_greater_than_equal(actual.requestStart, actual.connectEnd, "requestStart after connectEnd");
assert_greater_than_equal(actual.responseStart, actual.requestStart, "responseStart after requestStart");
assert_greater_than_equal(actual.responseEnd, actual.responseStart, "responseEnd after responseStart");
this.done();
});

Просмотреть файл

@ -24,6 +24,22 @@ from mod_pywebsocket import standalone as pywebsocket
sys.path.insert(1, os.path.join(repo_root, "tools"))
import sslutils
@handlers.handler
def workers_handler(request, response):
worker_path = request.url_parts.path.replace(".worker", ".worker.js")
return """
<!doctype html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
fetch_tests_from_worker(new Worker("%s"));
</script>
""" % (worker_path,)
routes = [("GET", "/tools/runner/*", handlers.file_handler),
("POST", "/tools/runner/update_manifest.py", handlers.python_script_handler),
(any_method, "/_certs/*", handlers.ErrorHandler(404)),
@ -32,6 +48,7 @@ routes = [("GET", "/tools/runner/*", handlers.file_handler),
(any_method, "/serve.py", handlers.ErrorHandler(404)),
(any_method, "*.py", handlers.python_script_handler),
("GET", "*.asis", handlers.as_is_handler),
("GET", "*.worker", workers_handler),
("GET", "*", handlers.file_handler),
]

Просмотреть файл

@ -304,7 +304,7 @@ class Manifest(object):
remove_missing_local=False):
if local_changes is None:
local_changes = []
local_changes = {}
if committed_changes is not None:
for rel_path, status in committed_changes:
@ -532,6 +532,9 @@ def get_manifest_items(tests_root, rel_path, url_base, use_committed=False):
if name.lower().endswith("-manual"):
return [ManualTest(url)]
if filename.endswith(".worker.js"):
return [TestharnessTest(url[:-3])]
ref_list = []
for suffix in ref_suffixes:

Просмотреть файл

@ -1,29 +0,0 @@
<!--
var expected = 'WorkerGlobalScope EventTarget DedicatedWorkerGlobalScope ErrorEvent Event Worker DOMException SharedWorker MessagePort MessageEvent WorkerNavigator MessageChannel WorkerLocation ImageData File Blob FileList XMLHttpRequest ProgressEvent FormData ArrayBuffer Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array DataView CanvasProxy ImageBitmap CanvasRenderingContext2D DrawingStyle CanvasGradient CanvasPattern Path TextMetrics'.split(' ');
var log = [];
for (var i = 0; i < expected.length; ++i) {
if (!(expected[i] in self))
log.push(expected[i]);
}
postMessage(log.join(', '));
/*
-->
<!doctype html>
<title>available interface objects in dedicated worker</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
async_test(function() {
var worker = new Worker('#');
worker.onmessage = this.step_func(function(e) {
assert_equals(e.data, '', 'these interface objects were missing');
this.done();
});
});
</script>
<!--
*/
//-->

Просмотреть файл

@ -0,0 +1,48 @@
importScripts("/resources/testharness.js");
var expected = [
"WorkerGlobalScope",
"EventTarget",
"DedicatedWorkerGlobalScope",
"ErrorEvent",
"Event",
"Worker",
"DOMException",
"SharedWorker",
"MessagePort",
"MessageEvent",
"WorkerNavigator",
"MessageChannel",
"WorkerLocation",
"ImageData",
"File",
"Blob",
"FileList",
"XMLHttpRequest",
"ProgressEvent",
"FormData",
"ArrayBuffer",
"Int8Array",
"Uint8Array",
"Uint8ClampedArray",
"Int16Array",
"Uint16Array",
"Int32Array",
"Uint32Array",
"Float32Array",
"Float64Array",
"DataView",
"CanvasProxy",
"ImageBitmap",
"CanvasRenderingContext2D",
"DrawingStyle",
"CanvasGradient",
"CanvasPattern",
"Path",
"TextMetrics"
];
for (var i = 0; i < expected.length; ++i) {
test(function () {
assert_own_property(self, expected[i]);
}, "The " + expected[i] + " interface object should be exposed.");
}
done();