Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / storage / indexeddb / transaction-complete-workers.html
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <script src="resources/shared.js"></script>
5 </head>
6 <body>
7 <script>
8
9 worker = startWorker('resources/transaction-complete-workers.js');
10
11 // FIXME: It should be possible for the worker to set self.onerror to catch the event
12 // and call event.preventDefault(), but in the current Worker implementation the raw
13 // exception is seen by the event handler in the worker, not an ErrorEvent object.
14
15 var orig_onerror = worker.onerror;
16 worker.onerror = function (event) {
17     if (event.message === "Uncaught Error: ignore this" || event.message === "Error: ignore this") {
18         debug("Got expected error from worker, ignoring");
19         evalAndLog("event.preventDefault()");
20     } else if (orig_onerror) {
21         orig_onerror(event);
22     }
23 };
24
25
26 </script>
27 </body>
28 </html>