Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/clients-get-client-types.https.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/clients-get-client-types.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/clients-get-client-types.https.html |
index 5bb312844af978c86b6fd3581eafa0de7ece5e32..75ba474531a253325d394aa686636c8c62667d62 100644 |
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/clients-get-client-types.https.html |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/clients-get-client-types.https.html |
@@ -37,6 +37,16 @@ promise_test(function(t) { |
.then(function(client_id) { |
client_ids.push(client_id); |
var channel = new MessageChannel(); |
+ frame.contentWindow.postMessage('StartWorker', '*', [channel.port2]); |
leonhsl(Using Gerrit)
2017/05/16 03:07:56
Let frame(controlled by our sw) start the worker,
falken
2017/05/16 04:51:35
I see. We shouldn't add this workaround for a Chro
leonhsl(Using Gerrit)
2017/05/18 09:36:30
Got it and I agree such process. I will do so once
|
+ return new Promise(function(resolve) { |
+ channel.port1.onmessage = function(e) { |
+ resolve(e.data.clientId); |
+ }; |
+ }); |
+ }) |
+ .then(function(client_id) { |
+ client_ids.push(client_id); |
+ var channel = new MessageChannel(); |
var saw_message = new Promise(function(resolve) { |
channel.port1.onmessage = resolve; |
}); |
@@ -45,9 +55,10 @@ promise_test(function(t) { |
return saw_message; |
}) |
.then(function(e) { |
- assert_equals(e.data.length, 2); |
+ assert_equals(e.data.length, 3); |
leonhsl(Using Gerrit)
2017/05/16 03:07:56
The current problem is that we always get e.data a
falken
2017/05/16 04:51:35
It sounds like it could be a bug. I'm confused why
leonhsl(Using Gerrit)
2017/05/18 09:36:29
I'm checking around this, found that console.log()
|
assert_array_equals(e.data[0], expected[0]); |
assert_array_equals(e.data[1], expected[1]); |
+ assert_array_equals(e.data[2], expected[2]); |
}); |
}, 'Test Clients.get() with window and worker clients'); |
@@ -65,5 +76,6 @@ var expected = [ |
// visibilityState, focused, url, type, frameType |
['visible', true, normalizeURL(scope) + '-frame.html', 'window', 'nested'], |
[undefined, undefined, normalizeURL(scope) + '-shared-worker.js', 'sharedworker', 'none'] |
+ [undefined, undefined, normalizeURL(scope) + '-frame-worker.js', 'worker', 'none'] |
]; |
</script> |