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

Issue 2860533002: Support base::test::ScopedTaskEnvironment and content::TestBrowserThreadBundle in the same scope. (Closed)

Created:
3 years, 7 months ago by fdoray
Modified:
3 years, 7 months ago
Reviewers:
robliao, gab, sky
CC:
chromium-reviews, jam, darin-cc_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Support base::test::ScopedTaskEnvironment and content::TestBrowserThreadBundle in the same scope. A test suite that depends on a test suite base that provides a base::test::ScopedTaskEnvironment may need browser threads. Currently, the test suite cannot use content::TestBrowserThreadBundle to get these browser threads because base::test::ScopedTaskEnvironment and content::TestBrowserThreadBundle both set the main MessageLoop and the TaskScheduler. With this CL, content::TestBrowserThreadBundle doesn't set the main MessageLoop and the TaskScheduler if they already exist. E.g. Test suite: ToolbarActionViewUnitTest Needs BrowserThreads Base test suite: views::ViewsTestBase Provides a ScopedTaskEnvironment BUG= Review-Url: https://codereview.chromium.org/2860533002 Cr-Original-Commit-Position: refs/heads/master@{#469304} Committed: https://chromium.googlesource.com/chromium/src/+/ba0dacfc73d208fc779907890bc94dbd09ef1aad Review-Url: https://codereview.chromium.org/2860533002 Cr-Commit-Position: refs/heads/master@{#470021} Committed: https://chromium.googlesource.com/chromium/src/+/8c5805290290f2e7749c27ee7ea005a980398947

Patch Set 1 #

Patch Set 2 : self-review #

Patch Set 3 : self-review #

Patch Set 4 : self-review #

Patch Set 5 : self-review #

Total comments: 12

Patch Set 6 : CR-gab #

Total comments: 2

Patch Set 7 : CR-gab-24 #

Patch Set 8 : remove check failed #

Patch Set 9 : remove check failed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -31 lines) Patch
M content/public/test/test_browser_thread_bundle.h View 1 2 3 4 5 6 7 1 chunk +9 lines, -0 lines 0 comments Download
M content/public/test/test_browser_thread_bundle.cc View 1 2 3 4 5 4 chunks +48 lines, -31 lines 0 comments Download
A content/public/test/test_browser_thread_bundle_unittest.cc View 1 2 3 4 5 6 7 1 chunk +35 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 51 (35 generated)
fdoray
3 years, 7 months ago (2017-05-02 20:52:19 UTC) #8
fdoray
3 years, 7 months ago (2017-05-02 20:52:19 UTC) #9
fdoray
PTAL
3 years, 7 months ago (2017-05-02 20:52:26 UTC) #11
gab
Also document this possibility in test_browser_thread_bundle.h's meta-comment https://codereview.chromium.org/2860533002/diff/70001/content/public/test/test_browser_thread_bundle.cc File content/public/test/test_browser_thread_bundle.cc (left): https://codereview.chromium.org/2860533002/diff/70001/content/public/test/test_browser_thread_bundle.cc#oldcode66 content/public/test/test_browser_thread_bundle.cc:66: CHECK(message_loop_->IsIdleForTesting()); Why ...
3 years, 7 months ago (2017-05-03 15:33:11 UTC) #20
fdoray
Please take another look https://codereview.chromium.org/2860533002/diff/70001/content/public/test/test_browser_thread_bundle.cc File content/public/test/test_browser_thread_bundle.cc (left): https://codereview.chromium.org/2860533002/diff/70001/content/public/test/test_browser_thread_bundle.cc#oldcode66 content/public/test/test_browser_thread_bundle.cc:66: CHECK(message_loop_->IsIdleForTesting()); On 2017/05/03 15:33:10, gab ...
3 years, 7 months ago (2017-05-03 17:03:50 UTC) #23
gab
lgtm w/ nit https://codereview.chromium.org/2860533002/diff/90001/content/public/test/test_browser_thread_bundle.h File content/public/test/test_browser_thread_bundle.h (right): https://codereview.chromium.org/2860533002/diff/90001/content/public/test/test_browser_thread_bundle.h#newcode58 content/public/test/test_browser_thread_bundle.h:58: // a ScopedTaskEnvironment. In that case, ...
3 years, 7 months ago (2017-05-03 17:44:41 UTC) #24
fdoray
https://codereview.chromium.org/2860533002/diff/90001/content/public/test/test_browser_thread_bundle.h File content/public/test/test_browser_thread_bundle.h (right): https://codereview.chromium.org/2860533002/diff/90001/content/public/test/test_browser_thread_bundle.h#newcode58 content/public/test/test_browser_thread_bundle.h:58: // a ScopedTaskEnvironment. In that case, it will use ...
3 years, 7 months ago (2017-05-03 17:59:57 UTC) #25
fdoray
sky@: PTAL
3 years, 7 months ago (2017-05-03 18:00:28 UTC) #27
sky
LGTM
3 years, 7 months ago (2017-05-04 03:54:31 UTC) #32
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/2860533002/110001
3 years, 7 months ago (2017-05-04 10:16:45 UTC) #35
commit-bot: I haz the power
Committed patchset #7 (id:110001) as https://chromium.googlesource.com/chromium/src/+/ba0dacfc73d208fc779907890bc94dbd09ef1aad
3 years, 7 months ago (2017-05-04 10:21:40 UTC) #38
Avi (use Gerrit)
A revert of this CL (patchset #7 id:110001) has been created in https://codereview.chromium.org/2859283002/ by avi@chromium.org. ...
3 years, 7 months ago (2017-05-04 19:10:56 UTC) #39
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/2860533002/130001
3 years, 7 months ago (2017-05-08 15:47:08 UTC) #43
fdoray
Relanding without expecting "Check failed" string in unit tests.
3 years, 7 months ago (2017-05-08 15:47:10 UTC) #44
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/2860533002/150001
3 years, 7 months ago (2017-05-08 15:48:58 UTC) #48
commit-bot: I haz the power
3 years, 7 months ago (2017-05-08 16:59:57 UTC) #51
Message was sent while issue was closed.
Committed patchset #9 (id:150001) as
https://chromium.googlesource.com/chromium/src/+/8c5805290290f2e7749c27ee7ea0...

Powered by Google App Engine
This is Rietveld 408576698