Bug 1461710 [wpt PR 11010] - [testharness.js] Formalize test types, a=testonly
authorMs2ger <Ms2ger@gmail.com>
Wed, 06 Jun 2018 14:21:48 +0000
changeset 422123 afcd9780ed2ab18e91056afa496431298192aec3
parent 422122 848a0652f242600d5768b32bf3d41e10e66372b8
child 422124 4c7ffde5d22fd7696ec2f98f1a1a47f9fbd06e12
push id34122
push userebalazs@mozilla.com
push dateMon, 11 Jun 2018 09:37:00 +0000
treeherdermozilla-central@9941eb8c3b29 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1461710, 11010
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1461710 [wpt PR 11010] - [testharness.js] Formalize test types, a=testonly Automatic update from web-platform-tests[testharness.js] Formalize test types (#11010) Previously, tests for the testharness.js framework were validated according to an implicit heuristic based on the presence of a `<script>` tag. Introduce a file naming convention to make this distinction explicit. This pattern makes the validation behavior easier to understand. It also supports future additions which further differentiate the way the two test types are interpreted. -- wpt-commits: f39e58dd6df046644fd58e58f648a476c0de712c wpt-pr: 11010
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/lint.whitelist
testing/web-platform/tests/resources/test/README.md
testing/web-platform/tests/resources/test/conftest.py
testing/web-platform/tests/resources/test/idl-helper.js
testing/web-platform/tests/resources/test/tests/add_cleanup.html
testing/web-platform/tests/resources/test/tests/add_cleanup_count.html
testing/web-platform/tests/resources/test/tests/add_cleanup_err.html
testing/web-platform/tests/resources/test/tests/add_cleanup_err_multi.html
testing/web-platform/tests/resources/test/tests/api-tests-1.html
testing/web-platform/tests/resources/test/tests/api-tests-2.html
testing/web-platform/tests/resources/test/tests/api-tests-3.html
testing/web-platform/tests/resources/test/tests/force_timeout.html
testing/web-platform/tests/resources/test/tests/functional/add_cleanup.html
testing/web-platform/tests/resources/test/tests/functional/add_cleanup_count.html
testing/web-platform/tests/resources/test/tests/functional/add_cleanup_err.html
testing/web-platform/tests/resources/test/tests/functional/add_cleanup_err_multi.html
testing/web-platform/tests/resources/test/tests/functional/api-tests-1.html
testing/web-platform/tests/resources/test/tests/functional/api-tests-2.html
testing/web-platform/tests/resources/test/tests/functional/api-tests-3.html
testing/web-platform/tests/resources/test/tests/functional/force_timeout.html
testing/web-platform/tests/resources/test/tests/functional/generate-callback.html
testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html
testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_primary_interface_of.html
testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_to_json_operation.html
testing/web-platform/tests/resources/test/tests/functional/iframe-callback.html
testing/web-platform/tests/resources/test/tests/functional/iframe-consolidate-errors.html
testing/web-platform/tests/resources/test/tests/functional/iframe-consolidate-tests.html
testing/web-platform/tests/resources/test/tests/functional/iframe-msg.html
testing/web-platform/tests/resources/test/tests/functional/order.html
testing/web-platform/tests/resources/test/tests/functional/promise-async.html
testing/web-platform/tests/resources/test/tests/functional/promise.html
testing/web-platform/tests/resources/test/tests/functional/single-page-test-fail.html
testing/web-platform/tests/resources/test/tests/functional/single-page-test-no-assertions.html
testing/web-platform/tests/resources/test/tests/functional/single-page-test-no-body.html
testing/web-platform/tests/resources/test/tests/functional/single-page-test-pass.html
testing/web-platform/tests/resources/test/tests/functional/uncaught-exception-handle.html
testing/web-platform/tests/resources/test/tests/functional/uncaught-exception-ignore.html
testing/web-platform/tests/resources/test/tests/functional/worker-dedicated.html
testing/web-platform/tests/resources/test/tests/functional/worker-error.js
testing/web-platform/tests/resources/test/tests/functional/worker-service.html
testing/web-platform/tests/resources/test/tests/functional/worker-shared.html
testing/web-platform/tests/resources/test/tests/functional/worker.js
testing/web-platform/tests/resources/test/tests/generate-callback.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlArray/is_json_type.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlDictionary/get_inheritance_stack.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlDictionary/test_partial_dictionary.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/default_to_json_operation.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/get_inheritance_stack.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/has_default_to_json_regular_operation.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/has_to_json_regular_operation.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/test_immutable_prototype.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/test_primary_interface_of.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/test_primary_interface_of_undefined.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/test_to_json_operation.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/traverse_inherited_and_consequential_interfaces.html
testing/web-platform/tests/resources/test/tests/idlharness/IdlInterfaceMember/is_to_json_regular_operation.html
testing/web-platform/tests/resources/test/tests/idlharness/OWNERS
testing/web-platform/tests/resources/test/tests/idlharness/basic.html
testing/web-platform/tests/resources/test/tests/idlharness/helper.js
testing/web-platform/tests/resources/test/tests/iframe-callback.html
testing/web-platform/tests/resources/test/tests/iframe-consolidate-errors.html
testing/web-platform/tests/resources/test/tests/iframe-consolidate-tests.html
testing/web-platform/tests/resources/test/tests/iframe-msg.html
testing/web-platform/tests/resources/test/tests/order.html
testing/web-platform/tests/resources/test/tests/promise-async.html
testing/web-platform/tests/resources/test/tests/promise.html
testing/web-platform/tests/resources/test/tests/single-page-test-fail.html
testing/web-platform/tests/resources/test/tests/single-page-test-no-assertions.html
testing/web-platform/tests/resources/test/tests/single-page-test-no-body.html
testing/web-platform/tests/resources/test/tests/single-page-test-pass.html
testing/web-platform/tests/resources/test/tests/uncaught-exception-handle.html
testing/web-platform/tests/resources/test/tests/uncaught-exception-ignore.html
testing/web-platform/tests/resources/test/tests/unit/IdlArray/is_json_type.html
testing/web-platform/tests/resources/test/tests/unit/IdlDictionary/get_inheritance_stack.html
testing/web-platform/tests/resources/test/tests/unit/IdlDictionary/test_partial_dictionary.html
testing/web-platform/tests/resources/test/tests/unit/IdlInterface/default_to_json_operation.html
testing/web-platform/tests/resources/test/tests/unit/IdlInterface/get_inheritance_stack.html
testing/web-platform/tests/resources/test/tests/unit/IdlInterface/has_default_to_json_regular_operation.html
testing/web-platform/tests/resources/test/tests/unit/IdlInterface/has_to_json_regular_operation.html
testing/web-platform/tests/resources/test/tests/unit/IdlInterface/test_primary_interface_of_undefined.html
testing/web-platform/tests/resources/test/tests/unit/IdlInterface/traverse_inherited_and_consequential_interfaces.html
testing/web-platform/tests/resources/test/tests/unit/IdlInterfaceMember/is_to_json_regular_operation.html
testing/web-platform/tests/resources/test/tests/unit/OWNERS
testing/web-platform/tests/resources/test/tests/unit/basic.html
testing/web-platform/tests/resources/test/tests/worker-dedicated.html
testing/web-platform/tests/resources/test/tests/worker-error.js
testing/web-platform/tests/resources/test/tests/worker-service.html
testing/web-platform/tests/resources/test/tests/worker-shared.html
testing/web-platform/tests/resources/test/tests/worker.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -402099,17 +402099,17 @@
    "2ecef188cb7cb27d10b6bf148eddb3f9a031771b",
    "support"
   ],
   "./check_stability.ini": [
    "5addd67f09e895336644c5a9f5049c03e1ffe615",
    "support"
   ],
   "./lint.whitelist": [
-   "b740ea6ee933d028f6b2bef92cc473778b76002f",
+   "f18a6bb277d2392446c790aa85eb008d5f3fe05d",
    "support"
   ],
   "./serve.py": [
    "0efa39b1f26f86d73f2fce4f9e46003d62057b41",
    "support"
   ],
   "./server-side.md": [
    "c51b17fbac2a2e3121dc74f7badbd2873ce92f61",
--- a/testing/web-platform/tests/lint.whitelist
+++ b/testing/web-platform/tests/lint.whitelist
@@ -209,17 +209,17 @@ SET TIMEOUT: webdriver/*
 SET TIMEOUT: webmessaging/*
 SET TIMEOUT: webstorage/eventTestHarness.js
 SET TIMEOUT: webvtt/*
 SET TIMEOUT: workers/*
 SET TIMEOUT: xhr/resources/init.htm
 SET TIMEOUT: xhr/resources/xmlhttprequest-timeout.js
 
 # generate_tests implementation and sample usage
-GENERATE_TESTS: resources/test/tests/generate-callback.html
+GENERATE_TESTS: resources/test/tests/functional/generate-callback.html
 GENERATE_TESTS: resources/testharness.js
 
 # generate_tests usage (should be got rid of)
 GENERATE_TESTS: 2dcontext/drawing-images-to-the-canvas/*
 GENERATE_TESTS: css/css-shapes/shape-outside/values/*
 GENERATE_TESTS: css/css-tables/bounding-box-computation-1.html
 GENERATE_TESTS: css/css-tables/bounding-box-computation-2.html
 GENERATE_TESTS: css/css-tables/bounding-box-computation-3.html
@@ -284,19 +284,19 @@ GENERATE_TESTS: shadow-dom/untriaged/sha
 SET TIMEOUT: css/css-fonts/font-display/font-display.html
 SET TIMEOUT: css/css-fonts/font-display/font-display-change.html
 SET TIMEOUT: css/css-fonts/font-display/font-display-change-ref.html
 SET TIMEOUT: css/css-fonts/font-display/font-display-preload.html
 SET TIMEOUT: html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html
 SET TIMEOUT: html/dom/documents/dom-tree-accessors/Document.currentScript.html
 SET TIMEOUT: html/webappapis/timers/*
 SET TIMEOUT: resources/chromium/*
-SET TIMEOUT: resources/test/tests/add_cleanup.html
-SET TIMEOUT: resources/test/tests/api-tests-1.html
-SET TIMEOUT: resources/test/tests/worker.js
+SET TIMEOUT: resources/test/tests/functional/add_cleanup.html
+SET TIMEOUT: resources/test/tests/functional/api-tests-1.html
+SET TIMEOUT: resources/test/tests/functional/worker.js
 SET TIMEOUT: resources/testharness.js
 
 # setTimeout use in reftests
 SET TIMEOUT: acid/acid3/test.html
 
 # Travis
 WEB-PLATFORM.TEST: .travis.yml
 
--- a/testing/web-platform/tests/resources/test/README.md
+++ b/testing/web-platform/tests/resources/test/README.md
@@ -21,34 +21,51 @@ specify the path to Firefox Nightly, use
 ### Automated Script
 
 Alternatively, you may run `tools/ci/ci_resources_unittest.sh`, which only depends on
 Python 2. The script will install other dependencies automatically and start `tox` with
 the correct arguments.
 
 ## Authoring Tests
 
-Test cases are expressed as `.html` files located within the `tests/`
-sub-directory. Each test should include the `testharness.js` library with the
-following markup:
+Test cases are expressed as `.html` files located within the `tests/unit/` and
+`tests/funtional/` sub-directories. Each test should include the
+`testharness.js` library with the following markup:
 
-    <script src="../../testharness.js"></script>
-    <script src="../../testharnessreport.js"></script>
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
 
 This should be followed by one or more `<script>` tags that interface with the
 `testharness.js` API in some way. For example:
 
     <script>
     test(function() {
         1 = 1;
       }, 'This test is expected to fail.');
     </script>
 
-Finally, each test may include a summary of the expected results as a JSON
-string within a `<script>` tag with an `id` of `"expected"`, e.g.:
+### Unit tests
+
+The "unit test" type allows for concisely testing the expected behavior of
+assertion methods. These tests may define any number of sub-tests; the
+acceptance criteria is simply that all tests executed pass.
+
+### Functional tests
+
+Thoroughly testing the behavior of the harness itself requires ensuring a
+number of considerations which cannot be verified with the "unit testing"
+strategy. These include:
+
+- Ensuring that some tests are not run
+- Ensuring conditions that cause test failures
+- Ensuring conditions that cause harness errors
+
+Functional tests allow for these details to be verified. Every functional test
+must include a summary of the expected results as a JSON string within a
+`<script>` tag with an `id` of `"expected"`, e.g.:
 
     <script type="text/json" id="expected">
     {
       "summarized_status": {
         "message": null,
         "stack": null,
         "status_string": "OK"
       },
@@ -59,11 +76,8 @@ string within a `<script>` tag with an `
           "properties": {},
           "stack": "(implementation-defined)",
           "status_string": "FAIL"
         }
       ],
       "type": "complete"
     }
     </script>
-
-This is useful to test, for example, whether asserations that should fail or
-throw actually do.
--- a/testing/web-platform/tests/resources/test/conftest.py
+++ b/testing/web-platform/tests/resources/test/conftest.py
@@ -12,29 +12,39 @@ ENC = 'utf8'
 HERE = os.path.dirname(os.path.abspath(__file__))
 WPT_ROOT = os.path.normpath(os.path.join(HERE, '..', '..'))
 HARNESS = os.path.join(HERE, 'harness.html')
 
 def pytest_addoption(parser):
     parser.addoption("--binary", action="store", default=None, help="path to browser binary")
 
 def pytest_collect_file(path, parent):
-    if path.ext.lower() == '.html':
-        return HTMLItem(str(path), parent)
+    if path.ext.lower() != '.html':
+        return
+
+    # Tests are organized in directories by type
+    test_type = os.path.relpath(str(path), HERE).split(os.path.sep)[1]
+
+    return HTMLItem(str(path), test_type, parent)
 
 def pytest_configure(config):
     config.driver = webdriver.Firefox(firefox_binary=config.getoption("--binary"))
     config.server = WPTServer(WPT_ROOT)
     config.server.start()
     config.add_cleanup(config.server.stop)
     config.add_cleanup(config.driver.quit)
 
 class HTMLItem(pytest.Item, pytest.Collector):
-    def __init__(self, filename, parent):
+    def __init__(self, filename, test_type, parent):
         self.filename = filename
+        self.type = test_type
+
+        if test_type not in ('functional', 'unit'):
+            raise ValueError('Unrecognized test type: "%s"' % test_type)
+
         with io.open(filename, encoding=ENC) as f:
             markup = f.read()
 
         parsed = html5lib.parse(markup, namespaceHTMLElements=False)
         name = None
         self.expected = None
 
         for element in parsed.getiterator():
@@ -42,53 +52,80 @@ class HTMLItem(pytest.Item, pytest.Colle
                 name = element.text
                 continue
             if element.attrib.get('id') == 'expected':
                 self.expected = json.loads(unicode(element.text))
                 continue
 
         if not name:
             raise ValueError('No name found in file: %s' % filename)
+        elif self.type == 'functional' and not self.expected:
+            raise ValueError('Functional tests must specify expected report data')
+        elif self.type == 'unit' and self.expected:
+            raise ValueError('Unit tests must not specify expected report data')
 
         super(HTMLItem, self).__init__(name, parent)
 
 
     def reportinfo(self):
         return self.fspath, None, self.filename
 
     def repr_failure(self, excinfo):
         return pytest.Collector.repr_failure(self, excinfo)
 
     def runtest(self):
+        if self.type == 'unit':
+            self._run_unit_test()
+        elif self.type == 'functional':
+            self._run_functional_test()
+        else:
+            raise NotImplementedError
+
+    def _run_unit_test(self):
+        driver = self.session.config.driver
+        server = self.session.config.server
+
+        driver.get(server.url(HARNESS))
+
+        actual = driver.execute_async_script('runTest("%s", "foo", arguments[0])' % server.url(str(self.filename)))
+
+        summarized = self._summarize(actual)
+
+        assert summarized[u'summarized_status'][u'status_string'] == u'OK', summarized[u'summarized_status'][u'message']
+        for test in summarized[u'summarized_tests']:
+            msg = "%s\n%s" % (test[u'name'], test[u'message'])
+            assert test[u'status_string'] == u'PASS', msg
+
+    def _run_functional_test(self):
         driver = self.session.config.driver
         server = self.session.config.server
 
         driver.get(server.url(HARNESS))
 
         actual = driver.execute_async_script('runTest("%s", "foo", arguments[0])' % server.url(str(self.filename)))
 
         # Test object ordering is not guaranteed. This weak assertion verifies
         # that the indices are unique and sequential
         indices = [test_obj.get('index') for test_obj in actual['tests']]
         self._assert_sequence(indices)
 
+        summarized = self._summarize(actual)
+
+        assert summarized == self.expected
+
+    def _summarize(self, actual):
         summarized = {}
+
         summarized[u'summarized_status'] = self._summarize_status(actual['status'])
         summarized[u'summarized_tests'] = [
             self._summarize_test(test) for test in actual['tests']]
         summarized[u'summarized_tests'].sort(key=lambda test_obj: test_obj.get('name'))
         summarized[u'type'] = actual['type']
 
-        if not self.expected:
-            assert summarized[u'summarized_status'][u'status_string'] == u'OK', summarized[u'summarized_status'][u'message']
-            for test in summarized[u'summarized_tests']:
-                msg = "%s\n%s" % (test[u'name'], test[u'message'])
-                assert test[u'status_string'] == u'PASS', msg
-        else:
-            assert summarized == self.expected
+        return summarized
 
     @staticmethod
     def _assert_sequence(nums):
         if nums and len(nums) > 0:
             assert nums == range(1, nums[-1] + 1)
 
     @staticmethod
     def _scrub_stack(test_obj):
rename from testing/web-platform/tests/resources/test/tests/idlharness/helper.js
rename to testing/web-platform/tests/resources/test/idl-helper.js
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/add_cleanup.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Test#add_cleanup</title>
-<script src="../../testharness.js"></script>
-<script src="../../testharnessreport.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-"use strict";
-
-var log_sync;
-test(function(t) {
-  log_sync = "";
-  t.add_cleanup(function() { log_sync += "1"; });
-  t.add_cleanup(function() { log_sync += "2"; });
-  t.add_cleanup(function() { log_sync += "3"; });
-  t.add_cleanup(function() { log_sync += "4"; });
-  t.add_cleanup(function() { log_sync += "5"; });
-  log_sync += "0";
-}, "probe synchronous");
-
-test(function() {
-  if (log_sync !== "012345") {
-    throw new Error("Expected: '012345'. Actual: '" + log_sync + "'.");
-  }
-}, "Cleanup methods are invoked exactly once and in the expected sequence.");
-
-var complete, log_async;
-async_test(function(t) {
-  complete = t.step_func(function() {
-    if (log_async !== "012") {
-      throw new Error("Expected: '012'. Actual: '" + log_async + "'.");
-    }
-
-    t.done();
-  });
-}, "Cleanup methods are invoked following the completion of asynchronous tests");
-
-async_test(function(t) {
-  log_async = "";
-  t.add_cleanup(function() { log_async += "1"; });
-
-  setTimeout(t.step_func(function() {
-    t.add_cleanup(function() {
-      log_async += "2";
-      complete();
-    });
-    log_async += "0";
-    t.done();
-  }), 0);
-}, "probe asynchronous");
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Cleanup methods are invoked exactly once and in the expected sequence.",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Cleanup methods are invoked following the completion of asynchronous tests",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "probe asynchronous",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "probe synchronous",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/add_cleanup_count.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Test#add_cleanup reported count</title>
-<script src="../../testharness.js"></script>
-<script src="../../testharnessreport.js"></script>
-</head>
-<body>
-<div id="log"></div>
-
-<script>
-promise_test(function(t) {
-    t.add_cleanup(function() {});
-    t.add_cleanup(function() {});
-    t.add_cleanup(function() { throw new Error(); });
-    new EventWatcher(t, document.body, []);
-
-    return Promise.resolve();
-}, 'test with 3 user-defined cleanup functions');
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "ERROR",
-    "message": "Test named 'test with 3 user-defined cleanup functions' specified 3 'cleanup' functions, and 1 failed."
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "test with 3 user-defined cleanup functions",
-      "message": null,
-      "properties": {}
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/add_cleanup_err.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Test#add_cleanup: error</title>
-<script src="../../testharness.js"></script>
-<script src="../../testharnessreport.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-"use strict";
-
-test(function(t) {
-  t.add_cleanup(function() {
-    throw new Error('exception in cleanup function');
-  });
-}, "Exception in cleanup function causes harness failure.");
-
-test(function() {}, "This test should not be run.");
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "ERROR",
-    "message": "Test named 'Exception in cleanup function causes harness failure.' specified 1 'cleanup' function, and 1 failed."
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Exception in cleanup function causes harness failure.",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "NOTRUN",
-      "name": "This test should not be run.",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/add_cleanup_err_multi.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Test#add_cleanup: multiple functions with one in error</title>
-<script src="../../testharness.js"></script>
-<script src="../../testharnessreport.js"></script>
-</head>
-<body>
-<div id="log"></div>
-
-<script>
-"use strict";
-
-test(function(t) {
-    t.add_cleanup(function() {
-      throw new Error("exception in cleanup function");
-    });
-
-    // The following cleanup function defines a test so that the reported
-    // data demonstrates the intended run-time behavior, i.e. that
-    // `testharness.js` invokes all cleanup functions even when one or more
-    // throw errors.
-    t.add_cleanup(function() {
-      test(function() {}, "Verification test");
-    });
-  }, "Test with multiple cleanup functions");
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "ERROR",
-    "message": "Test named 'Test with multiple cleanup functions' specified 2 'cleanup' functions, and 1 failed."
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Test with multiple cleanup functions",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "NOTRUN",
-      "name": "Verification test",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/api-tests-1.html
+++ /dev/null
@@ -1,427 +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 assertArrayEqualsUndefined()
-    {
-        assert_array_equals(undefined, [1], "undefined equals [1]?");
-    }
-    test(assertArrayEqualsUndefined, "assert_array_equals with first param undefined");
-
-    function assertArrayEqualsTrue()
-    {
-        assert_array_equals(true, [1], "true equals [1]?");
-    }
-    test(assertArrayEqualsTrue, "assert_array_equals with first param true");
-
-    function assertArrayEqualsFalse()
-    {
-        assert_array_equals(false, [1], "false equals [1]?");
-    }
-    test(assertArrayEqualsFalse, "assert_array_equals with first param false");
-
-    function assertArrayEqualsNull()
-    {
-        assert_array_equals(null, [1], "null equals [1]?");
-    }
-    test(assertArrayEqualsNull, "assert_array_equals with first param null");
-
-    function assertArrayEqualsNumeric()
-    {
-        assert_array_equals(1, [1], "1 equals [1]?");
-    }
-    test(assertArrayEqualsNumeric, "assert_array_equals with first param 1");
-
-    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 basicAssertArrayApproxEquals()
-    {
-        assert_array_approx_equals([10, 11], [11, 10], 1, "[10, 11] is approximately (+/- 1) [11, 10]")
-    }
-    test(basicAssertArrayApproxEquals, "basic assert_array_approx_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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "TIMEOUT",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Setup function ran",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Test assert_throws with non-DOM-exception expected to Fail",
-      "message": "Test bug: unrecognized DOMException code \"TEST_ERR\" passed to assert_throws()",
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test async test with callback",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test async test with callback and `this` obj.",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test step_func",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test that cleanup handlers from previous test ran",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test that defines a global and cleans it up",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test throw DOM exception",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Test throw DOM exception expected to fail",
-      "message": "assert_throws: function \"function () {a.appendChild(b)}\" threw object \"HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy\" that is not a DOMException NOT_FOUND_ERR: property \"code\" is equal to 3, expected 8",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_array_equals with first param 1",
-      "message": "assert_array_equals: 1 equals [1]? value is 1, expected array",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_array_equals with first param false",
-      "message": "assert_array_equals: false equals [1]? value is false, expected array",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_array_equals with first param null",
-      "message": "assert_array_equals: null equals [1]? value is null, expected array",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_array_equals with first param true",
-      "message": "assert_array_equals: true equals [1]? value is true, expected array",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_array_equals with first param undefined",
-      "message": "assert_array_equals: undefined equals [1]? value is undefined, expected array",
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "assert_equals tests",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_equals tests expected to fail",
-      "message": "assert_equals: Zero case expected 0 but got -0",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_greater_than expected to fail",
-      "message": "assert_greater_than: 10 is not greater than 11 expected a number greater than 11 but got 10",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_less_than_equal expected to fail",
-      "message": "assert_greater_than_equal: '10' is not a number expected a number but got a \"string\"",
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "assert_not_equals tests",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "assert_true expected to fail",
-      "message": "assert_true: false should not be true expected true got false",
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "assert_true expected to pass",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "NOTRUN",
-      "name": "async test that is never started, should have status Not Run",
-      "message": null,
-      "properties": {
-        "timeout": 1000
-      }
-    },
-    {
-      "status_string": "PASS",
-      "name": "basic assert_approx_equals test",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "basic assert_array_approx_equals test",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "basic assert_array_equals test",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "basic assert_greater_than_equal test",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "basic assert_less_than test",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "basic assert_object_equals test",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "body element fires the onload event set from the attribute",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "document.body should be the first body element in the document",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "test for assert[_not]_exists and insert_inherits",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "TIMEOUT",
-      "name": "test should timeout (fail) with a custom set timeout value of 1 second",
-      "message": "Test timed out",
-      "properties": {
-        "timeout": 1000
-      }
-    },
-    {
-      "status_string": "TIMEOUT",
-      "name": "test should timeout (fail) with the default of 2 seconds",
-      "message": "Test timed out",
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "window onload event fires when set from the handler",
-      "message": null,
-      "properties": {}
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/api-tests-2.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Sample HTML5 API Tests</title>
-</head>
-<body>
-<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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Test defined after onload",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test defined before onload",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/api-tests-3.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Sample HTML5 API Tests</title>
-</head>
-<script src="../../testharness.js"></script>
-
-<body>
-<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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "TIMEOUT",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "NOTRUN",
-      "name": "This test should give a status of 'Not Run' without a delay",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/force_timeout.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Test#force_timeout</title>
-</head>
-<body>
-<h1>Test#force_timeout</h1>
-<div id="log"></div>
-<script src="../../testharness.js"></script>
-<script src="../../testharnessreport.js"></script>
-<script>
-setup({ explicit_timeout: true });
-
-test(function(t) {
-    t.force_timeout();
-  }, 'test (synchronous)');
-
-async_test(function(t) {
-    t.step_timeout(function() {
-        t.force_timeout();
-      }, 0);
-  }, 'async_test');
-
-promise_test(function(t) {
-    t.force_timeout();
-
-    return new Promise(function() {});
-  }, 'promise_test');
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "TIMEOUT",
-      "name": "async_test",
-      "message": "Test timed out",
-      "properties": {}
-    },
-    {
-      "status_string": "TIMEOUT",
-      "name": "promise_test",
-      "message": "Test timed out",
-      "properties": {}
-    },
-    {
-      "status_string": "TIMEOUT",
-      "name": "test (synchronous)",
-      "message": "Test timed out",
-      "properties": {}
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/add_cleanup.html
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test#add_cleanup</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+"use strict";
+
+var log_sync;
+test(function(t) {
+  log_sync = "";
+  t.add_cleanup(function() { log_sync += "1"; });
+  t.add_cleanup(function() { log_sync += "2"; });
+  t.add_cleanup(function() { log_sync += "3"; });
+  t.add_cleanup(function() { log_sync += "4"; });
+  t.add_cleanup(function() { log_sync += "5"; });
+  log_sync += "0";
+}, "probe synchronous");
+
+test(function() {
+  if (log_sync !== "012345") {
+    throw new Error("Expected: '012345'. Actual: '" + log_sync + "'.");
+  }
+}, "Cleanup methods are invoked exactly once and in the expected sequence.");
+
+var complete, log_async;
+async_test(function(t) {
+  complete = t.step_func(function() {
+    if (log_async !== "012") {
+      throw new Error("Expected: '012'. Actual: '" + log_async + "'.");
+    }
+
+    t.done();
+  });
+}, "Cleanup methods are invoked following the completion of asynchronous tests");
+
+async_test(function(t) {
+  log_async = "";
+  t.add_cleanup(function() { log_async += "1"; });
+
+  setTimeout(t.step_func(function() {
+    t.add_cleanup(function() {
+      log_async += "2";
+      complete();
+    });
+    log_async += "0";
+    t.done();
+  }), 0);
+}, "probe asynchronous");
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Cleanup methods are invoked exactly once and in the expected sequence.",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Cleanup methods are invoked following the completion of asynchronous tests",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "probe asynchronous",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "probe synchronous",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/add_cleanup_count.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test#add_cleanup reported count</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+
+<script>
+promise_test(function(t) {
+    t.add_cleanup(function() {});
+    t.add_cleanup(function() {});
+    t.add_cleanup(function() { throw new Error(); });
+    new EventWatcher(t, document.body, []);
+
+    return Promise.resolve();
+}, 'test with 3 user-defined cleanup functions');
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "ERROR",
+    "message": "Test named 'test with 3 user-defined cleanup functions' specified 3 'cleanup' functions, and 1 failed."
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "test with 3 user-defined cleanup functions",
+      "message": null,
+      "properties": {}
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/add_cleanup_err.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test#add_cleanup: error</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+"use strict";
+
+test(function(t) {
+  t.add_cleanup(function() {
+    throw new Error('exception in cleanup function');
+  });
+}, "Exception in cleanup function causes harness failure.");
+
+test(function() {}, "This test should not be run.");
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "ERROR",
+    "message": "Test named 'Exception in cleanup function causes harness failure.' specified 1 'cleanup' function, and 1 failed."
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Exception in cleanup function causes harness failure.",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "NOTRUN",
+      "name": "This test should not be run.",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/add_cleanup_err_multi.html
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test#add_cleanup: multiple functions with one in error</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+
+<script>
+"use strict";
+
+test(function(t) {
+    t.add_cleanup(function() {
+      throw new Error("exception in cleanup function");
+    });
+
+    // The following cleanup function defines a test so that the reported
+    // data demonstrates the intended run-time behavior, i.e. that
+    // `testharness.js` invokes all cleanup functions even when one or more
+    // throw errors.
+    t.add_cleanup(function() {
+      test(function() {}, "Verification test");
+    });
+  }, "Test with multiple cleanup functions");
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "ERROR",
+    "message": "Test named 'Test with multiple cleanup functions' specified 2 'cleanup' functions, and 1 failed."
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Test with multiple cleanup functions",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "NOTRUN",
+      "name": "Verification test",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/api-tests-1.html
@@ -0,0 +1,427 @@
+<!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="/resources/testharness.js"></script>
+<script src="/resources/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 assertArrayEqualsUndefined()
+    {
+        assert_array_equals(undefined, [1], "undefined equals [1]?");
+    }
+    test(assertArrayEqualsUndefined, "assert_array_equals with first param undefined");
+
+    function assertArrayEqualsTrue()
+    {
+        assert_array_equals(true, [1], "true equals [1]?");
+    }
+    test(assertArrayEqualsTrue, "assert_array_equals with first param true");
+
+    function assertArrayEqualsFalse()
+    {
+        assert_array_equals(false, [1], "false equals [1]?");
+    }
+    test(assertArrayEqualsFalse, "assert_array_equals with first param false");
+
+    function assertArrayEqualsNull()
+    {
+        assert_array_equals(null, [1], "null equals [1]?");
+    }
+    test(assertArrayEqualsNull, "assert_array_equals with first param null");
+
+    function assertArrayEqualsNumeric()
+    {
+        assert_array_equals(1, [1], "1 equals [1]?");
+    }
+    test(assertArrayEqualsNumeric, "assert_array_equals with first param 1");
+
+    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 basicAssertArrayApproxEquals()
+    {
+        assert_array_approx_equals([10, 11], [11, 10], 1, "[10, 11] is approximately (+/- 1) [11, 10]")
+    }
+    test(basicAssertArrayApproxEquals, "basic assert_array_approx_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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "TIMEOUT",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Setup function ran",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Test assert_throws with non-DOM-exception expected to Fail",
+      "message": "Test bug: unrecognized DOMException code \"TEST_ERR\" passed to assert_throws()",
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test async test with callback",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test async test with callback and `this` obj.",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test step_func",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test that cleanup handlers from previous test ran",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test that defines a global and cleans it up",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test throw DOM exception",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Test throw DOM exception expected to fail",
+      "message": "assert_throws: function \"function () {a.appendChild(b)}\" threw object \"HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy\" that is not a DOMException NOT_FOUND_ERR: property \"code\" is equal to 3, expected 8",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_array_equals with first param 1",
+      "message": "assert_array_equals: 1 equals [1]? value is 1, expected array",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_array_equals with first param false",
+      "message": "assert_array_equals: false equals [1]? value is false, expected array",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_array_equals with first param null",
+      "message": "assert_array_equals: null equals [1]? value is null, expected array",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_array_equals with first param true",
+      "message": "assert_array_equals: true equals [1]? value is true, expected array",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_array_equals with first param undefined",
+      "message": "assert_array_equals: undefined equals [1]? value is undefined, expected array",
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "assert_equals tests",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_equals tests expected to fail",
+      "message": "assert_equals: Zero case expected 0 but got -0",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_greater_than expected to fail",
+      "message": "assert_greater_than: 10 is not greater than 11 expected a number greater than 11 but got 10",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_less_than_equal expected to fail",
+      "message": "assert_greater_than_equal: '10' is not a number expected a number but got a \"string\"",
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "assert_not_equals tests",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "assert_true expected to fail",
+      "message": "assert_true: false should not be true expected true got false",
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "assert_true expected to pass",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "NOTRUN",
+      "name": "async test that is never started, should have status Not Run",
+      "message": null,
+      "properties": {
+        "timeout": 1000
+      }
+    },
+    {
+      "status_string": "PASS",
+      "name": "basic assert_approx_equals test",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "basic assert_array_approx_equals test",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "basic assert_array_equals test",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "basic assert_greater_than_equal test",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "basic assert_less_than test",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "basic assert_object_equals test",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "body element fires the onload event set from the attribute",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "document.body should be the first body element in the document",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "test for assert[_not]_exists and insert_inherits",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "TIMEOUT",
+      "name": "test should timeout (fail) with a custom set timeout value of 1 second",
+      "message": "Test timed out",
+      "properties": {
+        "timeout": 1000
+      }
+    },
+    {
+      "status_string": "TIMEOUT",
+      "name": "test should timeout (fail) with the default of 2 seconds",
+      "message": "Test timed out",
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "window onload event fires when set from the handler",
+      "message": null,
+      "properties": {}
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/api-tests-2.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Sample HTML5 API Tests</title>
+</head>
+<body>
+<h1>Sample HTML5 API Tests</h1>
+<p>There should be two results</p>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Test defined after onload",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test defined before onload",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/api-tests-3.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Sample HTML5 API Tests</title>
+</head>
+<script src="/resources/testharness.js"></script>
+
+<body>
+<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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "TIMEOUT",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "NOTRUN",
+      "name": "This test should give a status of 'Not Run' without a delay",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/force_timeout.html
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test#force_timeout</title>
+</head>
+<body>
+<h1>Test#force_timeout</h1>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+setup({ explicit_timeout: true });
+
+test(function(t) {
+    t.force_timeout();
+  }, 'test (synchronous)');
+
+async_test(function(t) {
+    t.step_timeout(function() {
+        t.force_timeout();
+      }, 0);
+  }, 'async_test');
+
+promise_test(function(t) {
+    t.force_timeout();
+
+    return new Promise(function() {});
+  }, 'promise_test');
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "TIMEOUT",
+      "name": "async_test",
+      "message": "Test timed out",
+      "properties": {}
+    },
+    {
+      "status_string": "TIMEOUT",
+      "name": "promise_test",
+      "message": "Test timed out",
+      "properties": {}
+    },
+    {
+      "status_string": "TIMEOUT",
+      "name": "test (synchronous)",
+      "message": "Test timed out",
+      "properties": {}
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/generate-callback.html
@@ -0,0 +1,153 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Sample for using generate_tests to create a series of tests that share the same callback.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Test to map a to 0",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test to map b to 1",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test to map c to 2",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test to map d to 3",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test to map e to 4",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test to map f to 5",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "first test",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "second test",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "sentinel check 1",
+      "properties": {
+        "sentinel": true
+      },
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "sentinel check 1 unique properties",
+      "properties": {
+        "sentinel": true
+      },
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "sentinel check 2",
+      "properties": {
+        "sentinel": true
+      },
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "sentinel check 2 unique properties",
+      "properties": {
+        "sentinel": false
+      },
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "third test",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html
@@ -0,0 +1,294 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>idlharness: Immutable prototypes</title>
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
+  <script src="/resources/WebIDLParser.js"></script>
+  <script src="/resources/idlharness.js"></script>
+</head>
+<body>
+<script>
+"use strictt";
+
+Object.defineProperty(window, "Foo", {
+    enumerable: false,
+    writable: true,
+    configurable: true,
+    value: function Foo() {}
+  });
+Object.defineProperty(window.Foo, "prototype", {
+    writable: false,
+    value: window.Foo.prototype
+  });
+Foo.prototype[Symbol.toStringTag] = "Foo";
+
+var idlArray = new IdlArray();
+idlArray.add_untested_idls("interface EventTarget {};");
+idlArray.add_idls(
+    "[Global=Window, Exposed=Window]\n" +
+    "interface Window : EventTarget {};\n" +
+
+    "[Global=Window, Exposed=Window, Constructor()]\n" +
+    "interface Foo {};"
+  );
+idlArray.add_objects({
+  Foo: ["new Foo()"],
+  Window: ["window"]
+});
+idlArray.test();
+</script>
+<script type="text/json" id="expected">
+{
+    "summarized_status": {
+        "message": null,
+        "status_string": "OK"
+    },
+    "summarized_tests": [
+        {
+            "name": "Foo interface object length",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface object name",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: existence and properties of interface object",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: existence and properties of interface prototype object",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: existence and properties of interface prototype object's \"constructor\" property",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: existence and properties of interface prototype object's @@unscopables property",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError",
+            "status_string": "FAIL",
+            "properties": {},
+            "message": "assert_throws: function \"function() {\n            Object.setPrototypeOf(obj, newValue);\n        }\" did not throw"
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false",
+            "status_string": "FAIL",
+            "properties": {},
+            "message": "assert_false: expected false got true"
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError",
+            "status_string": "FAIL",
+            "properties": {},
+            "message": "assert_throws: function \"function() {\n            obj.__proto__ = newValue;\n        }\" did not throw"
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError",
+            "status_string": "FAIL",
+            "properties": {},
+            "message": "assert_throws: function \"function() {\n            Object.setPrototypeOf(obj, newValue);\n        }\" did not throw"
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false",
+            "status_string": "FAIL",
+            "properties": {},
+            "message": "assert_false: expected false got true"
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError",
+            "status_string": "FAIL",
+            "properties": {},
+            "message": "assert_throws: function \"function() {\n            obj.__proto__ = newValue;\n        }\" did not throw"
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Foo must be primary interface of new Foo()",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Stringification of new Foo()",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Stringification of window",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface object length",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface object name",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: existence and properties of interface object",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: existence and properties of interface prototype object",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: existence and properties of interface prototype object's \"constructor\" property",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: existence and properties of interface prototype object's @@unscopables property",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        },
+        {
+            "name": "Window must be primary interface of window",
+            "status_string": "PASS",
+            "properties": {},
+            "message": null
+        }
+    ],
+    "type": "complete"
+}
+</script>
+</body>
+</html>
rename from testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/test_primary_interface_of.html
rename to testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_primary_interface_of.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/idlharness/IdlInterface/test_to_json_operation.html
@@ -0,0 +1,177 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <meta charset="utf-8">
+  <title>IdlInterface.prototype.test_to_json_operation()</title>
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
+  <script src="/resources/WebIDLParser.js"></script>
+  <script src="/resources/idlharness.js"></script>
+  <script src="../../../../idl-helper.js"></script>
+</head>
+<body>
+<script>
+    "use strict";
+    function wrap(member, obj) {
+        function F(obj) {
+            this._obj = obj;
+        }
+
+        F.prototype.toJSON = function() {
+            return this._obj;
+        }
+        Object.defineProperty(F, 'name', { value: member.name });
+        return new F(obj);
+    }
+
+    var i, obj;
+    i = interfaceFrom("interface A { [Default] object toJSON(); attribute long foo; };");
+    i.test_to_json_operation(wrap(i, { foo: 123 }), i.members[0]);
+
+    // should fail (wrong type)
+    i = interfaceFrom("interface B { [Default] object toJSON(); attribute long foo; };");
+    i.test_to_json_operation(wrap(i, { foo: "a value" }), i.members[0]);
+
+    // should handle extraneous attributes (e.g. from an extension specification)
+    i = interfaceFrom("interface C { [Default] object toJSON(); attribute long foo; };");
+    i.test_to_json_operation(wrap(i, { foo: 123, bar: 456 }), i.members[0]);
+
+    // should fail (missing property)
+    i = interfaceFrom("interface D { [Default] object toJSON(); attribute long foo; };");
+    i.test_to_json_operation(wrap(i, { }), i.members[0]);
+
+    // should fail (should be writable)
+    obj = Object.defineProperties({}, { foo: {
+        writable: false,
+        enumerable: true,
+        configurable: true,
+        value: 123
+    }});
+    i = interfaceFrom("interface F { [Default] object toJSON(); attribute long foo; };");
+    i.test_to_json_operation(wrap(i, obj), i.members[0]);
+
+    // should fail (should be enumerable)
+    obj = Object.defineProperties({}, { foo: {
+        writable: true,
+        enumerable: false,
+        configurable: true,
+        value: 123
+    }});
+    i = interfaceFrom("interface G { [Default] object toJSON(); attribute long foo; };");
+    i.test_to_json_operation(wrap(i, obj), i.members[0]);
+
+    // should fail (should be configurable)
+    obj = Object.defineProperties({}, { foo: {
+        writable: true,
+        enumerable: true,
+        configurable: false,
+        value: 123
+    }});
+    i = interfaceFrom("interface H { [Default] object toJSON(); attribute long foo; };");
+    i.test_to_json_operation(wrap(i, obj), i.members[0]);
+
+    var idl = new IdlArray();
+    idl.add_idls("interface I : J { [Default] object toJSON(); attribute long foo; };");
+    idl.add_idls("interface J { [Default] object toJSON(); attribute DOMString foo;};");
+    var i = idl.members.I;
+    i.test_to_json_operation(wrap(i, { foo: 123 }), i.members[0]);
+
+    i = interfaceFrom("interface K { [Default] object toJSON(); };");
+    i.test_to_json_operation(wrap(i, {}), i.members[0]);
+
+    i = interfaceFrom("interface L { DOMString toJSON(); };");
+    i.test_to_json_operation(wrap(i, "a string"), i.members[0]);
+
+    // should fail (wrong output type)
+    i = interfaceFrom("interface M { DOMString toJSON(); };");
+    i.test_to_json_operation(wrap(i, {}), i.members[0]);
+
+    // should fail (not an IDL type)
+    i = interfaceFrom("interface N { DOMException toJSON(); };");
+    i.test_to_json_operation(wrap(i, {}), i.members[0]);
+</script>
+<script type="text/json" id="expected">
+    {
+        "summarized_status": {
+            "message": null,
+            "status_string": "OK"
+        },
+        "summarized_tests": [
+            {
+                "message": null,
+                "name": "Test default toJSON operation of A",
+                "properties": {},
+                "status_string": "PASS"
+            },
+            {
+                "message": "assert_equals: expected \"number\" but got \"string\"",
+                "name": "Test default toJSON operation of B",
+                "properties": {},
+                "status_string": "FAIL"
+            },
+            {
+                "message": null,
+                "name": "Test default toJSON operation of C",
+                "properties": {},
+                "status_string": "PASS"
+            },
+            {
+                "message": "assert_true: property \"foo\" should be present in the output of D.prototype.toJSON() expected true got false",
+                "name": "Test default toJSON operation of D",
+                "properties": {},
+                "status_string": "FAIL"
+            },
+            {
+                "message": "assert_true: property foo should be writable expected true got false",
+                "name": "Test default toJSON operation of F",
+                "properties": {},
+                "status_string": "FAIL"
+            },
+            {
+                "message": "assert_true: property foo should be enumerable expected true got false",
+                "name": "Test default toJSON operation of G",
+                "properties": {},
+                "status_string": "FAIL"
+            },
+            {
+                "message": "assert_true: property foo should be configurable expected true got false",
+                "name": "Test default toJSON operation of H",
+                "properties": {},
+                "status_string": "FAIL"
+            },
+            {
+                "message": null,
+                "name": "Test default toJSON operation of I",
+                "properties": {},
+                "status_string": "PASS"
+            },
+            {
+                "message": null,
+                "name": "Test default toJSON operation of K",
+                "properties": {},
+                "status_string": "PASS"
+            },
+            {
+                "message": null,
+                "name": "Test toJSON operation of L",
+                "properties": {},
+                "status_string": "PASS"
+            },
+            {
+                "message": "assert_equals: expected \"string\" but got \"object\"",
+                "name": "Test toJSON operation of M",
+                "properties": {},
+                "status_string": "FAIL"
+            },
+            {
+                "message": "assert_true: {\"type\":\"return-type\",\"sequence\":false,\"generic\":null,\"nullable\":false,\"union\":false,\"idlType\":\"DOMException\"} is not an appropriate return value for the toJSON operation of N expected true got false",
+                "name": "Test toJSON operation of N",
+                "properties": {},
+                "status_string": "FAIL"
+            }
+        ],
+        "type": "complete"
+    }
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/iframe-callback.html
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Example with iframe that notifies containing document via callbacks</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/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");
+    // single-page-test-pass.html has a single test.
+    iframe.src = "single-page-test-pass.html";
+    iframe.style.setProperty("display", "none");
+    document.getElementById("target").appendChild(iframe);
+}
+</script>
+
+<div id="target">
+</div>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Example with iframe that notifies containing document via callbacks",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/iframe-consolidate-errors.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Example with iframe that consolidates errors via fetch_tests_from_window</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+var parent_test = async_test("Test executing in parent context");
+</script>
+</head>
+<body onload="parent_test.done()">
+<h1>Fetching Tests From a Child Context</h1>
+<p>This test demonstrates the use of <tt>fetch_tests_from_window</tt> to pull
+tests from an <tt>iframe</tt> into the primary document.</p>
+<p>The test suite is expected to fail due to an unhandled exception in the
+child context.</p>
+<div id="log"></div>
+
+<iframe id="childContext" src="uncaught-exception-handle.html" style="display:none"></iframe>
+<!-- apisample4.html is a failing suite due to an unhandled Error. -->
+
+<script>
+  var childContext = document.getElementById("childContext");
+  fetch_tests_from_window(childContext.contentWindow);
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "ERROR",
+    "message": "Error in remote: Error: Example Error"
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Test executing in parent context",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/iframe-consolidate-tests.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Example with iframe that consolidates tests via fetch_tests_from_window</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+var parent_test = async_test("Test executing in parent context");
+</script>
+</head>
+<body onload="parent_test.done()">
+<h1>Fetching Tests From a Child Context</h1>
+<p>This test demonstrates the use of <tt>fetch_tests_from_window</tt> to pull
+tests from an <tt>iframe</tt> into the primary document.</p>
+<p>The test suite will not complete until tests in the child context have finished
+executing</p>
+<div id="log"></div>
+
+<iframe id="childContext" src="promise-async.html" style="display:none"></iframe>
+<!-- promise-async.html has async tests with promises -->
+
+<script>
+  var childContext = document.getElementById("childContext");
+  fetch_tests_from_window(childContext.contentWindow);
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Promise rejection",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promise resolution",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Promises and test assertion failures (should fail)",
+      "properties": {},
+      "message": "assert_true: This failure is expected expected true got false"
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promises are supported in your browser",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promises resolution chaining",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test executing in parent context",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Use of step_func with Promises",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Use of unreached_func with Promises (should fail)",
+      "properties": {},
+      "message": "assert_unreached: This failure is expected Reached unreachable code"
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/iframe-msg.html
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Example with iframe that notifies containing document via cross document messaging</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/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="single-page-test-pass.html" style="display:none">
+  <!-- single-page-test-pass.html implements a file_is_test test. -->
+</iframe>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Containing document receives messages",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/order.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Ordering</title>
+<meta name="timeout" content="6000">
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(function() {}, 'second');
+test(function() {}, 'first');
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [{
+    "status_string": "PASS",
+    "name": "first",
+    "message": null,
+    "properties": {}
+  }, {
+    "status_string": "PASS",
+    "name": "second",
+    "message": null,
+    "properties": {}
+  }],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/promise-async.html
@@ -0,0 +1,172 @@
+<!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="/resources/testharness.js"></script>
+<script src="/resources/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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Promise rejection",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promise resolution",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Promises and test assertion failures (should fail)",
+      "properties": {},
+      "message": "assert_true: This failure is expected expected true got false"
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promises are supported in your browser",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promises resolution chaining",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Use of step_func with Promises",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Use of unreached_func with Promises (should fail)",
+      "properties": {},
+      "message": "assert_unreached: This failure is expected Reached unreachable code"
+    }
+  ],
+  "type": "complete"
+}
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/promise.html
@@ -0,0 +1,209 @@
+<!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="/resources/testharness.js"></script>
+<script src="/resources/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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "FAIL",
+      "name": "Assertion failure in a fulfill reaction (should FAIL with an expected failure)",
+      "message": "assert_true: Expected failure. expected true got false",
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Chain of promise resolutions",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promise fulfillment with result",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promise rejection with result",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "Promises are supported in your browser",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "PASS",
+      "name": "promise_test with function that doesn't return a Promise",
+      "message": null,
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "promise_test with function that doesn't return anything",
+      "message": "assert_not_equals: got disallowed value undefined",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "promise_test with unhandled exception in fulfill reaction (should FAIL)",
+      "message": "promise_test: Unhandled rejection with value: object \"Error: Expected exception.\"",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "promise_test with unhandled exception in reject reaction (should FAIL)",
+      "message": "promise_test: Unhandled rejection with value: object \"Error: Expected exception.\"",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "promise_test with unhandled rejection (should FAIL)",
+      "message": "promise_test: Unhandled rejection with value: \"Expected rejection\"",
+      "properties": {}
+    },
+    {
+      "status_string": "FAIL",
+      "name": "unreached_func as reactor (should FAIL with an expected failure)",
+      "message": "assert_unreached: Expected failure. Reached unreachable code",
+      "properties": {}
+    }
+  ],
+  "type": "complete"
+}
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/single-page-test-fail.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<title>Example with file_is_test (should fail)</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+onload = function() {
+  assert_true(false);
+  done();
+}
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "FAIL",
+      "name": "Example with file_is_test (should fail)",
+      "properties": {},
+      "message": "uncaught exception: Error: assert_true: expected true got false"
+    }
+  ],
+  "type": "complete"
+}
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/single-page-test-no-assertions.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<title>Example single page test with no asserts</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+done();
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Example single page test with no asserts",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/single-page-test-no-body.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<title>Example single page test with no body</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+assert_true(true);
+done();
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Example single page test with no body",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/single-page-test-pass.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<title>Example with file_is_test</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+onload = function() {
+  assert_true(true);
+  done();
+}
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Example with file_is_test",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/uncaught-exception-handle.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Harness Handling Uncaught Exception</title>
+</head>
+<script src="/resources/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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "ERROR",
+    "message": "Error: Example Error"
+  },
+  "summarized_tests": [
+    {
+      "status_string": "NOTRUN",
+      "name": "This should show a harness status of 'Error' and a test status of 'Not Run'",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/uncaught-exception-ignore.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Harness Ignoring Uncaught Exception</title>
+</head>
+<script src="/resources/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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "OK",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "setup({allow_uncaught_exception:true}) should allow tests to pass even if there is an exception",
+      "properties": {},
+      "message": null
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/worker-dedicated.html
@@ -0,0 +1,88 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Dedicated Worker Tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/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("worker.js"));
+
+fetch_tests_from_worker(new Worker("worker-error.js"));
+
+test(function(t) {
+        assert_false(false, "False is false");
+    },
+    "Test running on main document.");
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "ERROR",
+    "message": "Error: This failure is expected."
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Browser supports Workers",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Test running on main document.",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Untitled",
+      "properties": {},
+      "message": "Error: This failure is expected."
+    },
+    {
+      "status_string": "PASS",
+      "name": "Worker async_test that completes successfully",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Worker test that completes successfully",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "NOTRUN",
+      "name": "Worker test that doesn't run ('NOT RUN')",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Worker test that fails ('FAIL')",
+      "properties": {},
+      "message": "assert_true: Failing test expected true got false"
+    },
+    {
+      "status_string": "TIMEOUT",
+      "name": "Worker test that times out ('TIMEOUT')",
+      "properties": {},
+      "message": "Test timed out"
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/worker-error.js
@@ -0,0 +1,3 @@
+importScripts("/resources/testharness.js");
+
+throw new Error("This failure is expected.");
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/worker-service.html
@@ -0,0 +1,115 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Example with a service worker</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/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 = "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>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "TIMEOUT",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Browser supports ServiceWorker",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Register ServiceWorker",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Worker async_test that completes successfully",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "PASS",
+      "name": "Worker test that completes successfully",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "NOTRUN",
+      "name": "Worker test that doesn't run ('NOT RUN')",
+      "properties": {},
+      "message": null
+    },
+    {
+      "status_string": "FAIL",
+      "name": "Worker test that fails ('FAIL')",
+      "properties": {},
+      "message": "assert_true: Failing test expected true got false"
+    },
+    {
+      "status_string": "TIMEOUT",
+      "name": "Worker test that times out ('TIMEOUT')",
+      "properties": {},
+      "message": "Test timed out"
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/worker-shared.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Example with a shared worker</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/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("worker.js",
+                                         "My shared worker"));
+</script>
+<script type="text/json" id="expected">
+{
+  "summarized_status": {
+    "status_string": "TIMEOUT",
+    "message": null
+  },
+  "summarized_tests": [
+    {
+      "status_string": "PASS",
+      "name": "Browser supports SharedWorkers",
+      "properties": {},
+      "message": null
+    },
+    {
+      "message": null,
+      "name": "Worker async_test that completes successfully",
+      "properties": {},
+      "status_string": "PASS"
+    },
+    {
+      "message": null,
+      "name": "Worker test that completes successfully",
+      "properties": {},
+      "status_string": "PASS"
+    },
+    {
+      "message": null,
+      "name": "Worker test that doesn't run ('NOT RUN')",
+      "properties": {},
+      "status_string": "NOTRUN"
+    },
+    {
+      "message": "assert_true: Failing test expected true got false",
+      "name": "Worker test that fails ('FAIL')",
+      "properties": {},
+      "status_string": "FAIL"
+    },
+    {
+      "message": "Test timed out",
+      "name": "Worker test that times out ('TIMEOUT')",
+      "properties": {},
+      "status_string": "TIMEOUT"
+    }
+  ],
+  "type": "complete"
+}
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/functional/worker.js
@@ -0,0 +1,34 @@
+importScripts("/resources/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();
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/generate-callback.html
+++ /dev/null
@@ -1,153 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Test to map a to 0",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test to map b to 1",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test to map c to 2",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test to map d to 3",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test to map e to 4",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test to map f to 5",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "first test",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "second test",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "sentinel check 1",
-      "properties": {
-        "sentinel": true
-      },
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "sentinel check 1 unique properties",
-      "properties": {
-        "sentinel": true
-      },
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "sentinel check 2",
-      "properties": {
-        "sentinel": true
-      },
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "sentinel check 2 unique properties",
-      "properties": {
-        "sentinel": false
-      },
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "third test",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlArray/is_json_type.html
+++ /dev/null
@@ -1,194 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>IdlArray.prototype.is_json_type()</title>
-</head>
-<body>
-<div id="log"></div>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script src="../helper.js"></script>
-<script>
-    "use strict";
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_true(idl.is_json_type(typeFrom("DOMString")));
-        assert_true(idl.is_json_type(typeFrom("ByteString")));
-        assert_true(idl.is_json_type(typeFrom("USVString")));
-        idl.add_untested_idls('enum BarEnum { "a", "b", "c" };');
-        assert_true(idl.is_json_type(typeFrom("BarEnum")));
-    }, 'should return true for all string types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_false(idl.is_json_type(typeFrom("Error")));
-        assert_false(idl.is_json_type(typeFrom("DOMException")));
-    }, 'should return false for all exception types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_false(idl.is_json_type(typeFrom("Int8Array")));
-        assert_false(idl.is_json_type(typeFrom("Int16Array")));
-        assert_false(idl.is_json_type(typeFrom("Int32Array")));
-        assert_false(idl.is_json_type(typeFrom("Uint8Array")));
-        assert_false(idl.is_json_type(typeFrom("Uint16Array")));
-        assert_false(idl.is_json_type(typeFrom("Uint32Array")));
-        assert_false(idl.is_json_type(typeFrom("Uint8ClampedArray")));
-        assert_false(idl.is_json_type(typeFrom("Float32Array")));
-        assert_false(idl.is_json_type(typeFrom("ArrayBuffer")));
-        assert_false(idl.is_json_type(typeFrom("DataView")));
-    }, 'should return false for all buffer source types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_true(idl.is_json_type(typeFrom("boolean")));
-    }, 'should return true for boolean');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_true(idl.is_json_type(typeFrom("byte")));
-        assert_true(idl.is_json_type(typeFrom("octet")));
-        assert_true(idl.is_json_type(typeFrom("short")));
-        assert_true(idl.is_json_type(typeFrom("unsigned short")));
-        assert_true(idl.is_json_type(typeFrom("long")));
-        assert_true(idl.is_json_type(typeFrom("unsigned long")));
-        assert_true(idl.is_json_type(typeFrom("long long")));
-        assert_true(idl.is_json_type(typeFrom("unsigned long long")));
-        assert_true(idl.is_json_type(typeFrom("float")));
-        assert_true(idl.is_json_type(typeFrom("unrestricted float")));
-        assert_true(idl.is_json_type(typeFrom("double")));
-        assert_true(idl.is_json_type(typeFrom("unrestricted double")));
-    }, 'should return true for all numeric types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_false(idl.is_json_type(typeFrom("Promise<DOMString>")));
-    }, 'should return false for promises');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_false(idl.is_json_type(typeFrom("sequence<DOMException>")));
-        assert_true(idl.is_json_type(typeFrom("sequence<DOMString>")));
-    }, 'should handle sequences according to their inner types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_false(idl.is_json_type(typeFrom("FrozenArray<DOMException>")));
-        assert_true(idl.is_json_type(typeFrom("FrozenArray<DOMString>")));
-    }, 'should handle frozen arrays according to their inner types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_true(idl.is_json_type(typeFrom("record<DOMString, DOMString>")));
-        assert_false(idl.is_json_type(typeFrom("record<DOMString, Error>")));
-    }, 'should handle records according to their inner types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_true(idl.is_json_type(typeFrom("object")));
-    }, 'should return true for object type');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_false(idl.is_json_type(typeFrom("any")));
-    }, 'should return false for any type');
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('dictionary Foo { DOMString foo; }; dictionary Bar : Foo { DOMString bar; };');
-        assert_true(idl.is_json_type(typeFrom("Foo")));
-        assert_true(idl.is_json_type(typeFrom("Bar")));
-    }, 'should return true for dictionaries whose members are all JSON types');
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('dictionary Foo { };');
-        assert_true(idl.is_json_type(typeFrom("Foo")));
-    }, 'should return true for dictionaries which have no members');
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('dictionary FooBar { DOMString a; Error b; }; dictionary Baz : FooBar {};');
-        assert_false(idl.is_json_type(typeFrom("FooBar")));
-        assert_false(idl.is_json_type(typeFrom("Baz")));
-    }, 'should return false for dictionaries whose members are not all JSON types');
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('interface Foo { DOMString toJSON(); };');
-        assert_true(idl.is_json_type(typeFrom("Foo")));
-    }, 'should return true for interfaces which declare a toJSON operation');
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('interface Foo { DOMString toJSON(); }; interface Bar : Foo { };');
-        assert_true(idl.is_json_type(typeFrom("Bar")));
-    }, 'should return true for interfaces which inherit from an interface which declares a toJSON operation');
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('interface Foo { }; interface Bar { DOMString toJSON(); }; Foo implements Bar;');
-        assert_true(idl.is_json_type(typeFrom("Foo")));
-    }, 'should return true for interfaces which mixin an interface which declare a toJSON operation');
-
-//    test(function() {
-//        var idl = new IdlArray();
-//        idl.add_untested_idls('interface Foo { }; interface Bar { }; interface Baz { DOMString toJSON(); }; Foo implements Bar; Bar implements Baz;');
-//        assert_true(idl.is_json_type(typeFrom("Foo")));
-//    }, 'should return true for interfaces which mixin an interface which itself mixes in an interface which declares a toJSON operation');
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('interface Foo { };');
-        assert_false(idl.is_json_type(typeFrom("Foo")));
-    }, 'should return false for interfaces which do not declare a toJSON operation');
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('interface Foo { object toJSON(); };');
-        assert_true(idl.is_json_type(typeFrom("(Foo or DOMString)")));
-    }, 'should return true for union types whose member types are JSON types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_false(idl.is_json_type(typeFrom("(DataView or DOMString)")));
-    }, 'should return false for union types whose member types are not all JSON types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_true(idl.is_json_type(typeFrom("DOMString?")));
-        assert_false(idl.is_json_type(typeFrom("DataView?")));
-    }, 'should consider the inner types of nullable types');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_true(idl.is_json_type(typeFrom("[XAttr] long")));
-        assert_false(idl.is_json_type(typeFrom("[XAttr] DataView")));
-    }, 'should consider the inner types of annotated types.');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_throws(new Error(), _ => idl.is_json_type(typeFrom("Foo")));
-    }, "should throw if it references a dictionary, enum or interface which wasn't added to the IdlArray");
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_untested_idls('interface Foo : Bar { };');
-        assert_throws(new Error(), _ => idl.is_json_type(typeFrom("Foo")));
-    }, "should throw for interfaces which inherit from another interface which wasn't added to the IdlArray");
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_true(idl.is_json_type(typedefFrom("typedef double DOMHighResTimeStamp;").idlType));
-    }, 'should return true for typedefs whose source type is a JSON type');
-
-    test(function() {
-        var idl = new IdlArray();
-        assert_false(idl.is_json_type(typedefFrom("typedef DataView DOMHighResTimeStamp;").idlType));
-    }, 'should return false for typedefs whose source type is not a JSON type');
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlDictionary/get_inheritance_stack.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>IdlDictionary.prototype.get_inheritance_stack()</title>
-</head>
-<body>
-<div id="log"></div>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script src="../helper.js"></script>
-<script>
-    "use strict";
-    test(function() {
-        var stack = dictionaryFrom('dictionary A { };').get_inheritance_stack();
-        assert_array_equals(stack.map(d => d.name), ["A"]);
-    }, 'should return an array that includes itself.');
-
-    test(function() {
-        var d = dictionaryFrom('dictionary A : B { };');
-        assert_throws(new Error(), _ => d.get_inheritance_stack());
-    }, "should throw for dictionaries which inherit from another dictionary which wasn't added to the IdlArray");
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_idls('dictionary A : B { };');
-        idl.add_untested_idls('dictionary B : C { }; dictionary C { };');
-        var A = idl.members["A"];
-        assert_array_equals(A.get_inheritance_stack().map(d => d.name), ["A", "B", "C"]);
-    }, 'should return an array of inherited dictionaries in order of inheritance, starting with itself.');
-
-    test(function () {
-      let i = new IdlArray();
-      i.add_untested_idls('dictionary A : B {};');
-      i.assert_throws(new IdlHarnessError('A inherits B, but B is undefined.'), i => i.test());
-    }, 'A : B with B undeclared should throw IdlHarnessError');
-
-    test(function () {
-      let i = new IdlArray();
-      i.add_untested_idls('dictionary A : B {};');
-      i.add_untested_idls('interface B {};');
-      i.assert_throws(new IdlHarnessError('A inherits B, but A is not an interface.'), i => i.test());
-    }, 'dictionary A : B with B interface should throw IdlHarnessError');
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlDictionary/test_partial_dictionary.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-
-<head>
-  <meta charset="utf-8">
-  <title>idlharness: partial dictionaries</title>
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="/resources/WebIDLParser.js"></script>
-  <script src="/resources/idlharness.js"></script>
-  <script src="../helper.js"></script>
-</head>
-
-<body>
-<pre id='idl'>
-dictionary A {};
-partial dictionary A {
-  boolean B;
-};
-partial dictionary A {
-  boolean C;
-};
-</pre>
-
-<script>
-'use strict';
-
-test(() => {
-  let idlArray = new IdlArray();
-  idlArray.add_idls(document.getElementById('idl').textContent);
-  idlArray.test();
-
-  let members = idlArray.members["A"].members.map(m => m.name);
-  assert_array_equals(members, ["B", "C"], 'A should contain B, C');
-}, 'Partial dictionaries');
-
-test(() => {
-  let idlArray = new IdlArray();
-  idlArray.add_idls('partial dictionary D {};');
-  idlArray.assert_throws('Partial dictionary D with no original dictionary', i => i.test());
-}, 'Partial-only dictionary definition')
-</script>
-
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/default_to_json_operation.html
+++ /dev/null
@@ -1,189 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>IdlDictionary.prototype.default_to_json_operation()</title>
-</head>
-<body>
-<div id="log"></div>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script src="../helper.js"></script>
-<pre id=fragments>
-    interface A : B {
-      attribute DOMString a;
-    };
-
-    interface B : C {
-      [Default] object toJSON();
-      attribute long b;
-    };
-
-    interface C {
-      attribute DOMString c;
-    };
-
-    interface D : E {
-      [Default] object toJSON();
-      attribute float d;
-    };
-
-    interface E : F {
-      attribute DOMString e;
-    };
-
-    interface F {
-      [Default] object toJSON();
-      attribute unrestricted double f;
-    };
-
-    interface G {
-      [Default] object toJSON();
-      attribute octet g;
-    };
-
-    interface H {
-      [Default] object toJSON();
-      attribute DOMString h;
-    };
-
-    interface I {
-      [Default] object toJSON();
-      attribute boolean i;
-    };
-
-    interface J {
-      [Default] object toJSON();
-      attribute D j;
-    };
-
-    A implements G;
-    A implements H;
-    B implements D;
-    E implements I;
-    H implements J;
-</pre>
-<script>
-    "use strict";
-    test(function() {
-        var map = interfaceFrom('interface A { [Default] object toJSON(); };').default_to_json_operation();
-        assert_equals(map.size, 0);
-    }, 'should return an empty map when there are no attributes');
-
-    test(function() {
-        var r = interfaceFrom('interface A { };').default_to_json_operation();
-        assert_equals(r, null);
-    }, 'should return null when there is no toJSON method');
-
-    test(function() {
-        var r = interfaceFrom('interface A { DOMString toJSON(); };').default_to_json_operation();
-        assert_equals(r, null);
-    }, 'should return null when there is a toJSON method but it does not have the [Default] extended attribute');
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A : B { DOMString toJSON(); };");
-        context.add_idls("interface B { [Default] object toJSON(); };");
-        var r = context.members.A.default_to_json_operation();
-        assert_equals(r, null);
-    }, 'should return null when there is a toJSON method but it does not have the [Default] extended attribute even if this extended attribute exists on inherited interfaces');
-
-    test(function() {
-        var map = interfaceFrom('interface A { [Default] object toJSON(); static attribute DOMString foo; };').default_to_json_operation();
-        assert_equals(map.size, 0);
-    }, 'should not include static attributes');
-
-    test(function() {
-        var map = interfaceFrom('interface A { [Default] object toJSON(); attribute Promise<DOMString> bar; };').default_to_json_operation();
-        assert_equals(map.size, 0);
-    }, 'should not include attributes which are not JSON types');
-
-    test(function() {
-        var map = interfaceFrom('interface A { [Default] object toJSON(); DOMString bar(); };').default_to_json_operation();
-        assert_equals(map.size, 0);
-    }, 'should not include operations');
-
-    test(function() {
-        var map = interfaceFrom('interface A { [Default] object toJSON(); attribute DOMString bar; };').default_to_json_operation();
-        assert_equals(map.size, 1);
-        assert_true(map.has("bar"));
-        assert_equals(map.get("bar").idlType, "DOMString");
-    }, 'should return a map whose key/value pair represent the identifier and IDL type of valid attributes');
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A : B { [Default] object toJSON(); attribute DOMString a; };");
-        context.add_idls("interface B { [Default] object toJSON(); attribute long b; };");
-        var map = context.members.A.default_to_json_operation();
-        assert_array_equals([...map.keys()], ["b", "a"]);
-        assert_array_equals([...map.values()].map(v => v.idlType), ["long", "DOMString"]);
-    }, 'should return a properly ordered map that contains IDL types of valid attributes for inherited interfaces');
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A : B { attribute DOMString a; };");
-        context.add_idls("interface B { [Default] object toJSON(); attribute long b; };");
-        var map = context.members.A.default_to_json_operation();
-        assert_equals(map.size, 1);
-        assert_true(map.has("b"));
-        assert_equals(map.get("b").idlType, "long");
-        assert_array_equals([...map.keys()], ["b"]);
-    }, 'should not include attributes of the current interface when the [Default] toJSON method in inherited');
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A : B { [Default] object toJSON(); };");
-        context.add_idls("interface B : C { [Default] object toJSON(); attribute DOMString foo; };");
-        context.add_idls("interface C { [Default] object toJSON(); attribute long foo; };");
-        var map = context.members.A.default_to_json_operation();
-        assert_equals(map.size, 1);
-        assert_true(map.has("foo"));
-        assert_equals(map.get("foo").idlType, "DOMString");
-    }, 'attributes declared further away in the inheritance hierarchy should be masked by attributes declared closer');
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A : B { [Default] object toJSON(); attribute DOMString a; };");
-        context.add_idls("interface B { object toJSON(); attribute long b; };");
-        var map = context.members.A.default_to_json_operation();
-        assert_equals(map.size, 1);
-        assert_true(map.has("a"));
-        assert_false(map.has("b"));
-        assert_equals(map.get("a").idlType, "DOMString");
-    }, 'should return an ordered map that ignores attributes of inherited interfaces which do not declare a [Default] toJSON operation.');
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A { [Default] object toJSON(); attribute DOMString a; };");
-        context.add_idls("interface N { [Default] object toJSON(); attribute long n; };");
-        context.add_idls("A implements N;");
-        var map = context.members.A.default_to_json_operation();
-        assert_array_equals([...map.keys()], ["a", "n"]);
-        assert_array_equals([...map.values()].map(v => v.idlType), ["DOMString", "long"]);
-    }, 'should return a properly ordered map that accounts for mixed-in interfaces which declare a [Default] toJSON operation.');
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A { [Default] object toJSON(); attribute DOMString a; };");
-        context.add_idls("interface N { attribute long n; };");
-        context.add_idls("A implements N;");
-        var map = context.members.A.default_to_json_operation();
-        assert_equals(map.size, 1);
-        assert_true(map.has("a"));
-        assert_false(map.has("n"));
-        assert_equals(map.get("a").idlType, "DOMString");
-    }, 'should return a properly ordered map that ignores mixed-in interfaces which do not declare a [Default] toJSON operation.');
-
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls(document.getElementById('fragments').textContent);
-        var map = context.members.A.default_to_json_operation();
-        assert_array_equals([...map.keys()], ["b", "f", "i", "d", "g", "h", "j"]);
-        assert_array_equals([...map.values()].map(v => v.idlType), ["long", "unrestricted double", "boolean", "float", "octet", "DOMString", "D"]);
-    }, 'should return a properly ordered map of name/type pairs handling inherited and consequential interfaces as specified.');
-</script>
-</body>
-</html>
-
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/get_inheritance_stack.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>IdlInterface.prototype.get_inheritance_stack()</title>
-</head>
-<body>
-<div id="log"></div>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script src="../helper.js"></script>
-<script>
-    "use strict";
-    test(function() {
-        var stack = interfaceFrom('interface A { };').get_inheritance_stack();
-        assert_array_equals(stack.map(i => i.name), ["A"]);
-    }, 'should return an array that includes itself.');
-
-    test(function() {
-        var i = interfaceFrom('interface A : B { };');
-        assert_throws(new Error(), _ => i.get_inheritance_stack());
-    }, "should throw for interfaces which inherit from another interface which wasn't added to the IdlArray");
-
-    test(function() {
-        var idl = new IdlArray();
-        idl.add_idls('interface A : B { };');
-        idl.add_untested_idls('interface B : C { }; interface C { };');
-        var A = idl.members["A"];
-        assert_array_equals(A.get_inheritance_stack().map(i => i.name), ["A", "B", "C"]);
-    }, 'should return an array of inherited interfaces in order of inheritance, starting with itself.');
-
-    test(function () {
-        var idl = new IdlArray();
-        idl.add_untested_idls('interface A : B { };');
-        idl.add_untested_idls('interface B : A { };');
-        idl.assert_throws('A has a circular dependency: A,B,A', i => i.test());
-    }, 'should throw when inheritance is circular');
-
-    test(function () {
-        var idl = new IdlArray();
-        idl.add_untested_idls('interface A : B { };');
-        idl.assert_throws(
-            'Duplicate identifier A',
-            i => i.add_untested_idls('interface A : C { };'));
-    }, 'should throw when multiple inheritances defined');
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/has_default_to_json_regular_operation.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>IdlInterface.prototype.has_default_to_json_regular_operation()</title>
-</head>
-<body>
-<div id="log"></div>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script src="../helper.js"></script>
-<script>
-    "use strict";
-    test(function() {
-        var i = interfaceFrom('interface A { };');
-        assert_false(i.has_default_to_json_regular_operation());
-    }, 'should return false when the interface declares no toJSON operation.');
-
-    test(function() {
-        var i = interfaceFrom('interface A { static object toJSON(); };');
-        assert_false(i.has_default_to_json_regular_operation());
-    }, 'should return false when the interface declares a static toJSON operation.');
-
-    test(function() {
-        var i = interfaceFrom('interface A { object toJSON(); };');
-        assert_false(i.has_default_to_json_regular_operation());
-    }, 'should return false when the interface declares a regular toJSON operation with no extended attribute.');
-
-    test(function() {
-        var i = interfaceFrom('interface A { [x] object toJSON(); };');
-        assert_false(i.has_default_to_json_regular_operation());
-    }, 'should return false when the interface declares a regular toJSON operation with another extented attribute.');
-
-    test(function() {
-        var i = interfaceFrom('interface A { [Default] object toJSON(); };');
-        assert_true(i.has_default_to_json_regular_operation());
-    }, 'should return true when the interface declares a regular toJSON operation with the [Default] extented attribute.');
-
-    test(function() {
-        var i = interfaceFrom('interface A { [Attr, AnotherAttr, Default] object toJSON(); };');
-        assert_true(i.has_default_to_json_regular_operation());
-    }, 'should return true when the interface declares a regular toJSON operation with multiple extended attributes, including [Default].');
-</script>
-</body>
-</html>
-
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/has_to_json_regular_operation.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>IdlInterface.prototype.has_to_json_regular_operation()</title>
-</head>
-<body>
-<div id="log"></div>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script src="../helper.js"></script>
-<script>
-    "use strict";
-    test(function() {
-        var i = interfaceFrom('interface A { };');
-        assert_false(i.has_to_json_regular_operation());
-    }, 'should return false when the interface declares no toJSON operation.');
-
-    test(function() {
-        var i = interfaceFrom('interface A { static object toJSON(); };');
-        assert_false(i.has_to_json_regular_operation());
-    }, 'should return false when the interface declares a static toJSON operation.');
-
-    test(function() {
-        var i = interfaceFrom('interface A { object toJSON(); };');
-        assert_true(i.has_to_json_regular_operation());
-    }, 'should return true when the interface declares a regular toJSON operation.');
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/test_immutable_prototype.html
+++ /dev/null
@@ -1,294 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>idlharness: Immutable prototypes</title>
-  <script src="../../../../testharness.js"></script>
-  <script src="../../../../testharnessreport.js"></script>
-  <script src="../../../../WebIDLParser.js"></script>
-  <script src="../../../../idlharness.js"></script>
-</head>
-<body>
-<script>
-"use strictt";
-
-Object.defineProperty(window, "Foo", {
-    enumerable: false,
-    writable: true,
-    configurable: true,
-    value: function Foo() {}
-  });
-Object.defineProperty(window.Foo, "prototype", {
-    writable: false,
-    value: window.Foo.prototype
-  });
-Foo.prototype[Symbol.toStringTag] = "Foo";
-
-var idlArray = new IdlArray();
-idlArray.add_untested_idls("interface EventTarget {};");
-idlArray.add_idls(
-    "[Global=Window, Exposed=Window]\n" +
-    "interface Window : EventTarget {};\n" +
-
-    "[Global=Window, Exposed=Window, Constructor()]\n" +
-    "interface Foo {};"
-  );
-idlArray.add_objects({
-  Foo: ["new Foo()"],
-  Window: ["window"]
-});
-idlArray.test();
-</script>
-<script type="text/json" id="expected">
-{
-    "summarized_status": {
-        "message": null,
-        "status_string": "OK"
-    },
-    "summarized_tests": [
-        {
-            "name": "Foo interface object length",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface object name",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: existence and properties of interface object",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: existence and properties of interface prototype object",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: existence and properties of interface prototype object's \"constructor\" property",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: existence and properties of interface prototype object's @@unscopables property",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError",
-            "status_string": "FAIL",
-            "properties": {},
-            "message": "assert_throws: function \"function() {\n            Object.setPrototypeOf(obj, newValue);\n        }\" did not throw"
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false",
-            "status_string": "FAIL",
-            "properties": {},
-            "message": "assert_false: expected false got true"
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError",
-            "status_string": "FAIL",
-            "properties": {},
-            "message": "assert_throws: function \"function() {\n            obj.__proto__ = newValue;\n        }\" did not throw"
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError",
-            "status_string": "FAIL",
-            "properties": {},
-            "message": "assert_throws: function \"function() {\n            Object.setPrototypeOf(obj, newValue);\n        }\" did not throw"
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false",
-            "status_string": "FAIL",
-            "properties": {},
-            "message": "assert_false: expected false got true"
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError",
-            "status_string": "FAIL",
-            "properties": {},
-            "message": "assert_throws: function \"function() {\n            obj.__proto__ = newValue;\n        }\" did not throw"
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Foo must be primary interface of new Foo()",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Stringification of new Foo()",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Stringification of window",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface object length",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface object name",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: existence and properties of interface object",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: existence and properties of interface prototype object",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: existence and properties of interface prototype object's \"constructor\" property",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: existence and properties of interface prototype object's @@unscopables property",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        },
-        {
-            "name": "Window must be primary interface of window",
-            "status_string": "PASS",
-            "properties": {},
-            "message": null
-        }
-    ],
-    "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/test_to_json_operation.html
+++ /dev/null
@@ -1,177 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>IdlInterface.prototype.test_to_json_operation()</title>
-  <script src="/resources/testharness.js"></script>
-  <script src="/resources/testharnessreport.js"></script>
-  <script src="/resources/WebIDLParser.js"></script>
-  <script src="/resources/idlharness.js"></script>
-  <script src="../helper.js"></script>
-</head>
-<body>
-<script>
-    "use strict";
-    function wrap(member, obj) {
-        function F(obj) {
-            this._obj = obj;
-        }
-
-        F.prototype.toJSON = function() {
-            return this._obj;
-        }
-        Object.defineProperty(F, 'name', { value: member.name });
-        return new F(obj);
-    }
-
-    var i, obj;
-    i = interfaceFrom("interface A { [Default] object toJSON(); attribute long foo; };");
-    i.test_to_json_operation(wrap(i, { foo: 123 }), i.members[0]);
-
-    // should fail (wrong type)
-    i = interfaceFrom("interface B { [Default] object toJSON(); attribute long foo; };");
-    i.test_to_json_operation(wrap(i, { foo: "a value" }), i.members[0]);
-
-    // should handle extraneous attributes (e.g. from an extension specification)
-    i = interfaceFrom("interface C { [Default] object toJSON(); attribute long foo; };");
-    i.test_to_json_operation(wrap(i, { foo: 123, bar: 456 }), i.members[0]);
-
-    // should fail (missing property)
-    i = interfaceFrom("interface D { [Default] object toJSON(); attribute long foo; };");
-    i.test_to_json_operation(wrap(i, { }), i.members[0]);
-
-    // should fail (should be writable)
-    obj = Object.defineProperties({}, { foo: {
-        writable: false,
-        enumerable: true,
-        configurable: true,
-        value: 123
-    }});
-    i = interfaceFrom("interface F { [Default] object toJSON(); attribute long foo; };");
-    i.test_to_json_operation(wrap(i, obj), i.members[0]);
-
-    // should fail (should be enumerable)
-    obj = Object.defineProperties({}, { foo: {
-        writable: true,
-        enumerable: false,
-        configurable: true,
-        value: 123
-    }});
-    i = interfaceFrom("interface G { [Default] object toJSON(); attribute long foo; };");
-    i.test_to_json_operation(wrap(i, obj), i.members[0]);
-
-    // should fail (should be configurable)
-    obj = Object.defineProperties({}, { foo: {
-        writable: true,
-        enumerable: true,
-        configurable: false,
-        value: 123
-    }});
-    i = interfaceFrom("interface H { [Default] object toJSON(); attribute long foo; };");
-    i.test_to_json_operation(wrap(i, obj), i.members[0]);
-
-    var idl = new IdlArray();
-    idl.add_idls("interface I : J { [Default] object toJSON(); attribute long foo; };");
-    idl.add_idls("interface J { [Default] object toJSON(); attribute DOMString foo;};");
-    var i = idl.members.I;
-    i.test_to_json_operation(wrap(i, { foo: 123 }), i.members[0]);
-
-    i = interfaceFrom("interface K { [Default] object toJSON(); };");
-    i.test_to_json_operation(wrap(i, {}), i.members[0]);
-
-    i = interfaceFrom("interface L { DOMString toJSON(); };");
-    i.test_to_json_operation(wrap(i, "a string"), i.members[0]);
-
-    // should fail (wrong output type)
-    i = interfaceFrom("interface M { DOMString toJSON(); };");
-    i.test_to_json_operation(wrap(i, {}), i.members[0]);
-
-    // should fail (not an IDL type)
-    i = interfaceFrom("interface N { DOMException toJSON(); };");
-    i.test_to_json_operation(wrap(i, {}), i.members[0]);
-</script>
-<script type="text/json" id="expected">
-    {
-        "summarized_status": {
-            "message": null,
-            "status_string": "OK"
-        },
-        "summarized_tests": [
-            {
-                "message": null,
-                "name": "Test default toJSON operation of A",
-                "properties": {},
-                "status_string": "PASS"
-            },
-            {
-                "message": "assert_equals: expected \"number\" but got \"string\"",
-                "name": "Test default toJSON operation of B",
-                "properties": {},
-                "status_string": "FAIL"
-            },
-            {
-                "message": null,
-                "name": "Test default toJSON operation of C",
-                "properties": {},
-                "status_string": "PASS"
-            },
-            {
-                "message": "assert_true: property \"foo\" should be present in the output of D.prototype.toJSON() expected true got false",
-                "name": "Test default toJSON operation of D",
-                "properties": {},
-                "status_string": "FAIL"
-            },
-            {
-                "message": "assert_true: property foo should be writable expected true got false",
-                "name": "Test default toJSON operation of F",
-                "properties": {},
-                "status_string": "FAIL"
-            },
-            {
-                "message": "assert_true: property foo should be enumerable expected true got false",
-                "name": "Test default toJSON operation of G",
-                "properties": {},
-                "status_string": "FAIL"
-            },
-            {
-                "message": "assert_true: property foo should be configurable expected true got false",
-                "name": "Test default toJSON operation of H",
-                "properties": {},
-                "status_string": "FAIL"
-            },
-            {
-                "message": null,
-                "name": "Test default toJSON operation of I",
-                "properties": {},
-                "status_string": "PASS"
-            },
-            {
-                "message": null,
-                "name": "Test default toJSON operation of K",
-                "properties": {},
-                "status_string": "PASS"
-            },
-            {
-                "message": null,
-                "name": "Test toJSON operation of L",
-                "properties": {},
-                "status_string": "PASS"
-            },
-            {
-                "message": "assert_equals: expected \"string\" but got \"object\"",
-                "name": "Test toJSON operation of M",
-                "properties": {},
-                "status_string": "FAIL"
-            },
-            {
-                "message": "assert_true: {\"type\":\"return-type\",\"sequence\":false,\"generic\":null,\"nullable\":false,\"union\":false,\"idlType\":\"DOMException\"} is not an appropriate return value for the toJSON operation of N expected true got false",
-                "name": "Test toJSON operation of N",
-                "properties": {},
-                "status_string": "FAIL"
-            }
-        ],
-        "type": "complete"
-    }
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/traverse_inherited_and_consequential_interfaces.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>IdlDictionary.prototype.traverse_inherited_and_consequential_interfaces()</title>
-</head>
-<body>
-<div id="log"></div>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script src="../helper.js"></script>
-<pre id=fragments>
-    interface A : B { };
-    interface B : C { };
-    interface C { };
-    interface D : E { };
-    interface E : F { };
-    interface F { };
-    interface G { };
-    interface H { };
-    interface I { };
-    interface J { };
-
-    A implements G;
-    A implements H;
-    B implements D;
-    E implements I;
-    H implements J;
-</pre>
-<script>
-    "use strict";
-    test(function() {
-        var interfaces = [];
-        interfaceFrom('interface A { };').traverse_inherited_and_consequential_interfaces(function(i) {
-            interfaces.push(i.name);
-        });
-        assert_array_equals(interfaces, ["A"]);
-    }, 'should return an array that includes itself.');
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A { }; A implements B;");
-        assert_throws(new Error(), _ => context.members["A"].traverse_inherited_and_consequential_interfaces(function() {}));
-    }, "should throw for interfaces which are extended by another interface which wasn't added to the IdlArray.");
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls("interface A { };");
-        assert_throws(new TypeError(), _ => context.members["A"].traverse_inherited_and_consequential_interfaces());
-    }, "should throw if not passed a callback");
-
-    test(function() {
-        var context = new IdlArray();
-        context.add_idls(document.getElementById('fragments').textContent);
-        var interfaces = [];
-        context.members["A"].traverse_inherited_and_consequential_interfaces(function(i) {
-            interfaces.push(i.name);
-        });
-        assert_array_equals(interfaces, ["C", "B", "F", "E", "I", "D", "A", "G", "H", "J"]);
-    }, 'should return an array that includes the identifier of the interfaces in the correct order.');
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/idlharness/IdlInterfaceMember/is_to_json_regular_operation.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>IdlInterfaceMember.prototype.is_to_json_regular_operation()</title>
-</head>
-<body>
-<div id="log"></div>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/WebIDLParser.js"></script>
-<script src="/resources/idlharness.js"></script>
-<script src="../helper.js"></script>
-<script>
-    "use strict";
-    test(function() {
-        var m = memberFrom("readonly attribute DOMString foo");
-        assert_false(m.is_to_json_regular_operation());
-    }, 'should return false when member is an attribute.');
-
-    test(function() {
-        var m = memberFrom("static void foo()");
-        assert_false(m.is_to_json_regular_operation());
-    }, 'should return false when member is a static operation.');
-
-    test(function() {
-        var m = memberFrom("static object toJSON()");
-        assert_false(m.is_to_json_regular_operation());
-    }, 'should return false when member is a static toJSON operation.');
-
-    test(function() {
-        var m = memberFrom("object toJSON()");
-        assert_true(m.is_to_json_regular_operation());
-    }, 'should return true when member is a regular toJSON operation.');
-
-    test(function() {
-        var m = memberFrom("[Foo] object toJSON()");
-        assert_true(m.is_to_json_regular_operation());
-    }, 'should return true when member is a regular toJSON operation with extensible attributes.');
-</script>
-</body>
-</html>
-
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/iframe-callback.html
+++ /dev/null
@@ -1,116 +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");
-    // single-page-test-pass.html has a single test.
-    iframe.src = "single-page-test-pass.html";
-    iframe.style.setProperty("display", "none");
-    document.getElementById("target").appendChild(iframe);
-}
-</script>
-
-<div id="target">
-</div>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Example with iframe that notifies containing document via callbacks",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/iframe-consolidate-errors.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Example with iframe that consolidates errors via fetch_tests_from_window</title>
-<script src="../../testharness.js"></script>
-<script src="../../testharnessreport.js"></script>
-<script>
-var parent_test = async_test("Test executing in parent context");
-</script>
-</head>
-<body onload="parent_test.done()">
-<h1>Fetching Tests From a Child Context</h1>
-<p>This test demonstrates the use of <tt>fetch_tests_from_window</tt> to pull
-tests from an <tt>iframe</tt> into the primary document.</p>
-<p>The test suite is expected to fail due to an unhandled exception in the
-child context.</p>
-<div id="log"></div>
-
-<iframe id="childContext" src="uncaught-exception-handle.html" style="display:none"></iframe>
-<!-- apisample4.html is a failing suite due to an unhandled Error. -->
-
-<script>
-  var childContext = document.getElementById("childContext");
-  fetch_tests_from_window(childContext.contentWindow);
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "ERROR",
-    "message": "Error in remote: Error: Example Error"
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Test executing in parent context",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/iframe-consolidate-tests.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Example with iframe that consolidates tests via fetch_tests_from_window</title>
-<script src="../../testharness.js"></script>
-<script src="../../testharnessreport.js"></script>
-<script>
-var parent_test = async_test("Test executing in parent context");
-</script>
-</head>
-<body onload="parent_test.done()">
-<h1>Fetching Tests From a Child Context</h1>
-<p>This test demonstrates the use of <tt>fetch_tests_from_window</tt> to pull
-tests from an <tt>iframe</tt> into the primary document.</p>
-<p>The test suite will not complete until tests in the child context have finished
-executing</p>
-<div id="log"></div>
-
-<iframe id="childContext" src="promise-async.html" style="display:none"></iframe>
-<!-- promise-async.html has async tests with promises -->
-
-<script>
-  var childContext = document.getElementById("childContext");
-  fetch_tests_from_window(childContext.contentWindow);
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Promise rejection",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promise resolution",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Promises and test assertion failures (should fail)",
-      "properties": {},
-      "message": "assert_true: This failure is expected expected true got false"
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promises are supported in your browser",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promises resolution chaining",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test executing in parent context",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Use of step_func with Promises",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Use of unreached_func with Promises (should fail)",
-      "properties": {},
-      "message": "assert_unreached: This failure is expected Reached unreachable code"
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/iframe-msg.html
+++ /dev/null
@@ -1,84 +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="single-page-test-pass.html" style="display:none">
-  <!-- single-page-test-pass.html implements a file_is_test test. -->
-</iframe>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Containing document receives messages",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/order.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>Ordering</title>
-<meta name="timeout" content="6000">
-</head>
-<body>
-<div id="log"></div>
-<script src="../../testharness.js"></script>
-<script src="../../testharnessreport.js"></script>
-<script>
-test(function() {}, 'second');
-test(function() {}, 'first');
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [{
-    "status_string": "PASS",
-    "name": "first",
-    "message": null,
-    "properties": {}
-  }, {
-    "status_string": "PASS",
-    "name": "second",
-    "message": null,
-    "properties": {}
-  }],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/promise-async.html
+++ /dev/null
@@ -1,172 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Promise rejection",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promise resolution",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Promises and test assertion failures (should fail)",
-      "properties": {},
-      "message": "assert_true: This failure is expected expected true got false"
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promises are supported in your browser",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promises resolution chaining",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Use of step_func with Promises",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Use of unreached_func with Promises (should fail)",
-      "properties": {},
-      "message": "assert_unreached: This failure is expected Reached unreachable code"
-    }
-  ],
-  "type": "complete"
-}
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/promise.html
+++ /dev/null
@@ -1,209 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "FAIL",
-      "name": "Assertion failure in a fulfill reaction (should FAIL with an expected failure)",
-      "message": "assert_true: Expected failure. expected true got false",
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Chain of promise resolutions",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promise fulfillment with result",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promise rejection with result",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "Promises are supported in your browser",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "PASS",
-      "name": "promise_test with function that doesn't return a Promise",
-      "message": null,
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "promise_test with function that doesn't return anything",
-      "message": "assert_not_equals: got disallowed value undefined",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "promise_test with unhandled exception in fulfill reaction (should FAIL)",
-      "message": "promise_test: Unhandled rejection with value: object \"Error: Expected exception.\"",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "promise_test with unhandled exception in reject reaction (should FAIL)",
-      "message": "promise_test: Unhandled rejection with value: object \"Error: Expected exception.\"",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "promise_test with unhandled rejection (should FAIL)",
-      "message": "promise_test: Unhandled rejection with value: \"Expected rejection\"",
-      "properties": {}
-    },
-    {
-      "status_string": "FAIL",
-      "name": "unreached_func as reactor (should FAIL with an expected failure)",
-      "message": "assert_unreached: Expected failure. Reached unreachable code",
-      "properties": {}
-    }
-  ],
-  "type": "complete"
-}
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/single-page-test-fail.html
+++ /dev/null
@@ -1,27 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "FAIL",
-      "name": "Example with file_is_test (should fail)",
-      "properties": {},
-      "message": "uncaught exception: Error: assert_true: expected true got false"
-    }
-  ],
-  "type": "complete"
-}
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/single-page-test-no-assertions.html
+++ /dev/null
@@ -1,24 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Example single page test with no asserts",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/single-page-test-no-body.html
+++ /dev/null
@@ -1,25 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Example single page test with no body",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/single-page-test-pass.html
+++ /dev/null
@@ -1,27 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Example with file_is_test",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/uncaught-exception-handle.html
+++ /dev/null
@@ -1,33 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "ERROR",
-    "message": "Error: Example Error"
-  },
-  "summarized_tests": [
-    {
-      "status_string": "NOTRUN",
-      "name": "This should show a harness status of 'Error' and a test status of 'Not Run'",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/uncaught-exception-ignore.html
+++ /dev/null
@@ -1,35 +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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "OK",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "setup({allow_uncaught_exception:true}) should allow tests to pass even if there is an exception",
-      "properties": {},
-      "message": null
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
-</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlArray/is_json_type.html
@@ -0,0 +1,194 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>IdlArray.prototype.is_json_type()</title>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<script src="../../../idl-helper.js"></script>
+<script>
+    "use strict";
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_true(idl.is_json_type(typeFrom("DOMString")));
+        assert_true(idl.is_json_type(typeFrom("ByteString")));
+        assert_true(idl.is_json_type(typeFrom("USVString")));
+        idl.add_untested_idls('enum BarEnum { "a", "b", "c" };');
+        assert_true(idl.is_json_type(typeFrom("BarEnum")));
+    }, 'should return true for all string types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_false(idl.is_json_type(typeFrom("Error")));
+        assert_false(idl.is_json_type(typeFrom("DOMException")));
+    }, 'should return false for all exception types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_false(idl.is_json_type(typeFrom("Int8Array")));
+        assert_false(idl.is_json_type(typeFrom("Int16Array")));
+        assert_false(idl.is_json_type(typeFrom("Int32Array")));
+        assert_false(idl.is_json_type(typeFrom("Uint8Array")));
+        assert_false(idl.is_json_type(typeFrom("Uint16Array")));
+        assert_false(idl.is_json_type(typeFrom("Uint32Array")));
+        assert_false(idl.is_json_type(typeFrom("Uint8ClampedArray")));
+        assert_false(idl.is_json_type(typeFrom("Float32Array")));
+        assert_false(idl.is_json_type(typeFrom("ArrayBuffer")));
+        assert_false(idl.is_json_type(typeFrom("DataView")));
+    }, 'should return false for all buffer source types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_true(idl.is_json_type(typeFrom("boolean")));
+    }, 'should return true for boolean');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_true(idl.is_json_type(typeFrom("byte")));
+        assert_true(idl.is_json_type(typeFrom("octet")));
+        assert_true(idl.is_json_type(typeFrom("short")));
+        assert_true(idl.is_json_type(typeFrom("unsigned short")));
+        assert_true(idl.is_json_type(typeFrom("long")));
+        assert_true(idl.is_json_type(typeFrom("unsigned long")));
+        assert_true(idl.is_json_type(typeFrom("long long")));
+        assert_true(idl.is_json_type(typeFrom("unsigned long long")));
+        assert_true(idl.is_json_type(typeFrom("float")));
+        assert_true(idl.is_json_type(typeFrom("unrestricted float")));
+        assert_true(idl.is_json_type(typeFrom("double")));
+        assert_true(idl.is_json_type(typeFrom("unrestricted double")));
+    }, 'should return true for all numeric types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_false(idl.is_json_type(typeFrom("Promise<DOMString>")));
+    }, 'should return false for promises');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_false(idl.is_json_type(typeFrom("sequence<DOMException>")));
+        assert_true(idl.is_json_type(typeFrom("sequence<DOMString>")));
+    }, 'should handle sequences according to their inner types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_false(idl.is_json_type(typeFrom("FrozenArray<DOMException>")));
+        assert_true(idl.is_json_type(typeFrom("FrozenArray<DOMString>")));
+    }, 'should handle frozen arrays according to their inner types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_true(idl.is_json_type(typeFrom("record<DOMString, DOMString>")));
+        assert_false(idl.is_json_type(typeFrom("record<DOMString, Error>")));
+    }, 'should handle records according to their inner types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_true(idl.is_json_type(typeFrom("object")));
+    }, 'should return true for object type');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_false(idl.is_json_type(typeFrom("any")));
+    }, 'should return false for any type');
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('dictionary Foo { DOMString foo; }; dictionary Bar : Foo { DOMString bar; };');
+        assert_true(idl.is_json_type(typeFrom("Foo")));
+        assert_true(idl.is_json_type(typeFrom("Bar")));
+    }, 'should return true for dictionaries whose members are all JSON types');
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('dictionary Foo { };');
+        assert_true(idl.is_json_type(typeFrom("Foo")));
+    }, 'should return true for dictionaries which have no members');
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('dictionary FooBar { DOMString a; Error b; }; dictionary Baz : FooBar {};');
+        assert_false(idl.is_json_type(typeFrom("FooBar")));
+        assert_false(idl.is_json_type(typeFrom("Baz")));
+    }, 'should return false for dictionaries whose members are not all JSON types');
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('interface Foo { DOMString toJSON(); };');
+        assert_true(idl.is_json_type(typeFrom("Foo")));
+    }, 'should return true for interfaces which declare a toJSON operation');
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('interface Foo { DOMString toJSON(); }; interface Bar : Foo { };');
+        assert_true(idl.is_json_type(typeFrom("Bar")));
+    }, 'should return true for interfaces which inherit from an interface which declares a toJSON operation');
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('interface Foo { }; interface Bar { DOMString toJSON(); }; Foo implements Bar;');
+        assert_true(idl.is_json_type(typeFrom("Foo")));
+    }, 'should return true for interfaces which mixin an interface which declare a toJSON operation');
+
+//    test(function() {
+//        var idl = new IdlArray();
+//        idl.add_untested_idls('interface Foo { }; interface Bar { }; interface Baz { DOMString toJSON(); }; Foo implements Bar; Bar implements Baz;');
+//        assert_true(idl.is_json_type(typeFrom("Foo")));
+//    }, 'should return true for interfaces which mixin an interface which itself mixes in an interface which declares a toJSON operation');
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('interface Foo { };');
+        assert_false(idl.is_json_type(typeFrom("Foo")));
+    }, 'should return false for interfaces which do not declare a toJSON operation');
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('interface Foo { object toJSON(); };');
+        assert_true(idl.is_json_type(typeFrom("(Foo or DOMString)")));
+    }, 'should return true for union types whose member types are JSON types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_false(idl.is_json_type(typeFrom("(DataView or DOMString)")));
+    }, 'should return false for union types whose member types are not all JSON types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_true(idl.is_json_type(typeFrom("DOMString?")));
+        assert_false(idl.is_json_type(typeFrom("DataView?")));
+    }, 'should consider the inner types of nullable types');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_true(idl.is_json_type(typeFrom("[XAttr] long")));
+        assert_false(idl.is_json_type(typeFrom("[XAttr] DataView")));
+    }, 'should consider the inner types of annotated types.');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_throws(new Error(), _ => idl.is_json_type(typeFrom("Foo")));
+    }, "should throw if it references a dictionary, enum or interface which wasn't added to the IdlArray");
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_untested_idls('interface Foo : Bar { };');
+        assert_throws(new Error(), _ => idl.is_json_type(typeFrom("Foo")));
+    }, "should throw for interfaces which inherit from another interface which wasn't added to the IdlArray");
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_true(idl.is_json_type(typedefFrom("typedef double DOMHighResTimeStamp;").idlType));
+    }, 'should return true for typedefs whose source type is a JSON type');
+
+    test(function() {
+        var idl = new IdlArray();
+        assert_false(idl.is_json_type(typedefFrom("typedef DataView DOMHighResTimeStamp;").idlType));
+    }, 'should return false for typedefs whose source type is not a JSON type');
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlDictionary/get_inheritance_stack.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>IdlDictionary.prototype.get_inheritance_stack()</title>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<script src="../../../idl-helper.js"></script>
+<script>
+    "use strict";
+    test(function() {
+        var stack = dictionaryFrom('dictionary A { };').get_inheritance_stack();
+        assert_array_equals(stack.map(d => d.name), ["A"]);
+    }, 'should return an array that includes itself.');
+
+    test(function() {
+        var d = dictionaryFrom('dictionary A : B { };');
+        assert_throws(new Error(), _ => d.get_inheritance_stack());
+    }, "should throw for dictionaries which inherit from another dictionary which wasn't added to the IdlArray");
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_idls('dictionary A : B { };');
+        idl.add_untested_idls('dictionary B : C { }; dictionary C { };');
+        var A = idl.members["A"];
+        assert_array_equals(A.get_inheritance_stack().map(d => d.name), ["A", "B", "C"]);
+    }, 'should return an array of inherited dictionaries in order of inheritance, starting with itself.');
+
+    test(function () {
+      let i = new IdlArray();
+      i.add_untested_idls('dictionary A : B {};');
+      i.assert_throws(new IdlHarnessError('A inherits B, but B is undefined.'), i => i.test());
+    }, 'A : B with B undeclared should throw IdlHarnessError');
+
+    test(function () {
+      let i = new IdlArray();
+      i.add_untested_idls('dictionary A : B {};');
+      i.add_untested_idls('interface B {};');
+      i.assert_throws(new IdlHarnessError('A inherits B, but A is not an interface.'), i => i.test());
+    }, 'dictionary A : B with B interface should throw IdlHarnessError');
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlDictionary/test_partial_dictionary.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+
+<head>
+  <meta charset="utf-8">
+  <title>idlharness: partial dictionaries</title>
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
+  <script src="/resources/WebIDLParser.js"></script>
+  <script src="/resources/idlharness.js"></script>
+  <script src="../../../idl-helper.js"></script>
+</head>
+
+<body>
+<pre id='idl'>
+dictionary A {};
+partial dictionary A {
+  boolean B;
+};
+partial dictionary A {
+  boolean C;
+};
+</pre>
+
+<script>
+'use strict';
+
+test(() => {
+  let idlArray = new IdlArray();
+  idlArray.add_idls(document.getElementById('idl').textContent);
+  idlArray.test();
+
+  let members = idlArray.members["A"].members.map(m => m.name);
+  assert_array_equals(members, ["B", "C"], 'A should contain B, C');
+}, 'Partial dictionaries');
+
+test(() => {
+  let idlArray = new IdlArray();
+  idlArray.add_idls('partial dictionary D {};');
+  idlArray.assert_throws('Partial dictionary D with no original dictionary', i => i.test());
+}, 'Partial-only dictionary definition')
+</script>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlInterface/default_to_json_operation.html
@@ -0,0 +1,189 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>IdlDictionary.prototype.default_to_json_operation()</title>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<script src="../../../idl-helper.js"></script>
+<pre id=fragments>
+    interface A : B {
+      attribute DOMString a;
+    };
+
+    interface B : C {
+      [Default] object toJSON();
+      attribute long b;
+    };
+
+    interface C {
+      attribute DOMString c;
+    };
+
+    interface D : E {
+      [Default] object toJSON();
+      attribute float d;
+    };
+
+    interface E : F {
+      attribute DOMString e;
+    };
+
+    interface F {
+      [Default] object toJSON();
+      attribute unrestricted double f;
+    };
+
+    interface G {
+      [Default] object toJSON();
+      attribute octet g;
+    };
+
+    interface H {
+      [Default] object toJSON();
+      attribute DOMString h;
+    };
+
+    interface I {
+      [Default] object toJSON();
+      attribute boolean i;
+    };
+
+    interface J {
+      [Default] object toJSON();
+      attribute D j;
+    };
+
+    A implements G;
+    A implements H;
+    B implements D;
+    E implements I;
+    H implements J;
+</pre>
+<script>
+    "use strict";
+    test(function() {
+        var map = interfaceFrom('interface A { [Default] object toJSON(); };').default_to_json_operation();
+        assert_equals(map.size, 0);
+    }, 'should return an empty map when there are no attributes');
+
+    test(function() {
+        var r = interfaceFrom('interface A { };').default_to_json_operation();
+        assert_equals(r, null);
+    }, 'should return null when there is no toJSON method');
+
+    test(function() {
+        var r = interfaceFrom('interface A { DOMString toJSON(); };').default_to_json_operation();
+        assert_equals(r, null);
+    }, 'should return null when there is a toJSON method but it does not have the [Default] extended attribute');
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A : B { DOMString toJSON(); };");
+        context.add_idls("interface B { [Default] object toJSON(); };");
+        var r = context.members.A.default_to_json_operation();
+        assert_equals(r, null);
+    }, 'should return null when there is a toJSON method but it does not have the [Default] extended attribute even if this extended attribute exists on inherited interfaces');
+
+    test(function() {
+        var map = interfaceFrom('interface A { [Default] object toJSON(); static attribute DOMString foo; };').default_to_json_operation();
+        assert_equals(map.size, 0);
+    }, 'should not include static attributes');
+
+    test(function() {
+        var map = interfaceFrom('interface A { [Default] object toJSON(); attribute Promise<DOMString> bar; };').default_to_json_operation();
+        assert_equals(map.size, 0);
+    }, 'should not include attributes which are not JSON types');
+
+    test(function() {
+        var map = interfaceFrom('interface A { [Default] object toJSON(); DOMString bar(); };').default_to_json_operation();
+        assert_equals(map.size, 0);
+    }, 'should not include operations');
+
+    test(function() {
+        var map = interfaceFrom('interface A { [Default] object toJSON(); attribute DOMString bar; };').default_to_json_operation();
+        assert_equals(map.size, 1);
+        assert_true(map.has("bar"));
+        assert_equals(map.get("bar").idlType, "DOMString");
+    }, 'should return a map whose key/value pair represent the identifier and IDL type of valid attributes');
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A : B { [Default] object toJSON(); attribute DOMString a; };");
+        context.add_idls("interface B { [Default] object toJSON(); attribute long b; };");
+        var map = context.members.A.default_to_json_operation();
+        assert_array_equals([...map.keys()], ["b", "a"]);
+        assert_array_equals([...map.values()].map(v => v.idlType), ["long", "DOMString"]);
+    }, 'should return a properly ordered map that contains IDL types of valid attributes for inherited interfaces');
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A : B { attribute DOMString a; };");
+        context.add_idls("interface B { [Default] object toJSON(); attribute long b; };");
+        var map = context.members.A.default_to_json_operation();
+        assert_equals(map.size, 1);
+        assert_true(map.has("b"));
+        assert_equals(map.get("b").idlType, "long");
+        assert_array_equals([...map.keys()], ["b"]);
+    }, 'should not include attributes of the current interface when the [Default] toJSON method in inherited');
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A : B { [Default] object toJSON(); };");
+        context.add_idls("interface B : C { [Default] object toJSON(); attribute DOMString foo; };");
+        context.add_idls("interface C { [Default] object toJSON(); attribute long foo; };");
+        var map = context.members.A.default_to_json_operation();
+        assert_equals(map.size, 1);
+        assert_true(map.has("foo"));
+        assert_equals(map.get("foo").idlType, "DOMString");
+    }, 'attributes declared further away in the inheritance hierarchy should be masked by attributes declared closer');
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A : B { [Default] object toJSON(); attribute DOMString a; };");
+        context.add_idls("interface B { object toJSON(); attribute long b; };");
+        var map = context.members.A.default_to_json_operation();
+        assert_equals(map.size, 1);
+        assert_true(map.has("a"));
+        assert_false(map.has("b"));
+        assert_equals(map.get("a").idlType, "DOMString");
+    }, 'should return an ordered map that ignores attributes of inherited interfaces which do not declare a [Default] toJSON operation.');
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A { [Default] object toJSON(); attribute DOMString a; };");
+        context.add_idls("interface N { [Default] object toJSON(); attribute long n; };");
+        context.add_idls("A implements N;");
+        var map = context.members.A.default_to_json_operation();
+        assert_array_equals([...map.keys()], ["a", "n"]);
+        assert_array_equals([...map.values()].map(v => v.idlType), ["DOMString", "long"]);
+    }, 'should return a properly ordered map that accounts for mixed-in interfaces which declare a [Default] toJSON operation.');
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A { [Default] object toJSON(); attribute DOMString a; };");
+        context.add_idls("interface N { attribute long n; };");
+        context.add_idls("A implements N;");
+        var map = context.members.A.default_to_json_operation();
+        assert_equals(map.size, 1);
+        assert_true(map.has("a"));
+        assert_false(map.has("n"));
+        assert_equals(map.get("a").idlType, "DOMString");
+    }, 'should return a properly ordered map that ignores mixed-in interfaces which do not declare a [Default] toJSON operation.');
+
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls(document.getElementById('fragments').textContent);
+        var map = context.members.A.default_to_json_operation();
+        assert_array_equals([...map.keys()], ["b", "f", "i", "d", "g", "h", "j"]);
+        assert_array_equals([...map.values()].map(v => v.idlType), ["long", "unrestricted double", "boolean", "float", "octet", "DOMString", "D"]);
+    }, 'should return a properly ordered map of name/type pairs handling inherited and consequential interfaces as specified.');
+</script>
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlInterface/get_inheritance_stack.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>IdlInterface.prototype.get_inheritance_stack()</title>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<script src="../../../idl-helper.js"></script>
+<script>
+    "use strict";
+    test(function() {
+        var stack = interfaceFrom('interface A { };').get_inheritance_stack();
+        assert_array_equals(stack.map(i => i.name), ["A"]);
+    }, 'should return an array that includes itself.');
+
+    test(function() {
+        var i = interfaceFrom('interface A : B { };');
+        assert_throws(new Error(), _ => i.get_inheritance_stack());
+    }, "should throw for interfaces which inherit from another interface which wasn't added to the IdlArray");
+
+    test(function() {
+        var idl = new IdlArray();
+        idl.add_idls('interface A : B { };');
+        idl.add_untested_idls('interface B : C { }; interface C { };');
+        var A = idl.members["A"];
+        assert_array_equals(A.get_inheritance_stack().map(i => i.name), ["A", "B", "C"]);
+    }, 'should return an array of inherited interfaces in order of inheritance, starting with itself.');
+
+    test(function () {
+        var idl = new IdlArray();
+        idl.add_untested_idls('interface A : B { };');
+        idl.add_untested_idls('interface B : A { };');
+        idl.assert_throws('A has a circular dependency: A,B,A', i => i.test());
+    }, 'should throw when inheritance is circular');
+
+    test(function () {
+        var idl = new IdlArray();
+        idl.add_untested_idls('interface A : B { };');
+        idl.assert_throws(
+            'Duplicate identifier A',
+            i => i.add_untested_idls('interface A : C { };'));
+    }, 'should throw when multiple inheritances defined');
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlInterface/has_default_to_json_regular_operation.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>IdlInterface.prototype.has_default_to_json_regular_operation()</title>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<script src="../../../idl-helper.js"></script>
+<script>
+    "use strict";
+    test(function() {
+        var i = interfaceFrom('interface A { };');
+        assert_false(i.has_default_to_json_regular_operation());
+    }, 'should return false when the interface declares no toJSON operation.');
+
+    test(function() {
+        var i = interfaceFrom('interface A { static object toJSON(); };');
+        assert_false(i.has_default_to_json_regular_operation());
+    }, 'should return false when the interface declares a static toJSON operation.');
+
+    test(function() {
+        var i = interfaceFrom('interface A { object toJSON(); };');
+        assert_false(i.has_default_to_json_regular_operation());
+    }, 'should return false when the interface declares a regular toJSON operation with no extended attribute.');
+
+    test(function() {
+        var i = interfaceFrom('interface A { [x] object toJSON(); };');
+        assert_false(i.has_default_to_json_regular_operation());
+    }, 'should return false when the interface declares a regular toJSON operation with another extented attribute.');
+
+    test(function() {
+        var i = interfaceFrom('interface A { [Default] object toJSON(); };');
+        assert_true(i.has_default_to_json_regular_operation());
+    }, 'should return true when the interface declares a regular toJSON operation with the [Default] extented attribute.');
+
+    test(function() {
+        var i = interfaceFrom('interface A { [Attr, AnotherAttr, Default] object toJSON(); };');
+        assert_true(i.has_default_to_json_regular_operation());
+    }, 'should return true when the interface declares a regular toJSON operation with multiple extended attributes, including [Default].');
+</script>
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlInterface/has_to_json_regular_operation.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>IdlInterface.prototype.has_to_json_regular_operation()</title>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<script src="../../../idl-helper.js"></script>
+<script>
+    "use strict";
+    test(function() {
+        var i = interfaceFrom('interface A { };');
+        assert_false(i.has_to_json_regular_operation());
+    }, 'should return false when the interface declares no toJSON operation.');
+
+    test(function() {
+        var i = interfaceFrom('interface A { static object toJSON(); };');
+        assert_false(i.has_to_json_regular_operation());
+    }, 'should return false when the interface declares a static toJSON operation.');
+
+    test(function() {
+        var i = interfaceFrom('interface A { object toJSON(); };');
+        assert_true(i.has_to_json_regular_operation());
+    }, 'should return true when the interface declares a regular toJSON operation.');
+</script>
+</body>
+</html>
rename from testing/web-platform/tests/resources/test/tests/idlharness/IdlInterface/test_primary_interface_of_undefined.html
rename to testing/web-platform/tests/resources/test/tests/unit/IdlInterface/test_primary_interface_of_undefined.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlInterface/traverse_inherited_and_consequential_interfaces.html
@@ -0,0 +1,64 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>IdlDictionary.prototype.traverse_inherited_and_consequential_interfaces()</title>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<script src="../../../idl-helper.js"></script>
+<pre id=fragments>
+    interface A : B { };
+    interface B : C { };
+    interface C { };
+    interface D : E { };
+    interface E : F { };
+    interface F { };
+    interface G { };
+    interface H { };
+    interface I { };
+    interface J { };
+
+    A implements G;
+    A implements H;
+    B implements D;
+    E implements I;
+    H implements J;
+</pre>
+<script>
+    "use strict";
+    test(function() {
+        var interfaces = [];
+        interfaceFrom('interface A { };').traverse_inherited_and_consequential_interfaces(function(i) {
+            interfaces.push(i.name);
+        });
+        assert_array_equals(interfaces, ["A"]);
+    }, 'should return an array that includes itself.');
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A { }; A implements B;");
+        assert_throws(new Error(), _ => context.members["A"].traverse_inherited_and_consequential_interfaces(function() {}));
+    }, "should throw for interfaces which are extended by another interface which wasn't added to the IdlArray.");
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls("interface A { };");
+        assert_throws(new TypeError(), _ => context.members["A"].traverse_inherited_and_consequential_interfaces());
+    }, "should throw if not passed a callback");
+
+    test(function() {
+        var context = new IdlArray();
+        context.add_idls(document.getElementById('fragments').textContent);
+        var interfaces = [];
+        context.members["A"].traverse_inherited_and_consequential_interfaces(function(i) {
+            interfaces.push(i.name);
+        });
+        assert_array_equals(interfaces, ["C", "B", "F", "E", "I", "D", "A", "G", "H", "J"]);
+    }, 'should return an array that includes the identifier of the interfaces in the correct order.');
+</script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/resources/test/tests/unit/IdlInterfaceMember/is_to_json_regular_operation.html
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>IdlInterfaceMember.prototype.is_to_json_regular_operation()</title>
+</head>
+<body>
+<div id="log"></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<script src="../../../idl-helper.js"></script>
+<script>
+    "use strict";
+    test(function() {
+        var m = memberFrom("readonly attribute DOMString foo");
+        assert_false(m.is_to_json_regular_operation());
+    }, 'should return false when member is an attribute.');
+
+    test(function() {
+        var m = memberFrom("static void foo()");
+        assert_false(m.is_to_json_regular_operation());
+    }, 'should return false when member is a static operation.');
+
+    test(function() {
+        var m = memberFrom("static object toJSON()");
+        assert_false(m.is_to_json_regular_operation());
+    }, 'should return false when member is a static toJSON operation.');
+
+    test(function() {
+        var m = memberFrom("object toJSON()");
+        assert_true(m.is_to_json_regular_operation());
+    }, 'should return true when member is a regular toJSON operation.');
+
+    test(function() {
+        var m = memberFrom("[Foo] object toJSON()");
+        assert_true(m.is_to_json_regular_operation());
+    }, 'should return true when member is a regular toJSON operation with extensible attributes.');
+</script>
+</body>
+</html>
+
rename from testing/web-platform/tests/resources/test/tests/idlharness/OWNERS
rename to testing/web-platform/tests/resources/test/tests/unit/OWNERS
rename from testing/web-platform/tests/resources/test/tests/idlharness/basic.html
rename to testing/web-platform/tests/resources/test/tests/unit/basic.html
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/worker-dedicated.html
+++ /dev/null
@@ -1,88 +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("worker.js"));
-
-fetch_tests_from_worker(new Worker("worker-error.js"));
-
-test(function(t) {
-        assert_false(false, "False is false");
-    },
-    "Test running on main document.");
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "ERROR",
-    "message": "Error: This failure is expected."
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Browser supports Workers",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Test running on main document.",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Untitled",
-      "properties": {},
-      "message": "Error: This failure is expected."
-    },
-    {
-      "status_string": "PASS",
-      "name": "Worker async_test that completes successfully",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Worker test that completes successfully",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "NOTRUN",
-      "name": "Worker test that doesn't run ('NOT RUN')",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Worker test that fails ('FAIL')",
-      "properties": {},
-      "message": "assert_true: Failing test expected true got false"
-    },
-    {
-      "status_string": "TIMEOUT",
-      "name": "Worker test that times out ('TIMEOUT')",
-      "properties": {},
-      "message": "Test timed out"
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/worker-error.js
+++ /dev/null
@@ -1,3 +0,0 @@
-importScripts("../../testharness.js");
-
-throw new Error("This failure is expected.");
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/worker-service.html
+++ /dev/null
@@ -1,115 +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 = "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>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "TIMEOUT",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Browser supports ServiceWorker",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Register ServiceWorker",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Worker async_test that completes successfully",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "PASS",
-      "name": "Worker test that completes successfully",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "NOTRUN",
-      "name": "Worker test that doesn't run ('NOT RUN')",
-      "properties": {},
-      "message": null
-    },
-    {
-      "status_string": "FAIL",
-      "name": "Worker test that fails ('FAIL')",
-      "properties": {},
-      "message": "assert_true: Failing test expected true got false"
-    },
-    {
-      "status_string": "TIMEOUT",
-      "name": "Worker test that times out ('TIMEOUT')",
-      "properties": {},
-      "message": "Test timed out"
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/worker-shared.html
+++ /dev/null
@@ -1,73 +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("worker.js",
-                                         "My shared worker"));
-</script>
-<script type="text/json" id="expected">
-{
-  "summarized_status": {
-    "status_string": "TIMEOUT",
-    "message": null
-  },
-  "summarized_tests": [
-    {
-      "status_string": "PASS",
-      "name": "Browser supports SharedWorkers",
-      "properties": {},
-      "message": null
-    },
-    {
-      "message": null,
-      "name": "Worker async_test that completes successfully",
-      "properties": {},
-      "status_string": "PASS"
-    },
-    {
-      "message": null,
-      "name": "Worker test that completes successfully",
-      "properties": {},
-      "status_string": "PASS"
-    },
-    {
-      "message": null,
-      "name": "Worker test that doesn't run ('NOT RUN')",
-      "properties": {},
-      "status_string": "NOTRUN"
-    },
-    {
-      "message": "assert_true: Failing test expected true got false",
-      "name": "Worker test that fails ('FAIL')",
-      "properties": {},
-      "status_string": "FAIL"
-    },
-    {
-      "message": "Test timed out",
-      "name": "Worker test that times out ('TIMEOUT')",
-      "properties": {},
-      "status_string": "TIMEOUT"
-    }
-  ],
-  "type": "complete"
-}
-</script>
-</body>
deleted file mode 100644
--- a/testing/web-platform/tests/resources/test/tests/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();