OLD | NEW |
1 /*global self*/ | 1 /*global self*/ |
2 /*jshint latedef: nofunc*/ | 2 /*jshint latedef: nofunc*/ |
3 /* | 3 /* |
4 Distributed under both the W3C Test Suite License [1] and the W3C | 4 Distributed under both the W3C Test Suite License [1] and the W3C |
5 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the | 5 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the |
6 policies and contribution forms [3]. | 6 policies and contribution forms [3]. |
7 | 7 |
8 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license | 8 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license |
9 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license | 9 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license |
10 [3] http://www.w3.org/2004/10/27-testcases | 10 [3] http://www.w3.org/2004/10/27-testcases |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 return new DedicatedWorkerTestEnvironment(); | 464 return new DedicatedWorkerTestEnvironment(); |
465 } | 465 } |
466 if ('SharedWorkerGlobalScope' in self && | 466 if ('SharedWorkerGlobalScope' in self && |
467 self instanceof SharedWorkerGlobalScope) { | 467 self instanceof SharedWorkerGlobalScope) { |
468 return new SharedWorkerTestEnvironment(); | 468 return new SharedWorkerTestEnvironment(); |
469 } | 469 } |
470 if ('ServiceWorkerGlobalScope' in self && | 470 if ('ServiceWorkerGlobalScope' in self && |
471 self instanceof ServiceWorkerGlobalScope) { | 471 self instanceof ServiceWorkerGlobalScope) { |
472 return new ServiceWorkerTestEnvironment(); | 472 return new ServiceWorkerTestEnvironment(); |
473 } | 473 } |
| 474 if ('WorkerGlobalScope' in self && |
| 475 self instanceof WorkerGlobalScope) { |
| 476 return new DedicatedWorkerTestEnvironment(); |
| 477 } |
| 478 |
474 throw new Error("Unsupported test environment"); | 479 throw new Error("Unsupported test environment"); |
475 } | 480 } |
476 | 481 |
477 var test_environment = create_test_environment(); | 482 var test_environment = create_test_environment(); |
478 | 483 |
479 function is_shared_worker(worker) { | 484 function is_shared_worker(worker) { |
480 return 'SharedWorker' in self && worker instanceof SharedWorker; | 485 return 'SharedWorker' in self && worker instanceof SharedWorker; |
481 } | 486 } |
482 | 487 |
483 function is_service_worker(worker) { | 488 function is_service_worker(worker) { |
(...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2670 tests.status.status = tests.status.ERROR; | 2675 tests.status.status = tests.status.ERROR; |
2671 tests.status.message = e.message; | 2676 tests.status.message = e.message; |
2672 tests.status.stack = e.stack; | 2677 tests.status.stack = e.stack; |
2673 } | 2678 } |
2674 }); | 2679 }); |
2675 | 2680 |
2676 test_environment.on_tests_ready(); | 2681 test_environment.on_tests_ready(); |
2677 | 2682 |
2678 })(); | 2683 })(); |
2679 // vim: set expandtab shiftwidth=4 tabstop=4: | 2684 // vim: set expandtab shiftwidth=4 tabstop=4: |
OLD | NEW |