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

Unified Diff: LayoutTests/http/tests/background_sync/resources/interfaces-worker.js

Issue 963683002: Add IDL and initial Blink API for Background Sync (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add missing serviceWorkerRegistration.syncManager to interface tests Created 5 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
Index: LayoutTests/http/tests/background_sync/resources/interfaces-worker.js
diff --git a/LayoutTests/http/tests/background_sync/resources/interfaces-worker.js b/LayoutTests/http/tests/background_sync/resources/interfaces-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..52c9d8628bd13c43a4fa7fe25398798868b7c318
--- /dev/null
+++ b/LayoutTests/http/tests/background_sync/resources/interfaces-worker.js
@@ -0,0 +1,37 @@
+importScripts('/resources/testharness.js');
+importScripts('/resources/testharness-helpers.js');
+
+test(function() {
+ assert_own_property(self, 'SyncManager', 'SyncManager needs to be exposed as a global.');
+ assert_will_be_idl_attribute(registration, 'syncManager', 'syncManager needs to be exposed on the registration.');
+
+ assert_inherits(registration.syncManager, 'register');
+ assert_inherits(registration.syncManager, 'getRegistration');
+ assert_inherits(registration.syncManager, 'getRegistrations');
+ // FIXME: Re-enable this once permissions are wired up
+ //assert_inherits(registration.syncManager, 'hasPermission');
+
+}, 'SyncManager should be exposed and have the expected interface.');
+
+test(function() {
+ assert_own_property(self, 'SyncRegistration', 'PushRegistration needs to be exposed as a global.');
+
+ // FIXME: Assert existence of the attributes when they are properly
+ // exposed in the prototype chain. https://crbug.com/43394
+
+ assert_own_property(SyncRegistration.prototype, 'unregister');
+
+}, 'SyncRegistration should be exposed and have the expected interface.');
+
+test(function() {
+ assert_own_property(self, 'SyncEvent');
+
+ var event = new SyncEvent('SyncEvent', {id: 'SyncEvent'});
+ assert_will_be_idl_attribute(event, 'registration');
+ assert_equals(event.type, 'SyncEvent');
+
+ // SyncEvent should be extending ExtendableEvent.
+ assert_inherits(event, 'waitUntil');
+
+}, 'SyncEvent should be exposed and have the expected interface.');
+

Powered by Google App Engine
This is Rietveld 408576698