Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-response-xhr.https.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-response-xhr.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-response-xhr.https.html |
| index 24eb44e222ece562c5e34fe238e4e71c10f10b0d..f901be2b101058c18d7e517c4508a527ed48bd38 100644 |
| --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-response-xhr.https.html |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-response-xhr.https.html |
| @@ -12,8 +12,10 @@ async_test(function(t) { |
| window.addEventListener('message', t.step_func(on_message), false); |
| function on_message(e) { |
| - assert_equals(e.data.results, 'foo, bar'); |
| - t.done(); |
| + t.step(function() { |
|
Marijn Kruisselbrink
2017/05/05 23:59:00
why this t.step? on_message is already wrapped in
mike3
2017/05/08 18:41:41
Using `t.step` like this ensures that the protocol
|
| + assert_equals(e.data.results, 'foo, bar'); |
| + }); |
| + e.source.postMessage('ACK', host_info['HTTPS_ORIGIN']); |
| } |
| service_worker_unregister_and_register(t, SCRIPT, SCOPE) |
| @@ -22,13 +24,19 @@ async_test(function(t) { |
| }) |
| .then(function() { return with_iframe(SCOPE); }) |
| .then(function(frame) { |
| - var channel = new MessageChannel(); |
| - channel.port1.onmessage = t.step_func(function(e) { |
| - assert_equals(e.data.results, 'finish'); |
| + var channel; |
| + |
| + t.add_cleanup(function() { |
| frame.remove(); |
| service_worker_unregister_and_done(t, SCOPE); |
| }); |
| - frame.contentWindow.postMessage({}, |
| + |
| + channel = new MessageChannel(); |
| + channel.port1.onmessage = t.step_func(function(e) { |
| + assert_equals(e.data.results, 'finish'); |
| + t.done(); |
| + }); |
| + frame.contentWindow.postMessage('START', |
| host_info['HTTPS_ORIGIN'], |
| [channel.port2]); |
| }) |