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

Issue 1254973003: Add a way to reset cached command line arguments (Closed)

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

Description

Add a way to reset cached command line arguments Command line arguments are set at runtime in instrumentation tests (see base.test.util.CommandLineFlags.java) and caching them breaks some tests. Added a reset counter, so that code caching the command line result can check the counter to know when to checks the arguments again TBR=yfriedman@chromium.org BUG=514155 Committed: https://crrev.com/bef1072f72220ebc4c9a790f572c71ba86bf1777 Cr-Commit-Position: refs/heads/master@{#340457}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Use listeners instead of an atomic counter #

Total comments: 2

Patch Set 3 : Replace separate notify method call with posting a new message #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -0 lines) Patch
M base/android/java/src/org/chromium/base/CommandLine.java View 1 2 4 chunks +25 lines, -0 lines 2 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java View 1 3 chunks +15 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
dgn
PTAL
5 years, 4 months ago (2015-07-27 10:49:23 UTC) #2
Bernhard Bauer
https://codereview.chromium.org/1254973003/diff/1/base/android/java/src/org/chromium/base/CommandLine.java File base/android/java/src/org/chromium/base/CommandLine.java (right): https://codereview.chromium.org/1254973003/diff/1/base/android/java/src/org/chromium/base/CommandLine.java#newcode137 base/android/java/src/org/chromium/base/CommandLine.java:137: sResetCounter.incrementAndGet(); Could we use an observer here that would ...
5 years, 4 months ago (2015-07-27 11:04:19 UTC) #3
dgn
https://codereview.chromium.org/1254973003/diff/1/base/android/java/src/org/chromium/base/CommandLine.java File base/android/java/src/org/chromium/base/CommandLine.java (right): https://codereview.chromium.org/1254973003/diff/1/base/android/java/src/org/chromium/base/CommandLine.java#newcode137 base/android/java/src/org/chromium/base/CommandLine.java:137: sResetCounter.incrementAndGet(); On 2015/07/27 11:04:18, Bernhard Bauer wrote: > Could ...
5 years, 4 months ago (2015-07-27 11:35:35 UTC) #4
Bernhard Bauer
https://codereview.chromium.org/1254973003/diff/1/base/android/java/src/org/chromium/base/CommandLine.java File base/android/java/src/org/chromium/base/CommandLine.java (right): https://codereview.chromium.org/1254973003/diff/1/base/android/java/src/org/chromium/base/CommandLine.java#newcode137 base/android/java/src/org/chromium/base/CommandLine.java:137: sResetCounter.incrementAndGet(); On 2015/07/27 11:35:35, dgn wrote: > On 2015/07/27 ...
5 years, 4 months ago (2015-07-27 12:45:55 UTC) #5
dgn
PTAL https://codereview.chromium.org/1254973003/diff/20001/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java File base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java (right): https://codereview.chromium.org/1254973003/diff/20001/base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java#newcode75 base/test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java:75: CommandLine.notifyResetListeners(); On 2015/07/27 12:45:55, Bernhard Bauer wrote: > ...
5 years, 4 months ago (2015-07-27 13:11:37 UTC) #6
Bernhard Bauer
LGTM, thanks!
5 years, 4 months ago (2015-07-27 13:17:06 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1254973003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1254973003/40001
5 years, 4 months ago (2015-07-27 13:18:22 UTC) #9
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 4 months ago (2015-07-27 14:29:03 UTC) #10
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/bef1072f72220ebc4c9a790f572c71ba86bf1777 Cr-Commit-Position: refs/heads/master@{#340457}
5 years, 4 months ago (2015-07-27 14:30:13 UTC) #11
jdduke (slow)
https://codereview.chromium.org/1254973003/diff/40001/base/android/java/src/org/chromium/base/CommandLine.java File base/android/java/src/org/chromium/base/CommandLine.java (right): https://codereview.chromium.org/1254973003/diff/40001/base/android/java/src/org/chromium/base/CommandLine.java#newcode154 base/android/java/src/org/chromium/base/CommandLine.java:154: public static void addResetListener(ResetListener listener) { Hmm, I'd really ...
5 years, 4 months ago (2015-07-27 15:05:23 UTC) #13
dgn
https://codereview.chromium.org/1254973003/diff/40001/base/android/java/src/org/chromium/base/CommandLine.java File base/android/java/src/org/chromium/base/CommandLine.java (right): https://codereview.chromium.org/1254973003/diff/40001/base/android/java/src/org/chromium/base/CommandLine.java#newcode154 base/android/java/src/org/chromium/base/CommandLine.java:154: public static void addResetListener(ResetListener listener) { On 2015/07/27 15:05:23, ...
5 years, 4 months ago (2015-07-27 15:12:29 UTC) #14
jdduke (slow)
5 years, 4 months ago (2015-07-27 15:51:12 UTC) #15
Message was sent while issue was closed.
On 2015/07/27 15:12:29, dgn wrote:
>
https://codereview.chromium.org/1254973003/diff/40001/base/android/java/src/o...
> File base/android/java/src/org/chromium/base/CommandLine.java (right):
> 
>
https://codereview.chromium.org/1254973003/diff/40001/base/android/java/src/o...
> base/android/java/src/org/chromium/base/CommandLine.java:154: public static
void
> addResetListener(ResetListener listener) {
> On 2015/07/27 15:05:23, jdduke wrote:
> > Hmm, I'd really like to understand use-cases that legitimately need dynamic
> > CommandLine-change observation outside of tests. I don't think we should be
> > complicating this interface with listeners only to supporting testing.
Rather,
> > we should modify tests to be consistent in how they rely on command-line
> flags.
> 
> It should not be used out of tests, yes. An annotation is missing. And the
> correct solution would be to fix the tests indeed. There I just wanted to send
a
> fix that would make the tests pass without reverting cls or disabling them on
> all L+ bots.

Perfect, sounds good.

Powered by Google App Engine
This is Rietveld 408576698