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

Issue 2452833004: Fix flaky SW registration in PushMessaging/BudgetManager browser tests (Closed)

Created:
4 years, 1 month ago by johnme
Modified:
4 years, 1 month ago
Reviewers:
harkness
CC:
chromium-reviews, Peter Beverloo, johnme+watch_chromium.org, harkness+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix flaky SW registration in PushMessaging/BudgetManager browser tests There was a race condition between registering the Service Workers (and having them install and activate) and reloading the page. Many tests were assuming that reloading the page would be sufficient to ensure the page was controlled by the Service Worker. This patch makes that reliable, by waiting until the SW is ready. It should fix the error mentioned in https://crbug.com/657202: Actual: "false - is not controlled" Expected: "true - is controlled" which affected: - BudgetManagerBrowserTest.BudgetInWorker - PushMessagingBrowserTest.SubscribeWorker - PushMessagingBrowserTest.SubscribeWorkerUsingManifest Hopefully it'll also fix https://crbug.com/554003 which affected: - PushMessagingBrowserTest.SubscribePersiste since the errors there were unclear but that test exercises SW registration heavily, so it might well have suffered from the same problem. If that test (alone) turns out to still be flaky, please just mark it flaky again rather than reverting this patch. BUG=657202, 554003 Committed: https://crrev.com/8062ec7de6c712190aad47f398f853afbfb19e5d Cr-Commit-Position: refs/heads/master@{#428996}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -36 lines) Patch
M chrome/browser/budget_service/budget_manager_browsertest.cc View 1 chunk +1 line, -7 lines 0 comments Download
M chrome/browser/push_messaging/push_messaging_browsertest.cc View 1 3 chunks +3 lines, -21 lines 0 comments Download
M chrome/test/data/budget_service/budget_test.js View 1 chunk +29 lines, -4 lines 0 comments Download
M chrome/test/data/budget_service/service_worker.js View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/data/push_messaging/push_test.js View 1 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/test/data/push_messaging/service_worker.js View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (8 generated)
johnme
4 years, 1 month ago (2016-10-26 18:28:01 UTC) #2
harkness
lgtm with comment. You can update the install event or not as you see fit. ...
4 years, 1 month ago (2016-10-27 09:26:15 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2452833004/20001
4 years, 1 month ago (2016-11-01 13:18:56 UTC) #10
johnme
https://codereview.chromium.org/2452833004/diff/1/chrome/test/data/budget_service/service_worker.js File chrome/test/data/budget_service/service_worker.js (right): https://codereview.chromium.org/2452833004/diff/1/chrome/test/data/budget_service/service_worker.js#newcode6 chrome/test/data/budget_service/service_worker.js:6: self.addEventListener('install', () => skipWaiting()); On 2016/10/27 09:26:15, harkness wrote: ...
4 years, 1 month ago (2016-11-01 13:18:59 UTC) #11
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 1 month ago (2016-11-01 14:16:09 UTC) #12
commit-bot: I haz the power
4 years, 1 month ago (2016-11-01 14:17:47 UTC) #14
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/8062ec7de6c712190aad47f398f853afbfb19e5d
Cr-Commit-Position: refs/heads/master@{#428996}

Powered by Google App Engine
This is Rietveld 408576698