|
|
Created:
6 years, 9 months ago by danakj Modified:
6 years, 9 months ago CC:
chromium-reviews, piman, Miguel Garcia Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionMove TranslateManager unit tests out of the browser_tests target.
These are unit tests so they should be in the unit_tests target. A
TODO says this did not work before, but they appear to pass as unit
tests now, so this is just a code move.
BUG=270918
R=droger@chromium.org, hajimehoshi@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255661
Patch Set 1 #Patch Set 2 : translatetests: #Patch Set 3 : translatetests: fixandroid #
Total comments: 2
Patch Set 4 : translatetests: #Patch Set 5 : translatetests: #
Total comments: 4
Patch Set 6 : translatetests: #Patch Set 7 : translatetests: Fix test clobbering #
Total comments: 8
Patch Set 8 : translatetests: nits #Patch Set 9 : translatetests: comment #
Messages
Total messages: 55 (0 generated)
-sky +hajimehoshi
+droger, miguelg (CC) Thank you for your refactoring! https://codereview.chromium.org/186063007/diff/40001/chrome/browser/translate... File chrome/browser/translate/translate_manager_unittest.cc (right): https://codereview.chromium.org/186063007/diff/40001/chrome/browser/translate... chrome/browser/translate/translate_manager_unittest.cc:93: #if !defined(OS_ANDROID) Is it possible to execute these tests on Android?
This does not look like a unittest of TranslateManager, but rather some kind of integration test. I'd rather have a different file name. Maybe translate_manager_render_view_host_unittest, to match the actual name of the tests?
https://codereview.chromium.org/186063007/diff/40001/chrome/browser/translate... File chrome/browser/translate/translate_manager_unittest.cc (right): https://codereview.chromium.org/186063007/diff/40001/chrome/browser/translate... chrome/browser/translate/translate_manager_unittest.cc:93: #if !defined(OS_ANDROID) On 2014/03/04 02:35:57, hajimehoshi wrote: > Is it possible to execute these tests on Android? No, RenderViewContextMenu does not get compiled into the android build. There may be other problems as well.
PTAL On Tue, Mar 4, 2014 at 4:00 AM, <droger@chromium.org> wrote: > This does not look like a unittest of TranslateManager, but rather some > kind of > integration test. > I'd rather have a different file name. > Maybe translate_manager_render_view_host_unittest, to match the actual > name of > the tests? > Sure, done. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On 2014/03/04 15:48:16, danakj wrote: > Sure, done. Thanks!
lgtm https://codereview.chromium.org/186063007/diff/90004/chrome/browser/translate... File chrome/browser/translate/translate_manager_render_view_host_unittest.cc (right): https://codereview.chromium.org/186063007/diff/90004/chrome/browser/translate... chrome/browser/translate/translate_manager_render_view_host_unittest.cc:5: #include "chrome/browser/translate/translate_manager.h" Nit: this should not be at the top.
https://codereview.chromium.org/186063007/diff/90004/chrome/browser/translate... File chrome/browser/translate/translate_manager_render_view_host_unittest.cc (right): https://codereview.chromium.org/186063007/diff/90004/chrome/browser/translate... chrome/browser/translate/translate_manager_render_view_host_unittest.cc:5: #include "chrome/browser/translate/translate_manager.h" On 2014/03/04 15:58:33, droger wrote: > Nit: this should not be at the top. I thought it should, since this file is testing the translate manager? "In dir/foo.cc or dir/foo_test.cc, whose main purpose is to implement or test the stuff in dir2/foo2.h, order your includes as follows: dir2/foo2.h (preferred location — see details below). C system files. C++ system files. Other libraries' .h files. Your project's .h files." http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Names_and_Orde...
https://codereview.chromium.org/186063007/diff/90004/chrome/browser/translate... File chrome/browser/translate/translate_manager_render_view_host_unittest.cc (right): https://codereview.chromium.org/186063007/diff/90004/chrome/browser/translate... chrome/browser/translate/translate_manager_render_view_host_unittest.cc:5: #include "chrome/browser/translate/translate_manager.h" My opinion is that this file is not testing the TranslateManager API (TranslateManager is almost not used in this file), and thus is not a unit test for TranslateManager. It is more of a general integration test for translate. I won't block the CL on this though
https://codereview.chromium.org/186063007/diff/90004/chrome/browser/translate... File chrome/browser/translate/translate_manager_render_view_host_unittest.cc (right): https://codereview.chromium.org/186063007/diff/90004/chrome/browser/translate... chrome/browser/translate/translate_manager_render_view_host_unittest.cc:5: #include "chrome/browser/translate/translate_manager.h" On 2014/03/04 16:10:25, droger wrote: > My opinion is that this file is not testing the TranslateManager API > (TranslateManager is almost not used in this file), and thus is not a unit test > for TranslateManager. > It is more of a general integration test for translate. > > I won't block the CL on this though OK, removed.
lgtm
Thanks!
The CQ bit was checked by danakj@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/110001
The CQ bit was unchecked by commit-bot@chromium.org
Retried try job too often on win_rel for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&nu...
InMemoryURLIndexTest.Retrieval keeps failing which is not one of the tests I moved, trying again.
The CQ bit was checked by danakj@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/110001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel
On 2014/03/04 21:22:32, I haz the power (commit-bot) wrote: > Try jobs failed on following builders: linux_chromium_rel That bot fails a different ComponentUpdaterPingManagerTest.PingManagerTest. Still trying again.
The CQ bit was checked by danakj@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/110001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel
The CQ bit was checked by phajdan.jr@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/110001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel
The CQ bit was checked by phajdan.jr@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/110001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel
Somehow these tests end up causing the ComponentUpdaterPingManagerTest.PingManagerTest test to crash: [ RUN ] ComponentUpdaterPingManagerTest.PingManagerTest [6207:6207:0304/190940:359764225816:FATAL:url_fetcher_core.cc(390)] Check failed: network_task_runner_->BelongsToCurrentThread(). [0x7f5fa11060ce] base::debug::StackTrace::StackTrace() [0x7f5fa1188e75] logging::LogMessage::~LogMessage() [0x7f5fa0b2ee65] net::URLFetcherCore::OnResponseStarted() [0x7f5fa0b414da] net::URLRequest::NotifyResponseStarted() Even if this test is run before the TranslateManager tests.
On 2014/03/05 00:16:21, danakj wrote: > Somehow these tests end up causing the > ComponentUpdaterPingManagerTest.PingManagerTest test to crash: > > [ RUN ] ComponentUpdaterPingManagerTest.PingManagerTest > [6207:6207:0304/190940:359764225816:FATAL:url_fetcher_core.cc(390)] Check > failed: network_task_runner_->BelongsToCurrentThread(). > [0x7f5fa11060ce] base::debug::StackTrace::StackTrace() > [0x7f5fa1188e75] logging::LogMessage::~LogMessage() > [0x7f5fa0b2ee65] net::URLFetcherCore::OnResponseStarted() > [0x7f5fa0b414da] net::URLRequest::NotifyResponseStarted() > > Even if this test is run before the TranslateManager tests. Looks like this test was broken before this CL, I can reproduce the same crash on trunk. Filed https://code.google.com/p/chromium/issues/detail?id=349547 about it.
The CQ bit was checked by danakj@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/110001
The CQ bit was unchecked by commit-bot@chromium.org
Retried try job too often on win for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win&number...
The CQ bit was checked by danakj@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/110001
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/110001
Message was sent while issue was closed.
Change committed as 255192
Reopening, looks like a test in here is not too flaky for the CQ, but is for the memory waterfall.
PTAL The latest patch resolves one test causing the next to fail by adding TranslateService::InitializeForTesting() and TranslateService::ShutdownForTesting(). Before one test causing TranslateDownloadManager::Shutdown() to happen meant that no other test could use the manager.
Does this problem happen only on unit tests? lgtm with nits https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... File chrome/browser/translate/translate_manager_render_view_host_unittest.cc (right): https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... chrome/browser/translate/translate_manager_render_view_host_unittest.cc:1: // Copyright (c) 2014 The Chromium Authors. All rights reserved. nits: no (c) https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... File chrome/browser/translate/translate_service.cc (right): https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... chrome/browser/translate/translate_service.cc:46: // This path is only used by tests. Can you change this comment? https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... chrome/browser/translate/translate_service.cc:53: if (!g_translate_service) nits: {}
lgtm
> Does this problem happen only on unit tests? AFAIK yes. This happens on unit tests because we run each test one after the other in the same process. Browser tests launch a full browser and tear it down, so the cleanup there is, I think, a bit more rigorous between tests. https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... File chrome/browser/translate/translate_manager_render_view_host_unittest.cc (right): https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... chrome/browser/translate/translate_manager_render_view_host_unittest.cc:1: // Copyright (c) 2014 The Chromium Authors. All rights reserved. On 2014/03/07 03:54:50, hajimehoshi wrote: > nits: no (c) Done. https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... File chrome/browser/translate/translate_service.cc (right): https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... chrome/browser/translate/translate_service.cc:46: // This path is only used by tests. On 2014/03/07 03:54:50, hajimehoshi wrote: > Can you change this comment? Sure, though I'm not sure what to change it to. I think this comment's truth is unaffected by this change. It's just used by a different set of tests (browser tests). Since we have high latency, I'll CQ this but I'm happy to land a followup to update the comment if you let me know what it should say. https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... chrome/browser/translate/translate_service.cc:53: if (!g_translate_service) On 2014/03/07 03:54:50, hajimehoshi wrote: > nits: {} oops, thanks. Done.
The CQ bit was checked by danakj@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/186063007/170001
https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... File chrome/browser/translate/translate_service.cc (right): https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... chrome/browser/translate/translate_service.cc:46: // This path is only used by tests. On 2014/03/07 16:29:53, danakj wrote: > On 2014/03/07 03:54:50, hajimehoshi wrote: > > Can you change this comment? > > Sure, though I'm not sure what to change it to. I think this comment's truth is > unaffected by this change. It's just used by a different set of tests (browser > tests). > > Since we have high latency, I'll CQ this but I'm happy to land a followup to > update the comment if you let me know what it should say. Sure. However, it might be confusing that this comment mentions 'test' while both Shutdown and ShutdownForTesting exist. How about s/by tests/by browser tests/ ?
https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... File chrome/browser/translate/translate_service.cc (right): https://codereview.chromium.org/186063007/diff/150001/chrome/browser/translat... chrome/browser/translate/translate_service.cc:46: // This path is only used by tests. On 2014/03/07 16:56:38, hajimehoshi wrote: > On 2014/03/07 16:29:53, danakj wrote: > > On 2014/03/07 03:54:50, hajimehoshi wrote: > > > Can you change this comment? > > > > Sure, though I'm not sure what to change it to. I think this comment's truth > is > > unaffected by this change. It's just used by a different set of tests (browser > > tests). > > > > Since we have high latency, I'll CQ this but I'm happy to land a followup to > > update the comment if you let me know what it should say. > > Sure. However, it might be confusing that this comment mentions 'test' while > both Shutdown and ShutdownForTesting exist. How about s/by tests/by browser > tests/ ? Got it!
Message was sent while issue was closed.
Committed patchset #9 manually as r255661 (presubmit successful). |