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

Issue 285293004: Allow browser tests to run with dynamic CLD data. (Closed)

Created:
6 years, 7 months ago by Andrew Hayden (chromium.org)
Modified:
6 years, 7 months ago
CC:
chromium-reviews, waffles
Base URL:
https://chromium.googlesource.com/chromium/src.git@cld_uma
Visibility:
Public.

Description

Allow browser tests to run with dynamic CLD data. This patch makes it possible to enable dynamic mode on any platform without breaking all of the browser tests that rely upon translation functionality working properly. Basically, we copy a static version of the CLD data file into the place where it would be put by the dynamic data mechanism that has been built. This allows the browser to find it immediately, and tests can run as normal. Without this patch, all tests that rely directly or indirectly upon language detection will fail. BUG=367239 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271717

Patch Set 1 #

Total comments: 17

Patch Set 2 : Add all broken tests #

Patch Set 3 : Address comments, and all tests pass now. Hooray! #

Patch Set 4 : Break apart into chunks #

Patch Set 5 : Lint #

Patch Set 6 : Format #

Total comments: 25

Patch Set 7 : toyoshim@'s comments #

Total comments: 7

Patch Set 8 : Refactor tests to avoid the use of DCHECK #

Patch Set 9 : Add periods to comments #

Total comments: 10

Patch Set 10 : Address comments, compiled and verified in all 3 configurations #

Total comments: 1

Patch Set 11 : Add comment to .h file describing use as a test class member #

Patch Set 12 : Remove unnecessary OVERRIDE directive from Init() #

Total comments: 2

Patch Set 13 : Move GetInstalledPath into anonymous namespace #

Patch Set 14 : #ifdefs to make pedantic compiler happy #

Patch Set 15 : Make GetInstalledPath static, adjust unit test #

Patch Set 16 : Yet more #ifdefs for compiler cleanliness #

