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

Issue 2767613002: Expose resources in Robolectric/JUnit tests. (Closed)

Created:
3 years, 9 months ago by mikecase (-- gone --)
Modified:
3 years, 8 months ago
Reviewers:
nyquist, jbudorick, agrieve, dgn
CC:
agrieve+watch_chromium.org, chromium-reviews, jbudorick+watch_chromium.org, mikecase+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Expose resources in Robolectric/JUnit tests. BUG=693573 Review-Url: https://codereview.chromium.org/2767613002 Cr-Commit-Position: refs/heads/master@{#464422} Committed: https://chromium.googlesource.com/chromium/src/+/0d81d90a4b60f8dbcf75f92405cb441db3d08cd3

Patch Set 1 #

Patch Set 2 : Expose resources in Robolectric/JUnit tests. #

Patch Set 3 : Expose resources in Robolectric/JUnit tests. #

Total comments: 5

Patch Set 4 : Added support for multiple resource files. #

Total comments: 9

Patch Set 5 : Expose resources in Robolectric/JUnit tests. #

Patch Set 6 : Rough draft for using build_config to find resources. #

Total comments: 2

Patch Set 7 : GN generate resource dirs. #

Total comments: 3

Patch Set 8 : Simplify changes to write_build_confg #

Total comments: 6

Patch Set 9 : Use zip files. #

Patch Set 10 : GN generate resource dirs. #

Patch Set 11 : Fixed LinkedList nit #

Total comments: 2

Patch Set 12 : rebase! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -91 lines) Patch
M build/android/gyp/create_test_runner_script.py View 1 2 3 4 5 6 7 8 3 chunks +16 lines, -0 lines 0 comments Download
M build/android/gyp/write_build_config.py View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M build/android/pylib/junit/junit_test_instance.py View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -0 lines 0 comments Download
M build/android/pylib/local/machine/local_machine_junit_test_run.py View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +46 lines, -16 lines 0 comments Download
M build/android/test_runner.py View 1 2 3 4 5 6 7 8 1 chunk +15 lines, -0 lines 0 comments Download
M build/android/test_runner.pydeps View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M build/config/android/internal_rules.gni View 1 2 3 4 5 6 7 8 9 2 chunks +31 lines, -1 line 0 comments Download
M build/config/android/rules.gni View 1 2 3 4 5 6 7 8 3 chunks +18 lines, -0 lines 0 comments Download
M chrome/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +1 line, -56 lines 0 comments Download
M testing/android/OWNERS View 1 chunk +1 line, -0 lines 0 comments Download
M testing/android/junit/java/src/org/chromium/testing/local/GNManifestFactory.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +40 lines, -11 lines 0 comments Download
M testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java View 1 2 3 2 chunks +5 lines, -1 line 0 comments Download
M third_party/robolectric/README.chromium View 1 chunk +1 line, -5 lines 0 comments Download

Messages

