[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / workers / shared-worker-constructor.html
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)
6 {
7     document.getElementById("result").innerHTML += message + "<br>";
8 }
9
10 if (window.layoutTestController) {
11     layoutTestController.dumpAsText();
12     layoutTestController.waitUntilDone();
13 }
14
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.");
23 }
24
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 + ")");
31 }
32
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 + ")");
38 }
39
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 + ")");
45 }
46
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 + ")");
52 }
53
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 + ")");
59 }
60
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 + ")");
66 }
67
68 log("DONE");
69 if (window.layoutTestController)
70     layoutTestController.notifyDone();
71
72 </script>
73 </body>