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

Unified Diff: chrome/test/data/push_messaging/push_test.js

Issue 2452833004: Fix flaky SW registration in PushMessaging/BudgetManager browser tests (Closed)
Patch Set: Rebase Created 4 years, 1 month 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: chrome/test/data/push_messaging/push_test.js
diff --git a/chrome/test/data/push_messaging/push_test.js b/chrome/test/data/push_messaging/push_test.js
index 24ef5ea221f73b05c5a12ed6cf5a64e67323696d..180f1a622860570361433804d1dc4c6b9e53575f 100644
--- a/chrome/test/data/push_messaging/push_test.js
+++ b/chrome/test/data/push_messaging/push_test.js
@@ -44,10 +44,11 @@ function registerServiceWorker() {
// The base dir used to resolve service_worker.js and the scope depends on
// whether this script is included from an html file in ./, subscope1/, or
// subscope2/.
- navigator.serviceWorker.register('service_worker.js', {scope: './'}).then(
- function(swRegistration) {
- sendResultToTest('ok - service worker registered');
- }, sendErrorToTest);
+ navigator.serviceWorker.register('service_worker.js', {
+ scope: './'
+ }).then(swRegistrationReady).then(() => {
+ sendResultToTest('ok - service worker registered');
+ }).catch(sendErrorToTest);
}
function unregisterServiceWorker() {
« no previous file with comments | « chrome/test/data/budget_service/service_worker.js ('k') | chrome/test/data/push_messaging/service_worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698