Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-waituntil.https.html

Issue 2789003002: Upstream service worker ext. event tests to WPT (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-waituntil.https-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-waituntil.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-waituntil.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-waituntil.https.html
index b2029ae426147a4bd748cce3c8c94199f18c56ba..8e790d0ef5ad6d851534362de5647d96699a65f7 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-waituntil.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-waituntil.https.html
@@ -16,14 +16,17 @@ function runTest(test, scope, onRegister) {
// |obj.synced| to true once ack'd.
function syncWorker(test, worker, obj) {
var channel = new MessageChannel();
- channel.port1.onmessage = test.step_func(function(e) {
- var message = e.data;
- assert_equals(message, 'SYNC',
- 'Should receive sync message from worker.');
- obj.synced = true;
- channel.port1.postMessage('ACK');
- });
worker.postMessage({port: channel.port2}, [channel.port2]);
+ return new Promise(function(resolve) {
+ channel.port1.onmessage = test.step_func(function(e) {
+ var message = e.data;
+ assert_equals(message, 'SYNC',
+ 'Should receive sync message from worker.');
+ obj.synced = true;
+ channel.port1.postMessage('ACK');
+ resolve();
+ });
+ });
}
async_test(function(t) {
@@ -68,13 +71,28 @@ async_test(function(t) {
async_test(function(t) {
var scope = 'resources/install-reject-precedence';
var onRegister = function(worker) {
- var obj = {};
+ var obj1 = {};
+ var obj2 = {};
wait_for_state(t, worker, 'redundant')
.then(function() {
+ assert_true(
+ obj1.synced,
+ 'The "redundant" state was entered after the first "extend ' +
+ 'lifetime promise" resolved.'
+ );
+ assert_true(
+ obj2.synced,
+ 'The "redundant" state was entered after the third "extend ' +
+ 'lifetime promise" resolved.'
+ );
service_worker_unregister_and_done(t, scope);
})
.catch(unreached_rejection(t));
- syncWorker(t, worker, obj);
+
+ syncWorker(t, worker, obj1)
+ .then(function() {
+ syncWorker(t, worker, obj2);
+ });
};
runTest(t, scope, onRegister);
}, 'Test ExtendableEvent waitUntil reject precedence.');
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/extendable-event-waituntil.https-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698