Testing in workers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

There's been a few new features for testing in workers, so I thought
I'd share a status update.

Building on Asanka Herath's work to simplify testing in workers (which
also happens to help with testing Promises) [1-2], I've now finished a
feature [3] that should make it even simpler to write tests for
dedicated workers that have no need for code to run on the main thread.

In particular, it is now possible to create a JS file called
foo.worker.js, for example like this:

# importScripts("/resources/testharness.js");
# test(function () {
#   var blob = new Blob();
#   assert_equals(blob.size, 0);
#   assert_equals(blob.type, "");
#   assert_false(blob.isClosed);
# }, "The Blob constructor.");
# done();

…and run the test from foo.worker.

Additionally, I've updated idlharness.js [4] to work in workers, so it
is now trivial to use it to test worker interfaces. I've already
created [5] a test for DedicatedWorkerGlobalScope, WorkerNavigator and
WorkerLocation.

Thanks to all for the help and reviews.

HTH
Ms2ger

[1] https://github.com/w3c/testharness.js/pull/82
[2] https://github.com/w3c/testharness.js/pull/93
[3] https://github.com/w3c/web-platform-tests/pull/1511
[4] https://github.com/w3c/testharness.js/pull/101
[5] https://github.com/w3c/web-platform-tests/pull/1517
-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJUs+uZAAoJEOXgvIL+s8n2TMEIAIVOL2+GZDUKFp2uaZc8Xq2O
x1/ZJncDVXXn/LuxBoQZ6wijPdYi3kfx8A2SVjnsNkgraZHaRaqbzKCOg2kj/UsJ
e4ym21r6bvYE7A9i+koqXXhRYv8jse+2lpHNkBm+28TXmVMkCwepw/9WemsQZ6LU
+/EamYAcYnnWUAiY8xpcC8fdHwq4C2JQxYH5b2SawK89sXfGwRgtDQJzgxwe1uO7
Bf72143DuPJA2iK1RF+7YlLbbz2lBgE62uAbfQ4zb2NBR25PIiYu+iNUIX2TcThB
PotiGGhskPRQdtQU914PQBq9dIAqwwqaAfUwzjL4gk9h5PxOZ0NnAVy7x1xkLkM=
=Uzi6
-----END PGP SIGNATURE-----

Received on Monday, 12 January 2015 15:44:19 UTC