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

Issue 2956283002: Expose Add/RemoveActionCallback to java (Closed)

Created:
3 years, 5 months ago by dullweber
Modified:
3 years, 5 months ago
Reviewers:
msramek, Theresa, Yaron
CC:
chromium-reviews, danakj+watch_chromium.org, agrieve+watch_chromium.org, asvitkine+watch_chromium.org, vmpstr+watch_chromium.org, dmurph
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Expose Add/RemoveActionCallback to java Add support for testing user actions from Java by exposing addActionCallback and removeActionCallback. Add a UserActionTester class for java tests. Add some tests for BrowsingDataBridge as an example. There is already a similar approach for histogram tests using getHistogramValueCountForTesting(). BUG= Review-Url: https://codereview.chromium.org/2956283002 Cr-Commit-Position: refs/heads/master@{#485616} Committed: https://chromium.googlesource.com/chromium/src/+/4f2ac33787e3661d3ce05d7aeb2429f300e08b82

Patch Set 1 #

Patch Set 2 : add Test #

Patch Set 3 : Add UserActionTester.java and convert to Junit4 #

Total comments: 4

Patch Set 4 : Use CallbackHelper #

Total comments: 1

Patch Set 5 : notify -> notifies #

Patch Set 6 : add simple test case for incorrect logging #

Patch Set 7 : rebase and update test #

Total comments: 2

Patch Set 8 : Use assert instead of an exception #

Unified diffs Side-by-side diffs Delta from patch set Stats (+321 lines, -1 line) Patch
M base/BUILD.gn View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M base/android/java/src/org/chromium/base/metrics/RecordUserAction.java View 1 2 3 4 5 6 7 2 chunks +32 lines, -0 lines 0 comments Download
M base/android/record_user_action.cc View 1 2 chunks +38 lines, -0 lines 0 comments Download
A base/test/android/javatests/src/org/chromium/base/test/util/UserActionTester.java View 1 2 1 chunk +51 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java_sources.gni View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java View 1 2 3 4 5 6 7 1 chunk +197 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (29 generated)
dullweber
Hello Theresa, I created a UserActionTester for Java and wrote a first test for it. ...
3 years, 5 months ago (2017-06-30 09:58:10 UTC) #11
dullweber
Hi Martin, I added a test for recording of UserActions. Could you take a look ...
3 years, 5 months ago (2017-06-30 10:01:40 UTC) #13
Theresa
https://codereview.chromium.org/2956283002/diff/60001/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java (right): https://codereview.chromium.org/2956283002/diff/60001/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java#newcode51 chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java:51: mSemaphore.release(); We typically use CallbackHelpers to wait for asynchronous ...
3 years, 5 months ago (2017-07-05 20:55:30 UTC) #17
dullweber
dmurph: by writing a test for UserActions in ClearBrowsingData, I discovered that ClearBrowsingData_MaskContainsUnprotectedWeb is logged ...
3 years, 5 months ago (2017-07-06 08:32:08 UTC) #19
dullweber
https://codereview.chromium.org/2956283002/diff/60001/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java (right): https://codereview.chromium.org/2956283002/diff/60001/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java#newcode51 chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataBridgeTest.java:51: mSemaphore.release(); On 2017/07/05 20:55:29, Theresa wrote: > We typically ...
3 years, 5 months ago (2017-07-06 08:53:15 UTC) #20
Theresa
It looks like the code from this change got merged in: https://chromium.googlesource.com/chromium/src/+/72ce5d481f11212f8cbb99f13058a82f4f4a0d84%5E%21/#F4 Was that intentional? ...
3 years, 5 months ago (2017-07-06 23:06:35 UTC) #21
dullweber
On 2017/07/06 23:06:35, Theresa wrote: > It looks like the code from this change got ...
3 years, 5 months ago (2017-07-07 08:17:30 UTC) #22
dmurph
On 2017/07/07 08:17:30, dullweber wrote: > On 2017/07/06 23:06:35, Theresa wrote: > > It looks ...
3 years, 5 months ago (2017-07-07 18:33:34 UTC) #23
dullweber
On 2017/07/07 18:33:34, dmurph wrote: > On 2017/07/07 08:17:30, dullweber wrote: > > On 2017/07/06 ...
3 years, 5 months ago (2017-07-10 09:03:20 UTC) #24
Theresa
chrome/android/.../preferences lgtm
3 years, 5 months ago (2017-07-10 15:01:37 UTC) #30
dullweber
On 2017/07/07 18:33:34, dmurph wrote: > On 2017/07/07 08:17:30, dullweber wrote: > > On 2017/07/06 ...
3 years, 5 months ago (2017-07-10 15:04:37 UTC) #31
dullweber
yfriedman@chromium.org: Please review changes in base/android and base/test/android
3 years, 5 months ago (2017-07-10 15:07:56 UTC) #33
Yaron
https://codereview.chromium.org/2956283002/diff/140001/base/android/java/src/org/chromium/base/metrics/RecordUserAction.java File base/android/java/src/org/chromium/base/metrics/RecordUserAction.java (right): https://codereview.chromium.org/2956283002/diff/140001/base/android/java/src/org/chromium/base/metrics/RecordUserAction.java#newcode69 base/android/java/src/org/chromium/base/metrics/RecordUserAction.java:69: if (sNativeActionCallback != 0) { How about you use ...
3 years, 5 months ago (2017-07-10 18:14:25 UTC) #34
dullweber
I replaced the exceptions with an assert, thanks https://codereview.chromium.org/2956283002/diff/140001/base/android/java/src/org/chromium/base/metrics/RecordUserAction.java File base/android/java/src/org/chromium/base/metrics/RecordUserAction.java (right): https://codereview.chromium.org/2956283002/diff/140001/base/android/java/src/org/chromium/base/metrics/RecordUserAction.java#newcode69 base/android/java/src/org/chromium/base/metrics/RecordUserAction.java:69: if ...
3 years, 5 months ago (2017-07-11 11:45:55 UTC) #35
Yaron
lgtm
3 years, 5 months ago (2017-07-11 13:27:13 UTC) #40
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/2956283002/160001
3 years, 5 months ago (2017-07-11 13:28:28 UTC) #43
commit-bot: I haz the power
3 years, 5 months ago (2017-07-11 13:35:06 UTC) #46
Message was sent while issue was closed.
Committed patchset #8 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/4f2ac33787e3661d3ce05d7aeb24...

Powered by Google App Engine
This is Rietveld 408576698