Commit bda43c49 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Fix flaky pending app RegistrationTimeout test

PendingAppManagerImplBrowserTest.RegistrationTimeout was
sometimes reporting successful service worker registration,
instead of the expected timeout.

Early in the test, InstallApp executes a run loop. The
service worker had opportunity to register during this run
loop, so the WebAppRegistrationWaiter late in the test would
sometimes report successful service worker registration even
with a timeout of 0.

We now test an app that has no service worker.

Bug: 1071317
Change-Id: I75c3ca39417c70af874b1b44f1c5398864f7e1ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153457
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759961}
parent ebecf17e
...@@ -397,7 +397,7 @@ IN_PROC_BROWSER_TEST_P(PendingAppManagerImplBrowserTest, CannotFetchManifest) { ...@@ -397,7 +397,7 @@ IN_PROC_BROWSER_TEST_P(PendingAppManagerImplBrowserTest, CannotFetchManifest) {
IN_PROC_BROWSER_TEST_P(PendingAppManagerImplBrowserTest, RegistrationTimeout) { IN_PROC_BROWSER_TEST_P(PendingAppManagerImplBrowserTest, RegistrationTimeout) {
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
PendingAppRegistrationTask::SetTimeoutForTesting(0); PendingAppRegistrationTask::SetTimeoutForTesting(0);
GURL url(embedded_test_server()->GetURL("/banners/manifest_test_page.html")); GURL url(embedded_test_server()->GetURL("/web_apps/no_service_worker.html"));
CheckServiceWorkerStatus(url, CheckServiceWorkerStatus(url,
content::ServiceWorkerCapability::NO_SERVICE_WORKER); content::ServiceWorkerCapability::NO_SERVICE_WORKER);
......
<!DOCTYPE html>
<html>
<head>
<link rel="manifest" href="no_service_worker.json">
<link rel="icon" href="basic-48.png">
</head>
<body>
<h1>Web app with no service worker</h1>
</body>
</html>
{
"name": "Web app with no service worker",
"icons": [
{
"src": "basic-48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "basic-192.png",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "no_service_worker.html",
"display": "standalone"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment