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

Issue 145293007: ui: No more TestCompositor. Use NullDraw contexts in unit tests. (Closed)

Created:
6 years, 10 months ago by danakj
Modified:
6 years, 9 months ago
CC:
chromium-reviews, sadrul, yusukes+watch_chromium.org, yoshiki+watch_chromium.org, sievers+watch_chromium.org, yukishiino+watch_chromium.org, dmazzoni+watch_chromium.org, ben+aura_chromium.org, miu+watch_chromium.org, jbauman+watch_chromium.org, aboxhall+watch_chromium.org, jam, joi+watch-content_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, kalyank, fischman+watch_chromium.org, penghuang+watch_chromium.org, yuzo+watch_chromium.org, feature-media-reviews_chromium.org, piman+watch_chromium.org, cc-bugs_chromium.org, plundblad+watch_chromium.org, Ian Vollick, tfarina, mcasas+watch_chromium.org, dtseng+watch_chromium.org, danakj+watch_chromium.org, James Su, wjia+watch_chromium.org, ben+ash_chromium.org, enne (OOO)
Visibility:
Public.

Description

ui: No more TestCompositor. Use NullDraw contexts in unit tests. This CL removes the concept of the TestCompositor entirely, removing the TestContextFactory and the --disable-test-compositor flag. Now unit tests that use the compositor will use an in process context with OSMesa bindings, and the draw methods stubbed out (ie NullDraw GL bindings). This change allows the NullDraw bindings to be disabled for individual tests that require pixel output by instantiating a scoped gfx::DisableNullDrawGLBindings object. The command line flag is replaced by --enable-pixel-output-in-tests which forces all tests to produce pixel output for debugging purposes. This flag already existed for browser tests and has been extended to all tests that use ui::Compositor. The |allow_test_contexts| flag has been inverted to |enable_pixel_output|. The AuraTestHelper no longer sets up the ContextFactory. Some users of the test helper want to use ImageTransportFactory, which also sets up a ContextFactory, meaning we end up setting up 2 ContextFactories currently for those tests. The DCHECK() added to ContextFactory::SetInstance() caught this. So I've moved the ContextFactory setup from AuraTestHelper to each of its owners. Depends on: https://codereview.chromium.org/135213003/ R=piman,ben BUG=270918

Patch Set 1 #

Patch Set 2 : testsnulldraw: #

Total comments: 5

Patch Set 3 : testsnulldraw: host #

Patch Set 4 : testsnulldraw: rebase #

Patch Set 5 : testsnulldraw: rebase #

Patch Set 6 : testsnulldraw: removeheader #

Patch Set 7 : testsnulldraw: rebase #

Patch Set 8 : testsnulldraw: unit_tests #

Patch Set 9 : testsnulldraw: glhelpertests #

Patch Set 10 : testsnulldraw: header #

Patch Set 11 : testsnulldraw: interactive_ui_tests #

Patch Set 12 : testsnulldraw: componentstests #

Patch Set 13 : testsnulldraw: applistandmessagecentertests #

Patch Set 14 : testsnulldraw: mac #

Patch Set 15 : testsnulldraw: mac #

Patch Set 16 : testsnulldraw: rebase #

Patch Set 17 : testsnulldraw: rebase #

Patch Set 18 : testsnulldraw: 1moretryjust1moretry #

Patch Set 19 : testsnulldraw: fixash2 #

Patch Set 20 : testsnulldraw: alltests #

Patch Set 21 : testsnulldraw: lastforsure #

Patch Set 22 : testsnulldraw: #

Patch Set 23 : testsnulldraw: #

Patch Set 24 : testsnulldraw: rebase #

Patch Set 25 : testsnulldraw: rebase #

Patch Set 26 : testsnulldraw: #

Patch Set 27 : testsnulldraw: #

Patch Set 28 : testsnulldraw: #

Patch Set 29 : testsnulldraw: #

Patch Set 30 : testsnulldraw: #

Patch Set 31 : testsnulldraw: #

Patch Set 32 : testsnulldraw: #

Patch Set 33 : testsnulldraw: unit_tests #

Patch Set 34 : testsnulldraw: #

Patch Set 35 : testsnulldraw: #

Patch Set 36 : testsnulldraw: #

Patch Set 37 : testsnulldraw: #

Patch Set 38 : testsnulldraw: head^ #

Patch Set 39 : testsnulldraw: #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -148 lines) Patch
M ui/compositor/compositor.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 31 1 chunk +0 lines, -2 lines 0 comments Download
M ui/compositor/compositor_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 31 1 chunk +0 lines, -1 line 0 comments Download
M ui/compositor/compositor_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 31 33 1 chunk +0 lines, -2 lines 0 comments Download
M ui/compositor/test/context_factories_for_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 31 2 chunks +2 lines, -29 lines 0 comments Download
D ui/compositor/test/test_context_factory.h View 1 chunk +0 lines, -45 lines 0 comments Download
D ui/compositor/test/test_context_factory.cc View 1 chunk +0 lines, -66 lines 0 comments Download
M ui/gl/gl_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
danakj
6 years, 10 months ago (2014-01-29 01:23:33 UTC) #1
danakj
https://codereview.chromium.org/145293007/diff/20001/content/browser/compositor/image_transport_factory.cc File content/browser/compositor/image_transport_factory.cc (right): https://codereview.chromium.org/145293007/diff/20001/content/browser/compositor/image_transport_factory.cc#newcode39 content/browser/compositor/image_transport_factory.cc:39: g_disable_null_draw = new gfx::DisableNullDrawGLBindings; This is duplicated with the ...
6 years, 10 months ago (2014-01-29 01:28:21 UTC) #2
piman
lgtm https://codereview.chromium.org/145293007/diff/20001/ui/compositor/layer_unittest.cc File ui/compositor/layer_unittest.cc (right): https://codereview.chromium.org/145293007/diff/20001/ui/compositor/layer_unittest.cc#newcode362 ui/compositor/layer_unittest.cc:362: window_.reset(TestCompositorHost::Create(host_bounds)); nit: s/window_/compositor_host_/ ? https://codereview.chromium.org/145293007/diff/20001/ui/gl/gl_implementation.h File ui/gl/gl_implementation.h (right): ...
6 years, 10 months ago (2014-01-29 01:40:16 UTC) #3
danakj
+ben for ui/ ash/ and chrome/ https://codereview.chromium.org/145293007/diff/20001/ui/compositor/layer_unittest.cc File ui/compositor/layer_unittest.cc (right): https://codereview.chromium.org/145293007/diff/20001/ui/compositor/layer_unittest.cc#newcode362 ui/compositor/layer_unittest.cc:362: window_.reset(TestCompositorHost::Create(host_bounds)); On 2014/01/29 ...
6 years, 10 months ago (2014-01-29 20:18:59 UTC) #4
danakj
+ben for ui/ ash/ and chrome/
6 years, 10 months ago (2014-01-29 20:20:21 UTC) #5
Ben Goodger (Google)
ui, ash, chrome lgtm
6 years, 10 months ago (2014-01-29 20:56:30 UTC) #6
danakj
6 years, 9 months ago (2014-03-03 18:19:07 UTC) #7
I've got this entire CL split out into other CLs, so closing this.

Powered by Google App Engine
This is Rietveld 408576698