Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <meta charset=utf-8> | |
| 3 <title>Dedicated Worker: Error event error message</title> | |
| 4 <script src=../../resources/testharness.js></script> | |
| 5 <script src=../../resources/testharnessreport.js></script> | |
| 6 <script> | |
| 7 var t = async_test('Error handlers inside a worker should see the error value'); | |
| 8 | |
| 9 test(function() { | |
|
shimazu
2017/04/05 07:23:22
Could you use promise_test to write async test lik
yiyix
2017/04/05 09:02:55
Done.
| |
| 10 var worker = new Worker('resources/error-script.js'); | |
| 11 worker.onmessage = t.step_func(function(e) { | |
| 12 var data = e.data; | |
|
shimazu
2017/04/05 07:23:22
You can use e.data directly for checking the param
yiyix
2017/04/05 09:02:55
Done.
| |
| 13 assert_true(data.source == 'event listener'); | |
|
shimazu
2017/04/05 07:23:22
asser_equals is preferable for comparison.
yiyix
2017/04/05 09:02:55
Done.
| |
| 14 assert_equals(data.value, 'testError'); | |
| 15 t.done(); | |
| 16 }); | |
| 17 }); | |
| 18 </script> | |
| OLD | NEW |