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

Side by Side Diff: chrome/test/data/notifications/notification_test_utils.js

Issue 2418153002: Hooking up Android N inline notification replies end-to-end (Closed)
Patch Set: Reformat getNotificationReply Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/notifications/android_test_worker.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var activatedServiceWorkerPromise = null; 5 var activatedServiceWorkerPromise = null;
6 var messagePort = null;
6 7
7 // Returns a promise that will be resolved with an activated Service 8 // Returns a promise that will be resolved with an activated Service
8 // Worker, or rejects when the Service Worker could not be started. There 9 // Worker, or rejects when the Service Worker could not be started. There
9 // will be a message port to and from the worker in |messagePort|. 10 // will be a message port to and from the worker in |messagePort|.
10 function GetActivatedServiceWorker(script, scope) { 11 function GetActivatedServiceWorker(script, scope) {
11 if (activatedServiceWorkerPromise == null) { 12 if (activatedServiceWorkerPromise == null) {
12 activatedServiceWorkerPromise = 13 activatedServiceWorkerPromise =
13 navigator.serviceWorker.getRegistration(scope) 14 navigator.serviceWorker.getRegistration(scope)
14 .then(function(registration) { 15 .then(function(registration) {
15 // Unregister any existing Service Worker. 16 // Unregister any existing Service Worker.
(...skipping 28 matching lines...) Expand all
44 [ channel.port2 ]); 45 [ channel.port2 ]);
45 46
46 messagePort = channel.port1; 47 messagePort = channel.port1;
47 messagePort.start(); 48 messagePort.start();
48 }); 49 });
49 }); 50 });
50 } 51 }
51 52
52 return activatedServiceWorkerPromise; 53 return activatedServiceWorkerPromise;
53 } 54 }
OLDNEW
« no previous file with comments | « chrome/test/data/notifications/android_test_worker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698