Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / workers / shared-worker-constructor.html
blob2eec12c915b0210a8ab835fdc57f2aaeb59c0106
1 <body>
2 <p>Test SharedWorker constructor functionality. Should print a series of PASS messages, followed with DONE.</p>
3 <div id=result></div>
4 <script>
5 function log(message)
7 document.getElementById("result").innerHTML += message + "<br>";
10 if (window.testRunner) {
11 testRunner.dumpAsText();
12 testRunner.waitUntilDone();
15 try {
16 new SharedWorker({toString:function(){throw "exception"}}, "name")
17 log("FAIL: toString exception not propagated.");
18 } catch (ex) {
19 if (ex == "exception")
20 log("PASS: toString exception propagated correctly.");
21 else
22 log("FAIL: unexpected exception (" + ex + ") received instead of one propagated from toString.");
25 try {
26 var foo = {toString:function(){new Worker(foo)}}
27 new SharedWorker(foo, name);
28 log("FAIL: no exception when trying to create workers recursively");
29 } catch (ex) {
30 log("PASS: trying to create workers recursively resulted in an exception (" + ex + ")");
33 try {
34 new SharedWorker();
35 log("FAIL: invoking SharedWorker constructor without arguments did not result in an exception");
36 } catch (ex) {
37 log("PASS: invoking SharedWorker constructor without arguments resulted in an exception (" + ex + ")");
40 try {
41 var worker = new SharedWorker("resources/shared-worker-common.js");
42 log("PASS: invoking SharedWorker constructor without name did not result in an exception");
43 } catch (ex) {
44 log("FAIL: Constructor failed when no name is passed: (" + ex + ")");
47 try {
48 new SharedWorker("resources/shared-worker-common.js", null);
49 log("PASS: invoking SharedWorker constructor with null name did not result in an exception");
50 } catch (ex) {
51 log("FAIL: invoking SharedWorker constructor with null name resulted in an exception (" + ex + ")");
54 try {
55 new SharedWorker("resources/shared-worker-common.js", undefined);
56 log("PASS: invoking SharedWorker constructor with undefined name did not result in an exception");
57 } catch (ex) {
58 log("FAIL: invoking SharedWorker constructor with undefined name resulted in an exception (" + ex + ")");
61 try {
62 var worker = new SharedWorker("resources/shared-worker-common.js", "name");
63 log ("PASS: SharedWorker constructor succeeded: " + worker);
64 } catch (ex) {
65 log("FAIL: invoking SharedWorker constructor resulted in an exception (" + ex + ")");
68 log("DONE");
69 if (window.testRunner)
70 testRunner.notifyDone();
72 </script>
73 </body>