mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Bug 1200884: Make postmessage-to-client.https.html pass. r=jdm
This commit is contained in:
parent
f26125be1a
commit
f9c94d4c04
@ -1,6 +0,0 @@
|
||||
[postmessage-to-client.https.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[postMessage from ServiceWorker to Client]
|
||||
expected: TIMEOUT
|
||||
|
@ -6,7 +6,8 @@
|
||||
<script>
|
||||
var t = async_test('postMessage from ServiceWorker to Client');
|
||||
t.step(function() {
|
||||
var scope = 'resources/blank.html'
|
||||
var scope = 'resources/blank.html';
|
||||
var sw;
|
||||
service_worker_unregister_and_register(
|
||||
t, 'resources/postmessage-to-client-worker.js', scope)
|
||||
.then(function(registration) {
|
||||
@ -14,9 +15,9 @@ t.step(function() {
|
||||
})
|
||||
.then(function() { return with_iframe(scope); })
|
||||
.then(function(frame) {
|
||||
var w = frame.contentWindow;
|
||||
w.onmessage = t.step_func(onMessage);
|
||||
w.navigator.serviceWorker.controller.postMessage('ping');
|
||||
sw = frame.contentWindow.navigator.serviceWorker;
|
||||
sw.onmessage = t.step_func(onMessage);
|
||||
sw.controller.postMessage('ping');
|
||||
})
|
||||
.catch(unreached_rejection(t));
|
||||
|
||||
@ -24,6 +25,11 @@ t.step(function() {
|
||||
var expected = ['Sending message via clients'];
|
||||
|
||||
function onMessage(e) {
|
||||
assert_equals(e.bubbles, false, 'message events should not bubble.');
|
||||
assert_equals(e.cancelable, false, 'message events should not be cancelable.');
|
||||
// XXXkhuey fixme!
|
||||
// assert_equals(e.source, sw.controller, 'source should be ServiceWorker.');
|
||||
|
||||
var message = e.data;
|
||||
if (message === 'quit') {
|
||||
assert_array_equals(result, expected,
|
||||
|
Loading…
Reference in New Issue
Block a user