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

Issue 2588403002: TestingPlatformSupport: register Platform instance correctly (Closed)

Created:
4 years ago by Takashi Toyoshima
Modified:
3 years, 11 months ago
Reviewers:
haraken, jbroman
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

TestingPlatformSupport: register Platform instance correctly Now, TestingPlatformSupport registers itself as the current Platform instance, but it is inside the constructor. On the other hand, a child class TestingPlatformSupportWithMockScheduler expects the parent class reigsters it for children. But, to register a Platform instance, virtual methods should be ready to call. Rephrasing it, we can not register a Platform instance correctly inside a super-class's constructor. This patch provides ScopedTestingPlatformSupport class template that manages TestingPlatformSupport instance and Platform instance installation. Without this patch, Platform::current()->mainThread() returns a wrong WebThread, and it makes new tests that I will add fail. BUG=n/a TEST=platform_blink_unittests, webkit_unit_tests Review-Url: https://codereview.chromium.org/2588403002 Cr-Commit-Position: refs/heads/master@{#443219} Committed: https://chromium.googlesource.com/chromium/src/+/f651acf25aaea54d6aed2488c8237214f1a2b38f

Patch Set 1 #

Patch Set 2 : wip: new plan #

Patch Set 3 : new plan #

Total comments: 9

Patch Set 4 : review #16 and merge master #

Total comments: 13

Patch Set 5 : review #22 #

Patch Set 6 : LocaleMacTest needed same caller side fix #

Total comments: 3

Patch Set 7 : new plan #

Total comments: 19

