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

Issue 258043003: Eliminate components_unittests' dependence on chrome resources. (Closed)

Created:
6 years, 7 months ago by blundell
Modified:
5 years, 10 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Eliminate components_unittests' dependence on chrome resources. This CL changes components_unittests to create its own pakfile rather than relying on the chrome pakfile. To do this it adds a repack step that repacks the pakfiles that components_unittests needs into a components_unittests_resources.pak file, and then loads that pakfile explicitly. This change means that components_unittests now passes after a clean build, whereas before it would fail due to missing resources. BUG=364622, 348563

Patch Set 1 #

Total comments: 5

Patch Set 2 : Fix for Android #

Patch Set 3 : Address review comments #

Total comments: 2

Patch Set 4 : Restore ui path provider #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -43 lines) Patch
M components/components_tests.gyp View 1 2 4 chunks +14 lines, -5 lines 0 comments Download
M components/components_unittests.isolate View 1 1 chunk +1 line, -4 lines 0 comments Download
M components/test/run_all_unittests.cc View 1 2 3 3 chunks +3 lines, -34 lines 1 comment Download

Messages

Total messages: 31 (0 generated)
blundell
Jochen: For review. Thanks for the help with this one! Thiago: FYI.
6 years, 7 months ago (2014-04-29 14:27:47 UTC) #1
tfarina
Colin, this is awesome :) Thanks for fixing this. https://codereview.chromium.org/258043003/diff/1/components/components_tests.gyp File components/components_tests.gyp (right): https://codereview.chromium.org/258043003/diff/1/components/components_tests.gyp#newcode251 components/components_tests.gyp:251: ...
6 years, 7 months ago (2014-04-29 15:58:25 UTC) #2
tfarina
https://codereview.chromium.org/258043003/diff/1/components/test/run_all_unittests.cc File components/test/run_all_unittests.cc (left): https://codereview.chromium.org/258043003/diff/1/components/test/run_all_unittests.cc#oldcode68 components/test/run_all_unittests.cc:68: ui::RegisterPathProvider(); are you sure this can go away? Last ...
6 years, 7 months ago (2014-04-29 16:00:38 UTC) #3
tony
Bots are green, so LGTM. https://codereview.chromium.org/258043003/diff/1/components/components_tests.gyp File components/components_tests.gyp (right): https://codereview.chromium.org/258043003/diff/1/components/components_tests.gyp#newcode251 components/components_tests.gyp:251: 'action_name': 'repack_components_pack', On 2014/04/29 ...
6 years, 7 months ago (2014-04-29 16:36:52 UTC) #4
jochen (gone - plz use gerrit)
lgtm, thanks!
6 years, 7 months ago (2014-04-29 16:38:12 UTC) #5
tfarina
I'm checking the CQ box. It seems fine to land this with Tony's approval.
6 years, 7 months ago (2014-05-01 22:09:53 UTC) #6
tfarina
The CQ bit was checked by tfarina@chromium.org
6 years, 7 months ago (2014-05-01 22:09:58 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/blundell@chromium.org/258043003/1
6 years, 7 months ago (2014-05-01 22:11:27 UTC) #8
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-02 04:43:33 UTC) #9
commit-bot: I haz the power
The commit queue went berserk retrying too often for a seemingly flaky test on builder ...
6 years, 7 months ago (2014-05-02 04:43:33 UTC) #10
tfarina
The CQ bit was checked by tfarina@chromium.org
6 years, 7 months ago (2014-05-02 04:48:18 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/blundell@chromium.org/258043003/1
6 years, 7 months ago (2014-05-02 04:48:36 UTC) #12
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-02 11:14:45 UTC) #13
tfarina
This fails on Android: For example: [ RUN ] WalletClientTest.CancelRequest [FATAL:scoped_ptr.h(376)] Assert failed: impl_.get() != ...
6 years, 7 months ago (2014-05-02 15:46:49 UTC) #15
tfarina
https://codereview.chromium.org/258043003/diff/1/components/components_tests.gyp File components/components_tests.gyp (right): https://codereview.chromium.org/258043003/diff/1/components/components_tests.gyp#newcode315 components/components_tests.gyp:315: 'includes': ['../chrome/chrome_ios_bundle_resources.gypi'], Can this also be removed?
6 years, 7 months ago (2014-05-02 22:26:59 UTC) #16
blundell
+bulach, torne, yfriedman Hi Android folks, The Android port is not happy with my CL ...
6 years, 7 months ago (2014-05-05 14:29:28 UTC) #17
bulach
On 2014/05/05 14:29:28, blundell wrote: > +bulach, torne, yfriedman > > Hi Android folks, > ...
6 years, 7 months ago (2014-05-06 10:42:26 UTC) #18
blundell
Thanks for taking a look! Sorry, I should have been more explicit. It's clear that ...
6 years, 7 months ago (2014-05-06 10:51:02 UTC) #19
bulach
On 2014/05/06 10:51:02, blundell wrote: > Thanks for taking a look! Sorry, I should have ...
6 years, 7 months ago (2014-05-06 14:17:02 UTC) #20
tfarina
On 2014/05/06 14:17:02, bulach wrote: > On 2014/05/06 10:51:02, blundell wrote: > > Thanks for ...
6 years, 7 months ago (2014-05-06 15:27:19 UTC) #21
tfarina
On 2014/05/06 14:17:02, bulach wrote: > On 2014/05/06 10:51:02, blundell wrote: > > Thanks for ...
6 years, 7 months ago (2014-05-06 15:28:24 UTC) #22
tony
Maybe you can change MemoryMappedFile::Initialize() to write out file_.error_details() and run it through the try ...
6 years, 7 months ago (2014-05-06 16:42:25 UTC) #23
Yaron
https://codereview.chromium.org/258043003/diff/40001/components/test/run_all_unittests.cc File components/test/run_all_unittests.cc (right): https://codereview.chromium.org/258043003/diff/40001/components/test/run_all_unittests.cc#newcode47 components/test/run_all_unittests.cc:47: resources_pack_path.AppendASCII("components_unittests_resources.pak")); There's an example of doing a similar pattern ...
6 years, 7 months ago (2014-05-06 17:50:58 UTC) #24
tfarina
The comment in https://code.google.com/p/chromium/codesearch#chromium/src/ui/base/test/run_all_unittests.cc&l=67, seems to indicate that components_unittests_apk provides the framework necessary, but still ...
6 years, 7 months ago (2014-05-06 18:03:08 UTC) #25
blundell
On 2014/05/06 18:03:08, tfarina wrote: > The comment in > https://code.google.com/p/chromium/codesearch#chromium/src/ui/base/test/run_all_unittests.cc&l=67, > seems to indicate ...
6 years, 7 months ago (2014-05-06 19:08:53 UTC) #26
Yaron
That sounds plausible. And actually, it's a good point; component_browsertests doesn't yet run on android. ...
6 years, 7 months ago (2014-05-06 20:30:04 UTC) #27
Yaron
On 2014/05/06 20:30:04, Yaron wrote: > That sounds plausible. And actually, it's a good point; ...
6 years, 7 months ago (2014-05-06 21:25:50 UTC) #28
tfarina
https://codereview.chromium.org/258043003/diff/60001/components/test/run_all_unittests.cc File components/test/run_all_unittests.cc (right): https://codereview.chromium.org/258043003/diff/60001/components/test/run_all_unittests.cc#newcode45 components/test/run_all_unittests.cc:45: ui::RegisterPathProvider(); Yaron, there is no components_paths.cc:RegisterPathProvider. This is one ...
6 years, 7 months ago (2014-05-07 20:58:39 UTC) #29
tfarina
[ERROR:memory_mapped_file.cc(23)] Couldn't open /storage/emulated/0/components_unittests_resources.pak So is that the place (/storage/emulated/0) android looks for pak files? ...
6 years, 7 months ago (2014-05-07 21:09:25 UTC) #30
Yaron
6 years, 7 months ago (2014-05-08 01:13:49 UTC) #31
On 2014/05/07 21:09:25, tfarina wrote:
> [ERROR:memory_mapped_file.cc(23)] Couldn't open
> /storage/emulated/0/components_unittests_resources.pak
> 
> So is that the place (/storage/emulated/0) android looks for pak files?
> 
> I think the question is, where should we copy the pak so that android can find
> it?
> 
> Then we could add a copy rule to components_unittests target for the
> repack_components_pak action.
> 
> Does this make any sense?
> 
> (I hope I'm not suggesting anything non plausible).

I don't think that's right. I still think it's an issue with the test binary.
paks are copied to /storage/emulated/legacy/paks as part of the test. You don't
need a copy rule as other targets dont' either, and this is about pushing the
pak files to the device and not out dir. Also, the test runner already pushes
these pak files to the device as it does with all other unit test binaries for
android

Powered by Google App Engine
This is Rietveld 408576698