Commit 49dd35bd authored by Tsuyoshi Horo's avatar Tsuyoshi Horo Committed by Commit Bot

Ignores the default favicon request in ChromeServiceWorkerFetchTest

Currently if the default favicon request is caught by the testing service worker
the test fails.
This is causing the test flakiness.
To fix this flakiness, this CL change the fetch event handler of the service
worker to ignore the default favicon request.

Bug: 912543
Change-Id: Icdddd902a4547361320f43db5b9090270ba74509
Reviewed-on: https://chromium-review.googlesource.com/c/1370160
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615470}
parent f00a8440
......@@ -282,6 +282,15 @@ class ChromeServiceWorkerFetchTest : public ChromeServiceWorkerTest {
" event.waitUntil(self.clients.claim());"
"};"
"this.onfetch = function(event) {"
// Ignore the default favicon request. The default favicon request
// is sent after the page loading is finished, and we can't
// control the timing of the request. If the request is sent after
// clients.claim() is called, fetch event for the default favicon
// request is triggered and the tests become flaky. See
// https://crbug.com/912543.
" if (event.request.url.endsWith('/favicon.ico')) {"
" return;"
" }"
" event.respondWith("
" self.clients.matchAll().then(function(clients) {"
" clients.forEach(function(client) {"
......
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