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

Unified Diff: content/test/data/background_sync/sync_event_rejected.js

Issue 1160253004: BackgroundSync sync events need to be ExtendableEvents, content browser tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@486890-syncevent
Patch Set: Address nits Created 5 years, 6 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
Index: content/test/data/background_sync/sync_event_rejected.js
diff --git a/content/test/data/background_sync/sync_event_rejected.js b/content/test/data/background_sync/sync_event_rejected.js
new file mode 100644
index 0000000000000000000000000000000000000000..2853ad5aa341c8957e253771e59bdba46d7dcb31
--- /dev/null
+++ b/content/test/data/background_sync/sync_event_rejected.js
@@ -0,0 +1,16 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// 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('Rejecting onsync event');
+ reject("Rejected");
michaeln 2015/06/15 20:34:32 ditto "Rejected" value not used (i think)
chasej 2015/06/17 16:18:07 Done.
+ }, 5);
+ }));
+};

Powered by Google App Engine
This is Rietveld 408576698