Unified diffs Side-by-side diffs Delta from patch set Stats (+248 lines, -9 lines) Patch
M chrome/browser/component_updater/cld_component_installer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/component_updater/cld_component_installer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/component_updater/test/cld_component_installer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
A chrome/browser/translate/translate_browser_test_utils.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +57 lines, -0 lines 0 comments Download
A chrome/browser/translate/translate_browser_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +168 lines, -0 lines 0 comments Download
M chrome/browser/translate/translate_tab_helper.h View 1 2 3 4 3 chunks +10 lines, -5 lines 0 comments Download
M chrome/browser/translate/translate_tab_helper.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
Sorin Jianu
Thank you Andrew! https://codereview.chromium.org/285293004/diff/1/chrome/browser/component_updater/cld_component_installer.cc File chrome/browser/component_updater/cld_component_installer.cc (right): https://codereview.chromium.org/285293004/diff/1/chrome/browser/component_updater/cld_component_installer.cc#newcode32 chrome/browser/component_updater/cld_component_installer.cc:32: static base::LazyInstance<base::Lock> cld_file_lock = LAZY_INSTANCE_INITIALIZER; Is ...
6 years, 7 months ago (2014-05-15 17:16:13 UTC) #1
Andrew Hayden (chromium.org)
Done, but give me a bit to upload a new rev. https://codereview.chromium.org/285293004/diff/1/chrome/browser/component_updater/cld_component_installer.cc File chrome/browser/component_updater/cld_component_installer.cc (right): ...
6 years, 7 months ago (2014-05-16 17:53:19 UTC) #2
Andrew Hayden (chromium.org)
Still needs a lint pass, that's next. But this compiles and runs, and all the ...
6 years, 7 months ago (2014-05-16 20:07:49 UTC) #3
Andrew Hayden (chromium.org)
So, one minor issue: The CLD2 data file is too large for the CQ. I've ...
6 years, 7 months ago (2014-05-19 11:37:43 UTC) #4
Andrew Hayden (chromium.org)
Split the review into multiple fragments: https://codereview.chromium.org/289313004 (test data): mcilroy@chromium.org (or anyone else) https://codereview.chromium.org/285293004 (test ...
6 years, 7 months ago (2014-05-19 12:29:22 UTC) #5
Andrew Hayden (chromium.org)
toyoshim: chrome/browser/translate/translate_browser_test_utils.cc chrome/browser/translate/translate_browser_test_utils.h chrome/browser/translate/translate_tab_helper.cc chrome/browser/translate/translate_tab_helper.h sorin: chrome/browser/component_updater/cld_component_installer.h
6 years, 7 months ago (2014-05-19 12:45:22 UTC) #6
Takashi Toyoshima
https://codereview.chromium.org/285293004/diff/100001/chrome/browser/component_updater/cld_component_installer.h File chrome/browser/component_updater/cld_component_installer.h (right): https://codereview.chromium.org/285293004/diff/100001/chrome/browser/component_updater/cld_component_installer.h#newcode56 chrome/browser/component_updater/cld_component_installer.h:56: static void SetLatestCldDataFile(const base::FilePath& path); Is there any reason ...
6 years, 7 months ago (2014-05-19 14:32:24 UTC) #7
Paweł Hajdan Jr.
https://codereview.chromium.org/285293004/diff/100001/chrome/browser/translate/translate_browser_test_utils.cc File chrome/browser/translate/translate_browser_test_utils.cc (right): https://codereview.chromium.org/285293004/diff/100001/chrome/browser/translate/translate_browser_test_utils.cc#newcode28 chrome/browser/translate/translate_browser_test_utils.cc:28: DCHECK(PathService::Get(chrome::DIR_TEST_DATA, &result)); Please don't use DCHECK for code with ...
6 years, 7 months ago (2014-05-19 15:06:55 UTC) #8
Andrew Hayden (chromium.org)
https://codereview.chromium.org/285293004/diff/100001/chrome/browser/translate/translate_browser_test_utils.cc File chrome/browser/translate/translate_browser_test_utils.cc (right): https://codereview.chromium.org/285293004/diff/100001/chrome/browser/translate/translate_browser_test_utils.cc#newcode32 chrome/browser/translate/translate_browser_test_utils.cc:32: base::FilePath GetStandaloneFileSource() { On 2014/05/19 14:32:24, Takashi Toyoshima (chromium) ...
6 years, 7 months ago (2014-05-19 15:14:20 UTC) #9
Takashi Toyoshima
Once DCHECK issues Pawel pointed are fixed, lgtm on translate/*. https://codereview.chromium.org/285293004/diff/100001/chrome/browser/component_updater/cld_component_installer.h File chrome/browser/component_updater/cld_component_installer.h (right): https://codereview.chromium.org/285293004/diff/100001/chrome/browser/component_updater/cld_component_installer.h#newcode56 ...
6 years, 7 months ago (2014-05-19 16:14:20 UTC) #10
Sorin Jianu
lgtm Thank you Andrew! https://codereview.chromium.org/285293004/diff/120001/chrome/browser/component_updater/cld_component_installer.h File chrome/browser/component_updater/cld_component_installer.h (right): https://codereview.chromium.org/285293004/diff/120001/chrome/browser/component_updater/cld_component_installer.h#newcode31 chrome/browser/component_updater/cld_component_installer.h:31: friend class test::ScopedCLDDynamicDataHarness; // For ...
6 years, 7 months ago (2014-05-19 17:41:23 UTC) #11
Takashi Toyoshima
I think Paweł meant that "DCHECK(CheckSomething())" is ok, but "DCHECK(DoSomething());" is bad because DoSomething() may ...
6 years, 7 months ago (2014-05-19 18:12:54 UTC) #12
Sorin Jianu
Thank you! https://codereview.chromium.org/285293004/diff/160001/chrome/browser/translate/translate_browser_test_utils.cc File chrome/browser/translate/translate_browser_test_utils.cc (right): https://codereview.chromium.org/285293004/diff/160001/chrome/browser/translate/translate_browser_test_utils.cc#newcode34 chrome/browser/translate/translate_browser_test_utils.cc:34: ASSERT_NO_FATAL_FAILURE(GetTestDataSourceDirectory(out_path)); Are these the macros from gunit? ...
6 years, 7 months ago (2014-05-19 18:16:29 UTC) #13
msw
Driveby prompted by https://codereview.chromium.org/292723003. It'd be nice to avoid having to update individual tests or ...
6 years, 7 months ago (2014-05-19 18:54:48 UTC) #14
Andrew Hayden (chromium.org)
New patchset address all concerns raised, and I've confirmed that this compiles and appears to ...
6 years, 7 months ago (2014-05-19 20:54:01 UTC) #15
Sorin Jianu
lgtm Thank you! https://codereview.chromium.org/285293004/diff/180001/chrome/browser/translate/translate_browser_test_utils.h File chrome/browser/translate/translate_browser_test_utils.h (right): https://codereview.chromium.org/285293004/diff/180001/chrome/browser/translate/translate_browser_test_utils.h#newcode43 chrome/browser/translate/translate_browser_test_utils.h:43: void Init() OVERRIDE; Most likely, the ...
6 years, 7 months ago (2014-05-19 21:06:30 UTC) #16
Sorin Jianu
lgtm lgtm Thank you!
6 years, 7 months ago (2014-05-19 21:06:32 UTC) #17
msw
Thanks for addressing my nits/comments, I'll leave the rest of the review to the appropriate ...
6 years, 7 months ago (2014-05-19 21:19:17 UTC) #18
Takashi Toyoshima
Patch Set 12 still lgtm with one question. https://codereview.chromium.org/285293004/diff/220001/chrome/browser/component_updater/cld_component_installer.h File chrome/browser/component_updater/cld_component_installer.h (right): https://codereview.chromium.org/285293004/diff/220001/chrome/browser/component_updater/cld_component_installer.h#newcode56 chrome/browser/component_updater/cld_component_installer.h:56: static ...
6 years, 7 months ago (2014-05-20 00:33:03 UTC) #19
Andrew Hayden (chromium.org)
https://codereview.chromium.org/285293004/diff/220001/chrome/browser/component_updater/cld_component_installer.h File chrome/browser/component_updater/cld_component_installer.h (right): https://codereview.chromium.org/285293004/diff/220001/chrome/browser/component_updater/cld_component_installer.h#newcode56 chrome/browser/component_updater/cld_component_installer.h:56: static void SetLatestCldDataFile(const base::FilePath& path); On 2014/05/20 00:33:04, Takashi ...
6 years, 7 months ago (2014-05-20 10:20:01 UTC) #20
Andrew Hayden (chromium.org)
Fourteenth time's the charm. Buildbots running, hopefully this one we can land.
6 years, 7 months ago (2014-05-20 11:02:21 UTC) #21
Andrew Hayden (chromium.org)
On 2014/05/20 10:20:01, Andrew Hayden wrote: > https://codereview.chromium.org/285293004/diff/220001/chrome/browser/component_updater/cld_component_installer.h > File chrome/browser/component_updater/cld_component_installer.h (right): > > https://codereview.chromium.org/285293004/diff/220001/chrome/browser/component_updater/cld_component_installer.h#newcode56 ...
6 years, 7 months ago (2014-05-20 11:25:00 UTC) #22
Andrew Hayden (chromium.org)
Patchset 16 finally passes all the compilers on all OSes, so fingers crossed we're finally ...
6 years, 7 months ago (2014-05-20 15:43:38 UTC) #23
Andrew Hayden (chromium.org)
Patchset 16 finally passes all the compilers on all OSes, so fingers crossed we're finally ...
6 years, 7 months ago (2014-05-20 15:43:55 UTC) #24
Andrew Hayden (chromium.org)
The CQ bit was checked by andrewhayden@chromium.org
6 years, 7 months ago (2014-05-20 17:09:40 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/andrewhayden@chromium.org/285293004/300001
6 years, 7 months ago (2014-05-20 17:10:08 UTC) #26
commit-bot: I haz the power
6 years, 7 months ago (2014-05-20 18:37:55 UTC) #27
Message was sent while issue was closed.
Change committed as 271717

Powered by Google App Engine
This is Rietveld 408576698