Patch Set 8 : review #32 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+485 lines, -170 lines) Patch
M third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp View 1 2 3 4 5 6 7 14 chunks +66 lines, -22 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceTest.cpp View 1 2 3 4 5 6 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp View 1 2 3 4 5 6 3 chunks +7 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThreadTest.cpp View 1 2 3 4 5 6 4 chunks +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp View 1 2 3 4 5 6 4 chunks +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp View 1 2 3 4 5 6 1 chunk +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp View 1 2 3 4 5 6 9 chunks +9 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/TimerTest.cpp View 1 2 3 4 5 6 7 27 chunks +244 lines, -82 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontCacheTest.cpp View 1 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp View 1 2 3 4 5 6 1 chunk +9 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp View 1 2 3 4 5 6 6 chunks +24 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollbarTestSuite.h View 1 2 3 4 5 6 1 chunk +3 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollbarThemeAuraTest.cpp View 1 2 3 4 5 6 3 chunks +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayTest.cpp View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h View 1 2 3 4 5 6 7 5 chunks +58 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp View 1 2 3 4 5 6 3 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/text/LocaleMacTest.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/weborigin/OriginAccessEntryTest.cpp View 1 2 3 4 5 6 7 chunks +14 lines, -14 lines 0 comments Download
M third_party/WebKit/public/platform/Platform.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 40 (21 generated)
Takashi Toyoshima
Can you take a look? I need this fix for the following core/fetch immigration. https://codereview.chromium.org/2584423002/
4 years ago (2016-12-20 13:51:34 UTC) #2
jbroman
It feels a bit hacky to call the register method repeatedly. WDYT of making mainThread() ...
4 years ago (2016-12-20 19:04:09 UTC) #3
Takashi Toyoshima
> WDYT of making mainThread() virtual (but I assume there's a reason it isn't -- ...
4 years ago (2016-12-21 05:46:11 UTC) #4
Takashi Toyoshima
> Another idea is to have static create() method and to make the constructor > ...
4 years ago (2016-12-21 09:38:35 UTC) #5
jbroman
On 2016/12/21 at 05:46:11, toyoshim wrote: > > WDYT of making mainThread() virtual (but I ...
4 years ago (2016-12-21 17:41:26 UTC) #6
jbroman
Ah, I see you had a similar idea between when I started writing this response ...
4 years ago (2016-12-21 17:42:38 UTC) #7
Takashi Toyoshima
thanks, I finished yesterday's new plan. Let me see if trybots being happy with this ...
4 years ago (2016-12-22 06:29:07 UTC) #10
Takashi Toyoshima
Description is also updated. Since trybots look happy, PTAL.
4 years ago (2016-12-22 07:45:14 UTC) #12
jbroman
lgtm with two comments https://codereview.chromium.org/2588403002/diff/40001/third_party/WebKit/Source/platform/testing/DEPS File third_party/WebKit/Source/platform/testing/DEPS (right): https://codereview.chromium.org/2588403002/diff/40001/third_party/WebKit/Source/platform/testing/DEPS#newcode7 third_party/WebKit/Source/platform/testing/DEPS:7: "+base/logging.h", On 2016/12/22 at 06:29:06, ...
4 years ago (2016-12-22 15:27:54 UTC) #16
Takashi Toyoshima
https://codereview.chromium.org/2588403002/diff/40001/third_party/WebKit/Source/platform/testing/DEPS File third_party/WebKit/Source/platform/testing/DEPS (right): https://codereview.chromium.org/2588403002/diff/40001/third_party/WebKit/Source/platform/testing/DEPS#newcode7 third_party/WebKit/Source/platform/testing/DEPS:7: "+base/logging.h", On 2016/12/22 15:27:54, jbroman wrote: > On 2016/12/22 ...
3 years, 11 months ago (2017-01-11 08:35:19 UTC) #17
Takashi Toyoshima
+haraken Could you put a stamp for non-functional changes in Platform.h and modules? Main modification ...
3 years, 11 months ago (2017-01-11 08:43:55 UTC) #19
haraken
https://codereview.chromium.org/2588403002/diff/60001/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h File third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h (right): https://codereview.chromium.org/2588403002/diff/60001/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h#newcode193 third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h:193: class ScopedTestingPlatformSupport { Add STACK_ALLOCATED. https://codereview.chromium.org/2588403002/diff/60001/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h#newcode193 third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h:193: class ScopedTestingPlatformSupport ...
3 years, 11 months ago (2017-01-11 08:58:08 UTC) #22
Takashi Toyoshima
https://codereview.chromium.org/2588403002/diff/60001/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h File third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h (right): https://codereview.chromium.org/2588403002/diff/60001/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h#newcode193 third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h:193: class ScopedTestingPlatformSupport { On 2017/01/11 08:58:08, haraken wrote: > ...
3 years, 11 months ago (2017-01-11 12:46:54 UTC) #25
haraken
https://codereview.chromium.org/2588403002/diff/60001/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp File third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp (right): https://codereview.chromium.org/2588403002/diff/60001/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp#newcode61 third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp:61: ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> Hmm. It looks a bit nasty to allocate ...
3 years, 11 months ago (2017-01-11 13:03:38 UTC) #28
Takashi Toyoshima
Can you review a new idea? There seems to be room for discussion if the ...
3 years, 11 months ago (2017-01-12 08:56:14 UTC) #31
haraken
LGTM https://codereview.chromium.org/2588403002/diff/120001/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp File third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp (right): https://codereview.chromium.org/2588403002/diff/120001/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp#newcode60 third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp:60: m_scriptRunner = ScriptRunner::create(m_document.get()); It might be slightly cleaner ...
3 years, 11 months ago (2017-01-12 11:21:01 UTC) #32
Takashi Toyoshima
https://codereview.chromium.org/2588403002/diff/120001/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp File third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp (right): https://codereview.chromium.org/2588403002/diff/120001/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp#newcode60 third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp:60: m_scriptRunner = ScriptRunner::create(m_document.get()); On 2017/01/12 11:21:00, haraken wrote: > ...
3 years, 11 months ago (2017-01-12 12:13:02 UTC) #33
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/2588403002/140001
3 years, 11 months ago (2017-01-12 12:15:16 UTC) #37
commit-bot: I haz the power
3 years, 11 months ago (2017-01-12 14:01:02 UTC) #40
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/f651acf25aaea54d6aed2488c823...

Powered by Google App Engine
This is Rietveld 408576698