Chromium Code Reviews| Index: content/test/data/background_sync/sync_event_fulfilled.js |
| diff --git a/content/test/data/background_sync/sync_event_fulfilled.js b/content/test/data/background_sync/sync_event_fulfilled.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2ffd1b2002ce8463ff290a747a5b3c997ac62a3a |
| --- /dev/null |
| +++ b/content/test/data/background_sync/sync_event_fulfilled.js |
| @@ -0,0 +1,16 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
jkarlin
2015/06/12 13:11:18
2015 here and all other files
chasej
2015/06/12 16:04:13
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +this.onsync = function(event) { |
| + if (!('waitUntil' in event)) { |
| + console.log("waitUntil missing on event"); |
| + return; |
| + } |
| + event.waitUntil(new Promise(function(resolve, reject) { |
| + setTimeout(function() { |
| + console.log('Fulfilling onsync event'); |
| + resolve("Fulfilled"); |
| + }, 5); |
| + })); |
| +}; |