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

Issue 2164503003: [OfflinePages] Do not start background loading on low-end devices if app has any visible Activities. (Closed)

Created:
4 years, 5 months ago by dougarnett
Modified:
4 years, 4 months ago
CC:
chromium-reviews, romax+watch_chromium.org, fgorski+watch_chromium.org, dewittj+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, dimich+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[OfflinePages] Do not start background loading on low-end devices if app has any visible Activities. BUG=627884, 622508 Committed: https://crrev.com/6dd8c1ec9f9c9339676e83374eb78c627fc4aa1e Cr-Commit-Position: refs/heads/master@{#406864}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Added comment for setting up fake running activity #

Patch Set 3 : Resets the SysUtils and ApplicationStatus static state so it does not leak to other robolectric tes… #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -0 lines) Patch
M base/android/java/src/org/chromium/base/SysUtils.java View 1 2 1 chunk +8 lines, -0 lines 2 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java View 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java View 1 2 5 chunks +56 lines, -0 lines 2 comments Download

Messages

Total messages: 29 (15 generated)
dougarnett
4 years, 5 months ago (2016-07-19 20:56:59 UTC) #4
Pete Williamson
LGTM with suggestion https://codereview.chromium.org/2164503003/diff/1/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java File chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java (right): https://codereview.chromium.org/2164503003/diff/1/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java#newcode156 chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java:156: Activity testActivity = new Activity(); Maybe ...
4 years, 5 months ago (2016-07-19 21:15:43 UTC) #5
dougarnett
https://codereview.chromium.org/2164503003/diff/1/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java File chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java (right): https://codereview.chromium.org/2164503003/diff/1/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java#newcode156 chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java:156: Activity testActivity = new Activity(); On 2016/07/19 21:15:43, Pete ...
4 years, 5 months ago (2016-07-19 21:29:06 UTC) #6
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/2164503003/20001
4 years, 5 months ago (2016-07-19 22:33:31 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/106817)
4 years, 5 months ago (2016-07-20 01:13:22 UTC) #11
dougarnett
Pete, please take another look.
4 years, 5 months ago (2016-07-20 18:22:10 UTC) #14
dougarnett
Yaron, can you review simple change here to reset SysUtils cached state for low-end device? ...
4 years, 5 months ago (2016-07-20 18:24:15 UTC) #16
Pete Williamson
https://codereview.chromium.org/2164503003/diff/40001/base/android/java/src/org/chromium/base/SysUtils.java File base/android/java/src/org/chromium/base/SysUtils.java (right): https://codereview.chromium.org/2164503003/diff/40001/base/android/java/src/org/chromium/base/SysUtils.java#newcode107 base/android/java/src/org/chromium/base/SysUtils.java:107: sLowEndDevice = null; Should reset be calling detectLowEndDevice() instead ...
4 years, 5 months ago (2016-07-20 18:29:59 UTC) #17
Yaron
lgtm https://codereview.chromium.org/2164503003/diff/40001/base/android/java/src/org/chromium/base/SysUtils.java File base/android/java/src/org/chromium/base/SysUtils.java (right): https://codereview.chromium.org/2164503003/diff/40001/base/android/java/src/org/chromium/base/SysUtils.java#newcode107 base/android/java/src/org/chromium/base/SysUtils.java:107: sLowEndDevice = null; On 2016/07/20 18:29:59, Pete Williamson ...
4 years, 5 months ago (2016-07-21 13:48:06 UTC) #20
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/2164503003/40001
4 years, 5 months ago (2016-07-21 15:51:34 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 5 months ago (2016-07-21 15:54:37 UTC) #24
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/6dd8c1ec9f9c9339676e83374eb78c627fc4aa1e Cr-Commit-Position: refs/heads/master@{#406864}
4 years, 5 months ago (2016-07-21 15:57:03 UTC) #26
pasko
https://codereview.chromium.org/2164503003/diff/40001/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java File chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java (right): https://codereview.chromium.org/2164503003/diff/40001/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java#newcode86 chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java:86: CommandLine.init(new String[] {"testcommand", IS_LOW_END_DEVICE_SWITCH}); did you not choose @CommandLineFlags.Add(BaseSwitches.ENABLE_LOW_END_DEVICE_MODE) ...
4 years, 4 months ago (2016-07-29 09:58:18 UTC) #28
dougarnett
4 years, 4 months ago (2016-07-29 15:55:26 UTC) #29
Message was sent while issue was closed.
https://codereview.chromium.org/2164503003/diff/40001/chrome/android/junit/sr...
File
chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java
(right):

https://codereview.chromium.org/2164503003/diff/40001/chrome/android/junit/sr...
chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java:86:
CommandLine.init(new String[] {"testcommand", IS_LOW_END_DEVICE_SWITCH});
On 2016/07/29 09:58:17, pasko wrote:
> did you not choose
> @CommandLineFlags.Add(BaseSwitches.ENABLE_LOW_END_DEVICE_MODE) because you
> explicitly wanted to run all tests as low end device?

This was a bit interesting. I did try that annotation initially without getting
the desired effect.

I did get it to work with init() but later learned there is an issue with
SysUtils caching the value it first calculates - so whichever test runs first
set the flag and subsequent tests don't actually look at the command switch,
just use the cached value. I added a SysUtils.reset() method and now call it it
tearDown to isolate the command switch interpretation. 

Since figuring that out I have not gone back to try the annotation instead of
init(). I should do that and see if it looks better.

Powered by Google App Engine
This is Rietveld 408576698