Total messages: 42 (11 generated)
mikecase (-- gone --)
This CL is 90% plumbing and 10% actual stuff. Basically, just need a way to ...
3 years, 9 months ago (2017-03-21 17:51:21 UTC) #2
mikecase (-- gone --)
https://codereview.chromium.org/2767613002/diff/40001/testing/android/OWNERS File testing/android/OWNERS (right): https://codereview.chromium.org/2767613002/diff/40001/testing/android/OWNERS#newcode4 testing/android/OWNERS:4: mikecase@chromium.org also, sneaking my name in here if that ...
3 years, 9 months ago (2017-03-21 17:52:35 UTC) #3
dgn
So if I understand correctly, running simply "test_runner.py junit -s chrome_junit_tests" won't work and we ...
3 years, 9 months ago (2017-03-21 18:16:42 UTC) #4
mikecase (-- gone --)
Yeah, with this change you would have to run the test with out/Debug/bin/run_chrome_junit_tests https://codereview.chromium.org/2767613002/diff/40001/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java File ...
3 years, 9 months ago (2017-03-21 18:39:36 UTC) #5
dgn
https://codereview.chromium.org/2767613002/diff/40001/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java File chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java (right): https://codereview.chromium.org/2767613002/diff/40001/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java#newcode412 chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java:412: public static class ShadowLayoutInflater { On 2017/03/21 18:39:36, mikecase ...
3 years, 9 months ago (2017-03-22 10:23:47 UTC) #6
mikecase (-- gone --)
ok, turns out string resources do not live with the rest of the resources. So ...
3 years, 8 months ago (2017-03-29 00:08:31 UTC) #7
mikecase (-- gone --)
Updated to be able to specify multiple resource paths. If you specify the resource paths ...
3 years, 8 months ago (2017-03-29 18:30:31 UTC) #8
jbudorick
On 2017/03/29 18:30:31, mikecase wrote: > Updated to be able to specify multiple resource paths. ...
3 years, 8 months ago (2017-03-29 18:32:28 UTC) #9
jbudorick
https://codereview.chromium.org/2767613002/diff/60001/build/android/gyp/create_test_runner_script.py File build/android/gyp/create_test_runner_script.py (right): https://codereview.chromium.org/2767613002/diff/60001/build/android/gyp/create_test_runner_script.py#newcode152 build/android/gyp/create_test_runner_script.py:152: if args.robolectric_runtime_deps_dir: Separate CL idea: there has to be ...
3 years, 8 months ago (2017-03-30 19:11:44 UTC) #10
jbudorick
https://codereview.chromium.org/2767613002/diff/40001/testing/android/OWNERS File testing/android/OWNERS (right): https://codereview.chromium.org/2767613002/diff/40001/testing/android/OWNERS#newcode4 testing/android/OWNERS:4: mikecase@chromium.org On 2017/03/21 17:52:35, mikecase wrote: > also, sneaking ...
3 years, 8 months ago (2017-03-30 19:12:26 UTC) #11
mikecase (-- gone --)
Welp, seems like the bots don't use the runner scripts (e.g. out/bin/run_chrome_junit_tests) to run JUnit ...
3 years, 8 months ago (2017-03-31 17:35:07 UTC) #12
mikecase (-- gone --)
Now that the bots use the bin/run_junit_test wrapper scripts to run tests, all the junit ...
3 years, 8 months ago (2017-04-03 17:14:19 UTC) #13
jbudorick
https://codereview.chromium.org/2767613002/diff/60001/chrome/android/BUILD.gn File chrome/android/BUILD.gn (right): https://codereview.chromium.org/2767613002/diff/60001/chrome/android/BUILD.gn#newcode375 chrome/android/BUILD.gn:375: resource_dirs = [ On 2017/03/31 17:35:07, mikecase wrote: > ...
3 years, 8 months ago (2017-04-03 19:43:25 UTC) #14
mikecase (-- gone --)
+ agrieve@ for build config questions/advice I create a new entry 'test_info' in the build ...
3 years, 8 months ago (2017-04-10 23:50:36 UTC) #16
agrieve
On 2017/04/10 23:50:36, mikecase wrote: > + agrieve@ for build config questions/advice > > I ...
3 years, 8 months ago (2017-04-11 00:24:23 UTC) #17
agrieve
I think the solution for the grit resources is to just extract the resource .zips ...
3 years, 8 months ago (2017-04-11 00:25:06 UTC) #18
mikecase (-- gone --)
Change CL to use resource zipfiles. Much nicer now :D Also, extracting all of the ...
3 years, 8 months ago (2017-04-11 18:02:52 UTC) #19
mikecase (-- gone --)
https://codereview.chromium.org/2767613002/diff/140001/build/android/gyp/write_build_config.py File build/android/gyp/write_build_config.py (right): https://codereview.chromium.org/2767613002/diff/140001/build/android/gyp/write_build_config.py#newcode546 build/android/gyp/write_build_config.py:546: config['test_info']['resources_dirs'] = [ On 2017/04/11 at 00:25:03, agrieve wrote: ...
3 years, 8 months ago (2017-04-11 18:04:31 UTC) #20
agrieve
lgtm!
3 years, 8 months ago (2017-04-11 19:52:31 UTC) #21
jbudorick
lgtm w/ q https://codereview.chromium.org/2767613002/diff/200001/build/config/android/internal_rules.gni File build/config/android/internal_rules.gni (right): https://codereview.chromium.org/2767613002/diff/200001/build/config/android/internal_rules.gni#newcode585 build/config/android/internal_rules.gni:585: deps += [ ":${invoker.test_suite}__build_config" ] Do ...
3 years, 8 months ago (2017-04-11 19:55:05 UTC) #22
mikecase (-- gone --)
https://codereview.chromium.org/2767613002/diff/200001/build/config/android/internal_rules.gni File build/config/android/internal_rules.gni (right): https://codereview.chromium.org/2767613002/diff/200001/build/config/android/internal_rules.gni#newcode585 build/config/android/internal_rules.gni:585: deps += [ ":${invoker.test_suite}__build_config" ] On 2017/04/11 at 19:55:05, ...
3 years, 8 months ago (2017-04-11 21:30:53 UTC) #23
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/2767613002/200001
3 years, 8 months ago (2017-04-11 22:02:38 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/188779) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 8 months ago (2017-04-11 22:06:22 UTC) #27
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/2767613002/220001
3 years, 8 months ago (2017-04-11 22:39:24 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/408559)
3 years, 8 months ago (2017-04-11 23:04:08 UTC) #32
mikecase (-- gone --)
+nyquist for OWNER review of chrome/android/*
3 years, 8 months ago (2017-04-11 23:40:48 UTC) #34
nyquist
lgtm
3 years, 8 months ago (2017-04-13 03:44:33 UTC) #35
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/2767613002/220001
3 years, 8 months ago (2017-04-13 14:44:39 UTC) #37
commit-bot: I haz the power
Committed patchset #12 (id:220001) as https://chromium.googlesource.com/chromium/src/+/0d81d90a4b60f8dbcf75f92405cb441db3d08cd3
3 years, 8 months ago (2017-04-13 15:54:16 UTC) #40
mikecase (-- gone --)
A revert of this CL (patchset #12 id:220001) has been created in https://codereview.chromium.org/2819593002/ by mikecase@chromium.org. ...
3 years, 8 months ago (2017-04-13 18:02:00 UTC) #41
mikecase (-- gone --)
3 years, 8 months ago (2017-04-13 18:03:58 UTC) #42
Message was sent while issue was closed.
On 2017/04/13 at 18:02:00, mikecase wrote:
> A revert of this CL (patchset #12 id:220001) has been created in
https://codereview.chromium.org/2819593002/ by mikecase@chromium.org.
> 
> The reason for reverting is: crbug/711372.

Seems like its possible for resouce_zip to be in the build_config that doesnt
actually exist? Unsure, but I guess I have to check the zip files exist before
trying to unzip them.

Powered by Google App Engine
This is Rietveld 408576698