summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/resources/examples
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-02-25 01:03:57 +0000
committerMoonchild <moonchild@palemoon.org>2021-02-25 01:03:57 +0000
commitceadffab6b357723981a429e11222daf6cd6dcfb (patch)
tree5603053048d6a460f79b22bdf165fb74d32d39b0 /testing/web-platform/tests/resources/examples
parent14fb2f966e9b54598c451e3cb35b4aa0480dafed (diff)
parentad5a13bd501e379517da1a944c104a11d951a3f5 (diff)
downloadUXP-ceadffab6b357723981a429e11222daf6cd6dcfb.tar
UXP-ceadffab6b357723981a429e11222daf6cd6dcfb.tar.gz
UXP-ceadffab6b357723981a429e11222daf6cd6dcfb.tar.lz
UXP-ceadffab6b357723981a429e11222daf6cd6dcfb.tar.xz
UXP-ceadffab6b357723981a429e11222daf6cd6dcfb.zip
Merge branch 'master' into releaseRC_20210225
Diffstat (limited to 'testing/web-platform/tests/resources/examples')
-rw-r--r--testing/web-platform/tests/resources/examples/apisample-error-worker.js3
-rw-r--r--testing/web-platform/tests/resources/examples/apisample-worker.js34
-rw-r--r--testing/web-platform/tests/resources/examples/apisample.htm175
-rw-r--r--testing/web-platform/tests/resources/examples/apisample10.html119
-rw-r--r--testing/web-platform/tests/resources/examples/apisample11.html99
-rw-r--r--testing/web-platform/tests/resources/examples/apisample12.html67
-rw-r--r--testing/web-platform/tests/resources/examples/apisample13.html132
-rw-r--r--testing/web-platform/tests/resources/examples/apisample14.html29
-rw-r--r--testing/web-platform/tests/resources/examples/apisample15.html26
-rw-r--r--testing/web-platform/tests/resources/examples/apisample16.html62
-rw-r--r--testing/web-platform/tests/resources/examples/apisample17.html59
-rw-r--r--testing/web-platform/tests/resources/examples/apisample2.htm19
-rw-r--r--testing/web-platform/tests/resources/examples/apisample3.htm17
-rw-r--r--testing/web-platform/tests/resources/examples/apisample4.htm16
-rw-r--r--testing/web-platform/tests/resources/examples/apisample5.htm18
-rw-r--r--testing/web-platform/tests/resources/examples/apisample6.html10
-rw-r--r--testing/web-platform/tests/resources/examples/apisample7.html10
-rw-r--r--testing/web-platform/tests/resources/examples/apisample8.html8
-rw-r--r--testing/web-platform/tests/resources/examples/apisample9.html7
19 files changed, 0 insertions, 910 deletions
diff --git a/testing/web-platform/tests/resources/examples/apisample-error-worker.js b/testing/web-platform/tests/resources/examples/apisample-error-worker.js
deleted file mode 100644
index 9bfe0a6f3..000000000
--- a/testing/web-platform/tests/resources/examples/apisample-error-worker.js
+++ /dev/null
@@ -1,3 +0,0 @@
-importScripts("../testharness.js");
-
-throw new Error("This failure is expected.");
diff --git a/testing/web-platform/tests/resources/examples/apisample-worker.js b/testing/web-platform/tests/resources/examples/apisample-worker.js
deleted file mode 100644
index b1d086314..000000000
--- a/testing/web-platform/tests/resources/examples/apisample-worker.js
+++ /dev/null
@@ -1,34 +0,0 @@
-importScripts("../testharness.js");
-
-test(
- function(test) {
- assert_true(true, "True is true");
- },
- "Worker test that completes successfully");
-
-test(
- function(test) {
- assert_true(false, "Failing test");
- },
- "Worker test that fails ('FAIL')");
-
-async_test(
- function(test) {
- assert_true(true, "True is true");
- },
- "Worker test that times out ('TIMEOUT')");
-
-async_test("Worker test that doesn't run ('NOT RUN')");
-
-async_test(
- function(test) {
- self.setTimeout(
- function() {
- test.done();
- },
- 0);
- },
- "Worker async_test that completes successfully");
-
-// An explicit done() is required for dedicated and shared web workers.
-done();
diff --git a/testing/web-platform/tests/resources/examples/apisample.htm b/testing/web-platform/tests/resources/examples/apisample.htm
deleted file mode 100644
index 504a343ac..000000000
--- a/testing/web-platform/tests/resources/examples/apisample.htm
+++ /dev/null
@@ -1,175 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Sample HTML5 API Tests</title>
-<meta name="timeout" content="6000">
-</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 basicAssertArrayEquals()
- {
- assert_array_equals([1, NaN], [1, NaN], "[1, NaN] is equal to [1, NaN]");
- }
- test(basicAssertArrayEquals, "basic assert_array_equals test");
-
- 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 basicAssertApproxEquals()
- {
- assert_approx_equals(10, 11, 1, "10 is approximately (+/- 1) 11")
- }
- test(basicAssertApproxEquals, "basic assert_approx_equals test");
-
- function basicAssertLessThan()
- {
- assert_less_than(10, 11, "10 is less than 11")
- }
- test(basicAssertApproxEquals, "basic assert_less_than test");
-
- function basicAssertGreaterThan()
- {
- assert_greater_than(10, 11, "10 is not greater than 11");
- }
- test(basicAssertGreaterThan, "assert_greater_than expected to fail");
-
- function basicAssertGreaterThanEqual()
- {
- assert_greater_than_equal(10, 10, "10 is greater than or equal to 10")
- }
- test(basicAssertGreaterThanEqual, "basic assert_greater_than_equal test");
-
- function basicAssertLessThanEqual()
- {
- assert_greater_than_equal('10', 10, "'10' is not a number")
- }
- test(basicAssertLessThanEqual, "assert_less_than_equal expected to fail");
-
- 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(function(t) {
- setTimeout(t.step_func(function (){assert_true(true); t.done();}), 0);
- }, "Test async test with callback");
-
- async_test(function() {
- setTimeout(this.step_func(function (){assert_true(true); this.done();}), 0);
- }, "Test async test with callback and `this` obj.");
-
- 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});
-
-
- test(function(t) {
- window.global = 1;
- t.add_cleanup(function() {delete window.global});
- assert_equals(window.global, 1);
- },
- "Test that defines a global and cleans it up");
-
- test(function() {assert_equals(window.global, undefined)},
- "Test that cleanup handlers from previous test ran");
-
-</script>
-</body>
-</html>
-
-
-
diff --git a/testing/web-platform/tests/resources/examples/apisample10.html b/testing/web-platform/tests/resources/examples/apisample10.html
deleted file mode 100644
index 69810fe16..000000000
--- a/testing/web-platform/tests/resources/examples/apisample10.html
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Async Tests and Promises</title>
-</head>
-<body>
-<h1>Async Tests and Promises</h1>
-<p>This test assumes ECMAScript 6 Promise support. Some failures are expected.</p>
-<div id="log"></div>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-<script>
-
-test(function() {
- var p = new Promise(function(resolve, reject) {});
- assert_true('then' in p);
- assert_equals(typeof Promise.resolve, 'function');
- assert_equals(typeof Promise.reject, 'function');
-}, "Promises are supported in your browser");
-
-(function() {
- var t = async_test("Promise resolution");
- t.step(function() {
- Promise.resolve('x').then(
- t.step_func(function(value) {
- assert_equals(value, 'x');
- t.done();
- }),
- t.unreached_func('Promise should not reject')
- );
- });
-}());
-
-(function() {
- var t = async_test("Promise rejection");
- t.step(function() {
- Promise.reject(Error('fail')).then(
- t.unreached_func('Promise should reject'),
- t.step_func(function(reason) {
- assert_true(reason instanceof Error);
- assert_equals(reason.message, 'fail');
- t.done();
- })
- );
- });
-}());
-
-(function() {
- var t = async_test("Promises resolution chaining");
- t.step(function() {
- var resolutions = [];
- Promise.resolve('a').then(
- t.step_func(function(value) {
- resolutions.push(value);
- return 'b';
- })
- ).then(
- t.step_func(function(value) {
- resolutions.push(value);
- return 'c';
- })
- ).then(
- t.step_func(function(value) {
- resolutions.push(value);
-
- assert_array_equals(resolutions, ['a', 'b', 'c']);
- t.done();
- })
- ).catch(
- t.unreached_func('promise should not have rejected')
- );
- });
-}());
-
-(function() {
- var t = async_test("Use of step_func with Promises");
- t.step(function() {
- var resolutions = [];
- Promise.resolve('x').then(
- t.step_func_done(),
- t.unreached_func('Promise should not have rejected')
- );
- });
-}());
-
-(function() {
- var t = async_test("Promises and test assertion failures (should fail)");
- t.step(function() {
- var resolutions = [];
- Promise.resolve('x').then(
- t.step_func(function(value) {
- assert_true(false, 'This failure is expected');
- })
- ).then(
- t.unreached_func('Promise should not have resolved')
- ).catch(
- t.unreached_func('Promise should not have rejected')
- );
- });
-}());
-
-(function() {
- var t = async_test("Use of unreached_func with Promises (should fail)");
- t.step(function() {
- var resolutions = [];
- var r;
- var p = new Promise(function(resolve, reject) {
- // Reject instead of resolve, to demonstrate failure.
- reject(123);
- });
- p.then(
- function(value) {
- assert_equals(value, 123, 'This should not actually happen');
- },
- t.unreached_func('This failure is expected')
- );
- });
-}());
-</script>
diff --git a/testing/web-platform/tests/resources/examples/apisample11.html b/testing/web-platform/tests/resources/examples/apisample11.html
deleted file mode 100644
index 32e8984c3..000000000
--- a/testing/web-platform/tests/resources/examples/apisample11.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Example with iframe that notifies containing document via callbacks</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-</head>
-<body onload="start_test_in_iframe()">
-<h1>Callbacks From Tests Running In An IFRAME</h1>
-<p>A test is run inside an <tt>iframe</tt> with a same origin document. The
-containing document should receive callbacks as the tests progress inside the
-<tt>iframe</tt>. A single passing test is expected in the summary below.
-<div id="log"></div>
-
-<script>
-var callbacks = [];
-var START = 1
-var TEST_STATE = 2
-var RESULT = 3
-var COMPLETION = 4
-var test_complete = false;
-
-setup({explicit_done: true});
-
-// The following callbacks are called for tests in this document as well as the
-// tests in the IFRAME. Currently, callbacks invoked from this document and any
-// child document are indistinguishable from each other.
-
-function start_callback(properties) {
- callbacks.push(START);
-}
-
-function test_state_callback(test) {
- callbacks.push(TEST_STATE);
-}
-
-function result_callback(test) {
- callbacks.push(RESULT);
-}
-
-function completion_callback(tests, status) {
- if (test_complete) {
- return;
- }
- test_complete = true;
- callbacks.push(COMPLETION);
- verify_received_callbacks();
- done();
-}
-
-function verify_received_callbacks() {
- var copy_of_callbacks = callbacks.slice(0);
-
- // Note that you can't run test assertions directly in a callback even if
- // this is a file test. When the callback is invoked from a same-origin child
- // page, the callstack reaches into the calling child document. Any
- // exception thrown in a callback will be handled by the child rather than
- // this document.
- test(
- function() {
- // callbacks list should look like:
- // START 1*(TEST_STATE) RESULT COMPLETION
- assert_equals(copy_of_callbacks.shift(), START,
- "The first received callback should be 'start_callback'.");
- assert_equals(copy_of_callbacks.shift(), TEST_STATE,
- "'test_state_callback' should be received before any " +
- "result or completion callbacks.");
- while(copy_of_callbacks.length > 0) {
- var callback = copy_of_callbacks.shift();
- if (callback != TEST_STATE) {
- copy_of_callbacks.unshift(callback);
- break;
- }
- }
- assert_equals(copy_of_callbacks.shift(), RESULT,
- "'test_state_callback' should be followed by 'result_callback'.");
- assert_equals(copy_of_callbacks.shift(), COMPLETION,
- "Final 'result_callback' should be followed by 'completion_callback'.");
- assert_equals(copy_of_callbacks.length, 0,
- "'completion_callback' should be the last callback.");
- });
-}
-
-function start_test_in_iframe() {
- // This document is going to clear any received callbacks and maintain
- // radio silence until the test in the iframe runs to completion. The
- // completion_callback() will then complete the testing on this document.
- callbacks.length = 0;
- var iframe = document.createElement("iframe");
- // apisample6.html has a single test.
- iframe.src = "apisample6.html";
- iframe.style.setProperty("display", "none");
- document.getElementById("target").appendChild(iframe);
-}
-</script>
-
-<div id="target">
-</div>
-</body>
diff --git a/testing/web-platform/tests/resources/examples/apisample12.html b/testing/web-platform/tests/resources/examples/apisample12.html
deleted file mode 100644
index 785d57b2b..000000000
--- a/testing/web-platform/tests/resources/examples/apisample12.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Example with iframe that notifies containing document via cross document messaging</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-</head>
-<body>
-<h1>Notifications From Tests Running In An IFRAME</h1>
-<p>A test is run inside an <tt>iframe</tt> with a same origin document. The
-containing document should receive messages via <tt>postMessage</tt>/
-<tt>onmessage</tt> as the tests progress inside the <tt>iframe</tt>. A single
-passing test is expected in the summary below.
-</p>
-<div id="log"></div>
-
-<script>
-var t = async_test("Containing document receives messages");
-var start_received = false;
-var result_received = false;
-var completion_received = false;
-
-// These are the messages that are expected to be seen while running the tests
-// in the IFRAME.
-var expected_messages = [
- t.step_func(
- function(message) {
- assert_equals(message.data.type, "start");
- assert_own_property(message.data, "properties");
- }),
-
- t.step_func(
- function(message) {
- assert_equals(message.data.type, "test_state");
- assert_equals(message.data.test.status, message.data.test.NOTRUN);
- }),
-
- t.step_func(
- function(message) {
- assert_equals(message.data.type, "result");
- assert_equals(message.data.test.status, message.data.test.PASS);
- }),
-
- t.step_func(
- function(message) {
- assert_equals(message.data.type, "complete");
- assert_equals(message.data.tests.length, 1);
- assert_equals(message.data.tests[0].status,
- message.data.tests[0].PASS);
- assert_equals(message.data.status.status, message.data.status.OK);
- t.done();
- }),
-
- t.unreached_func("Too many messages received")
-];
-
-on_event(window,
- "message",
- function(message) {
- var handler = expected_messages.shift();
- handler(message);
- });
-</script>
-<iframe src="apisample6.html" style="display:none">
- <!-- apisample6 implements a file_is_test test. -->
-</iframe>
-</body>
diff --git a/testing/web-platform/tests/resources/examples/apisample13.html b/testing/web-platform/tests/resources/examples/apisample13.html
deleted file mode 100644
index f6cf0eec8..000000000
--- a/testing/web-platform/tests/resources/examples/apisample13.html
+++ /dev/null
@@ -1,132 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Promise Tests</title>
-</head>
-<body>
-<h1>Promise Tests</h1>
-<p>This test demonstrates the use of <tt>promise_test</tt>. Assumes ECMAScript 6
-Promise support. Some failures are expected.</p>
-<div id="log"></div>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-<script>
-test(
- function() {
- var p = new Promise(function(resolve, reject){});
- assert_true("then" in p);
- assert_equals(typeof Promise.resolve, "function");
- assert_equals(typeof Promise.reject, "function");
- },
- "Promises are supported in your browser");
-
-promise_test(
- function() {
- return Promise.resolve("x")
- .then(
- function(value) {
- assert_equals(value,
- "x",
- "Fulfilled promise should pass result to " +
- "fulfill reaction.");
- });
- },
- "Promise fulfillment with result");
-
-promise_test(
- function(t) {
- return Promise.reject(new Error("fail"))
- .then(t.unreached_func("Promise should reject"),
- function(reason) {
- assert_true(
- reason instanceof Error,
- "Rejected promise should pass reason to fulfill reaction.");
- assert_equals(
- reason.message,
- "fail",
- "Rejected promise should pass reason to reject reaction.");
- });
- },
- "Promise rejection with result");
-
-promise_test(
- function() {
- var resolutions = [];
- return Promise.resolve("a")
- .then(
- function(value) {
- resolutions.push(value);
- return "b";
- })
- .then(
- function(value) {
- resolutions.push(value);
- return "c";
- })
- .then(
- function(value) {
- resolutions.push(value);
- assert_array_equals(resolutions, ["a", "b", "c"]);
- });
- },
- "Chain of promise resolutions");
-
-promise_test(
- function(t) {
- var resolutions = [];
- return Promise.resolve("x")
- .then(
- function(value) {
- assert_true(false, "Expected failure.");
- })
- .then(t.unreached_func("UNEXPECTED FAILURE: Promise should not have resolved."));
- },
- "Assertion failure in a fulfill reaction (should FAIL with an expected failure)");
-
-promise_test(
- function(t) {
- return new Promise(
- function(resolve, reject) {
- reject(123);
- })
- .then(t.unreached_func("UNEXPECTED FAILURE: Fulfill reaction reached after rejection."),
- t.unreached_func("Expected failure."));
- },
- "unreached_func as reactor (should FAIL with an expected failure)");
-
-promise_test(
- function() {
- return true;
- },
- "promise_test with function that doesn't return a Promise");
-
-promise_test(function(){},
- "promise_test with function that doesn't return anything");
-
-promise_test(
- function() {
- return Promise.reject("Expected rejection");
- },
- "promise_test with unhandled rejection (should FAIL)");
-
-promise_test(
- function() {
- return Promise.resolve(10)
- .then(
- function(value) {
- throw Error("Expected exception.");
- });
- },
- "promise_test with unhandled exception in fulfill reaction (should FAIL)");
-
-promise_test(
- function(t) {
- return Promise.reject(10)
- .then(
- t.unreached_func("UNEXPECTED FAILURE: Fulfill reaction reached after rejection."),
- function(value) {
- throw Error("Expected exception.");
- });
- },
- "promise_test with unhandled exception in reject reaction (should FAIL)");
-</script>
diff --git a/testing/web-platform/tests/resources/examples/apisample14.html b/testing/web-platform/tests/resources/examples/apisample14.html
deleted file mode 100644
index 89803f0bb..000000000
--- a/testing/web-platform/tests/resources/examples/apisample14.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Dedicated Worker Tests</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-</head>
-<body>
-<h1>Dedicated Web Worker Tests</h1>
-<p>Demonstrates running <tt>testharness</tt> based tests inside a dedicated web worker.
-<p>The test harness is expected to fail due to an uncaught exception in one worker.</p>
-<div id="log"></div>
-
-<script>
-test(function(t) {
- assert_true("Worker" in self, "Browser should support Workers");
- },
- "Browser supports Workers");
-
-fetch_tests_from_worker(new Worker("apisample-worker.js"));
-
-fetch_tests_from_worker(new Worker("apisample-error-worker.js"));
-
-test(function(t) {
- assert_false(false, "False is false");
- },
- "Test running on main document.");
-</script>
-</body>
diff --git a/testing/web-platform/tests/resources/examples/apisample15.html b/testing/web-platform/tests/resources/examples/apisample15.html
deleted file mode 100644
index 631d1922b..000000000
--- a/testing/web-platform/tests/resources/examples/apisample15.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Example with a shared worker</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-</head>
-<body>
-<h1>Shared Web Worker Tests</h1>
-<p>Demonstrates running <tt>testharness</tt> based tests inside a shared worker.
-<p>The test harness should time out due to one of the tests in the worker timing out.
-<p>This test assumes that the browser supports <a href="http://www.w3.org/TR/workers/#shared-workers-and-the-sharedworker-interface">shared web workers</a>.
-<div id="log"></div>
-
-<script>
-test(
- function(t) {
- assert_true("SharedWorker" in self,
- "Browser should support SharedWorkers");
- },
- "Browser supports SharedWorkers");
-
-fetch_tests_from_worker(new SharedWorker("apisample-worker.js",
- "My shared worker"));
-</script>
-</body>
diff --git a/testing/web-platform/tests/resources/examples/apisample16.html b/testing/web-platform/tests/resources/examples/apisample16.html
deleted file mode 100644
index d859d94bf..000000000
--- a/testing/web-platform/tests/resources/examples/apisample16.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Example with a service worker</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-</head>
-<body>
-<h1>Service Worker Tests</h1>
-<p>Demonstrates running <tt>testharness</tt> based tests inside a service worker.
-<p>The test harness should time out due to one of the tests inside the worker timing out.
-<p>This test assumes that the browser supports <a href="http://www.w3.org/TR/service-workers/">ServiceWorkers</a>.
-<div id="log"></div>
-
-<script>
-test(
- function(t) {
- assert_true("serviceWorker" in navigator,
- "navigator.serviceWorker exists");
- },
- "Browser supports ServiceWorker");
-
-promise_test(
- function() {
- // Since the service worker registration could be in an indeterminate
- // state (due to, for example, a previous test run failing), we start by
- // unregstering our service worker and then registering it again.
- var scope = "/service-worker-scope";
- var worker_url = "apisample-worker.js";
-
- return navigator.serviceWorker.register(worker_url, {scope: scope})
- .then(
- function(registration) {
- return registration.unregister();
- })
- .then(
- function() {
- return navigator.serviceWorker.register(worker_url, {scope: scope});
- })
- .then(
- function(registration) {
- add_completion_callback(
- function() {
- registration.unregister();
- });
-
- return new Promise(
- function(resolve) {
- registration.addEventListener("updatefound",
- function() {
- resolve(registration.installing);
- });
- });
- })
- .then(
- function(worker) {
- fetch_tests_from_worker(worker);
- });
- },
- "Register ServiceWorker");
-</script>
-</body>
diff --git a/testing/web-platform/tests/resources/examples/apisample17.html b/testing/web-platform/tests/resources/examples/apisample17.html
deleted file mode 100644
index c27c417b8..000000000
--- a/testing/web-platform/tests/resources/examples/apisample17.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Sample for using generate_tests to create a series of tests that share the same callback.</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-</head>
-<body>
-<script>
-// generate_tests takes an array of arrays that define tests
-// but lets pass it an empty array and verify it does nothing.
-function null_callback() {
- throw "null_callback should not be called.";
-}
-generate_tests(null_callback, []);
-
-// Generate 3 tests specifying the name and one parameter
-function validate_arguments(arg1) {
- assert_equals(arg1, 1, "Ensure that we get our expected argument");
-}
-generate_tests(validate_arguments, [
- ["first test", 1],
- ["second test", 1],
- ["third test", 1],
-]);
-
-// Generate a test passing in a properties object that is shared across tests.
-function validate_properties() {
- assert_true(this.properties.sentinel, "Ensure that we got the right properties object.");
-}
-generate_tests(validate_properties, [["sentinel check 1"], ["sentinel check 2"]], {sentinel: true});
-
-// Generate a test passing in a properties object that is shared across tests.
-function validate_separate_properties() {
- if (this.name === "sentinel check 1 unique properties") {
- assert_true(this.properties.sentinel, "Ensure that we got the right properties object. Expect sentinel: true.");
- }
- else {
- assert_false(this.properties.sentinel, "Ensure that we got the right properties object. Expect sentinel: false.");
- }
-}
-generate_tests(validate_separate_properties, [["sentinel check 1 unique properties"], ["sentinel check 2 unique properties"]], [{sentinel: true}, {sentinel: false}]);
-
-// Finally generate a complicated set of tests from another data source
-var letters = ["a", "b", "c", "d", "e", "f"];
-var numbers = [0, 1, 2, 3, 4, 5];
-function validate_related_arguments(arg1, arg2) {
- assert_equals(arg1.charCodeAt(0) - "a".charCodeAt(0), arg2, "Ensure that we can map letters to numbers.");
-}
-function format_as_test(letter, index, letters) {
- return ["Test to map " + letter + " to " + numbers[index], letter, numbers[index]];
-}
-generate_tests(validate_related_arguments, letters.map(format_as_test));
-</script>
-</body>
-</html>
-
-
-
diff --git a/testing/web-platform/tests/resources/examples/apisample2.htm b/testing/web-platform/tests/resources/examples/apisample2.htm
deleted file mode 100644
index 4a4c16b4d..000000000
--- a/testing/web-platform/tests/resources/examples/apisample2.htm
+++ /dev/null
@@ -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>
diff --git a/testing/web-platform/tests/resources/examples/apisample3.htm b/testing/web-platform/tests/resources/examples/apisample3.htm
deleted file mode 100644
index 4dbbf9a87..000000000
--- a/testing/web-platform/tests/resources/examples/apisample3.htm
+++ /dev/null
@@ -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>
diff --git a/testing/web-platform/tests/resources/examples/apisample4.htm b/testing/web-platform/tests/resources/examples/apisample4.htm
deleted file mode 100644
index c8fbbded6..000000000
--- a/testing/web-platform/tests/resources/examples/apisample4.htm
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Harness Handling Uncaught Exception</title>
-</head>
-<script src="../testharness.js"></script>
-
-<body>
-<h1>Harness Handling Uncaught Exception</h1>
-<div id="log"></div>
-<script>
-var t = async_test("This should show a harness status of 'Error' and a test status of 'Not Run'");
-throw new Error("Example Error");
-</script>
-</body>
-</html>
diff --git a/testing/web-platform/tests/resources/examples/apisample5.htm b/testing/web-platform/tests/resources/examples/apisample5.htm
deleted file mode 100644
index 3edf602a1..000000000
--- a/testing/web-platform/tests/resources/examples/apisample5.htm
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Harness Ignoring Uncaught Exception</title>
-</head>
-<script src="../testharness.js"></script>
-
-<body>
-<h1>Harness Ignoring Uncaught Exception</h1>
-<div id="log"></div>
-<script>
-setup({allow_uncaught_exception:true});
-var t = async_test("setup({allow_uncaught_exception:true}) should allow tests to pass even if there is an exception");
-onerror = t.step_func(function() {t.done()});
-throw new Error("Example Error");
-</script>
-</body>
-</html>
diff --git a/testing/web-platform/tests/resources/examples/apisample6.html b/testing/web-platform/tests/resources/examples/apisample6.html
deleted file mode 100644
index 7459c54d5..000000000
--- a/testing/web-platform/tests/resources/examples/apisample6.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<title>Example with file_is_test</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-<script>
-onload = function() {
- assert_true(true);
- done();
-}
-</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/resources/examples/apisample7.html b/testing/web-platform/tests/resources/examples/apisample7.html
deleted file mode 100644
index 6885f52f8..000000000
--- a/testing/web-platform/tests/resources/examples/apisample7.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<title>Example with file_is_test (should fail)</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-<script>
-onload = function() {
- assert_true(false);
- done();
-}
-</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/resources/examples/apisample8.html b/testing/web-platform/tests/resources/examples/apisample8.html
deleted file mode 100644
index 70853d9c6..000000000
--- a/testing/web-platform/tests/resources/examples/apisample8.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE HTML>
-<title>Example single page test with no body</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-<script>
-assert_true(true);
-done();
-</script> \ No newline at end of file
diff --git a/testing/web-platform/tests/resources/examples/apisample9.html b/testing/web-platform/tests/resources/examples/apisample9.html
deleted file mode 100644
index f84433dd1..000000000
--- a/testing/web-platform/tests/resources/examples/apisample9.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE HTML>
-<title>Example single page test with no asserts</title>
-<script src="../testharness.js"></script>
-<script src="../testharnessreport.js"></script>
-<script>
-done();
-</script> \ No newline at end of file