File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
workers/constructors/SharedWorker Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < title > Test SharedWorker constructor functionality.</ title >
3
+ < script src ="/resources/testharness.js "> </ script >
4
+ < script src ="/resources/testharnessreport.js "> </ script >
5
+ < script >
6
+ test ( ( ) => {
7
+ assert_throws_js ( Error ,
8
+ function ( ) {
9
+ new SharedWorker ( { toString :function ( ) { throw new Error ( ) } } ) } ,
10
+ 'toString exception should be propagated' ) ;
11
+ } , 'Test toString propagation exception.' ) ;
12
+
13
+ test ( ( ) => {
14
+ assert_throws_js ( TypeError ,
15
+ function ( ) { new SharedWorker ( ) ; } ,
16
+ 'invoking SharedWorker constructor without arguments should result ' +
17
+ 'in an exception.' )
18
+ } , 'Test Sharedworker creation with no arguments' ) ;
19
+
20
+
21
+ test ( ( ) => {
22
+ assert_throws_dom ( "SyntaxError" ,
23
+ function ( ) { var Sharedworker = new SharedWorker ( 'http://invalid:123$' ) ; } ,
24
+ 'Invoking SharedWorker constructor with invalid script URL should ' +
25
+ 'result in an exception.' ) ;
26
+ } , 'Test invalid script URL.' ) ;
27
+
28
+ </ script >
You can’t perform that action at this time.
0 commit comments