New issue
Advanced search Search tips

Issue 839438 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Cap Background fetch downloads to downloadTotal

Project Member Reported by na...@chromium.org, May 3 2018

Issue description

This proposal will allow the user to reason accurately about the fetch and allow it based on the size of the download and the connection they're on.

It'll make downloadTotal required, and will provide an incentive for the developer to set it correctly. If set too high, the user might cancel, if set too low, we'll fail the fetch.
 

Comment 1 by na...@chromium.org, May 3 2018

Owner: na...@chromium.org

Comment 2 by na...@chromium.org, May 4 2018

Status: Assigned (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, May 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c03ee35183d4b18e271e8c626b3c3597170e4faa

commit c03ee35183d4b18e271e8c626b3c3597170e4faa
Author: Mugdha Lakhani <nator@chromium.org>
Date: Wed May 23 15:30:43 2018

[Background Fetch] Cap downloads to downloadTotal.

downloadTotal can be set from BackgroundFetchOptions in the fetch()
call. After this change, if downloadTotal is set to a positive value,
we will start capping downloads to this value. This is to provide a
better user experience, given we surface downloadTotal as total
size of downloads in the UI.

Once as many bytes as downloadTotal are downloaded, and there are more
bytes to download, we cancel all active downloads and dispatch a
BackgroundFetchFail event.

There is no change in behavior if downloadTotal is set too high. It's in
the developers' interest to specify a correct downloadTotal, whenever
possible, to provide a good UI experience for the user. If set too high,
an inaccurate downloadTotal can cause the user to cancel fetch, for fear
of eating into data and storage resources.

Bug:  839438 
Change-Id: I710dfbb6ba0fd13de83f31f6b49a2ade46bae1da
Reviewed-on: https://chromium-review.googlesource.com/1067347
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561095}
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/chrome/browser/background_fetch/background_fetch_browsertest.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/chrome/browser/background_fetch/background_fetch_delegate_impl.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/chrome/browser/background_fetch/background_fetch_delegate_impl.h
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/chrome/test/data/background_fetch/background_fetch.js
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_context.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_context.h
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_delegate_proxy.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_delegate_proxy.h
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_delegate_proxy_unittest.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_job_controller.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_job_controller.h
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_job_controller_unittest.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_scheduler.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_scheduler.h
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/browser/background_fetch/background_fetch_scheduler_unittest.cc
[modify] https://crrev.com/c03ee35183d4b18e271e8c626b3c3597170e4faa/content/public/browser/background_fetch_delegate.h

Project Member

Comment 4 by bugdroid1@chromium.org, Jun 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f7451e312c9e7d9b845da7adf0f1998de99b10eb

commit f7451e312c9e7d9b845da7adf0f1998de99b10eb
Author: Tim Schumann <tschumann@chromium.org>
Date: Mon Jun 11 14:27:02 2018

Disable flaky BackgroundFetchBrowserTest tests.

-- BackgroundFetchBrowserTest.OfflineItemCollection_VerifyResourceDownloadedWhenDownloadTotalSmallerThanActualSize
-- BackgroundFetchBrowserTest.OfflineItemCollection_VerifyResourceDownloadedWhenDownloadTotalLargerThanActualSize

are flaky.
https://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=BackgroundFetchBrowserTest.OfflineItemCollection_VerifyResourceDownloadedWhenDownloadTotal.*ThanActualSize

TBR=peter@chromium.org

Bug:  851229 , 839438 
Change-Id: I0aee9f1fdbabcbe7802d85e3ee782b522a03ff61
Reviewed-on: https://chromium-review.googlesource.com/1095183
Commit-Queue: Tim Schumann <tschumann@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Tim Schumann <tschumann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565993}
[modify] https://crrev.com/f7451e312c9e7d9b845da7adf0f1998de99b10eb/chrome/browser/background_fetch/background_fetch_browsertest.cc

Status: Fixed (was: Assigned)
Resolving this bug since the flaky tests caused by the move to persistent downloads have been fixed.

Sign in to add a comment