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

Issue 11662003: cc: Put context-loss tests in layer_tree_host_unittest_context.cc (Closed)

Created:
8 years ago by danakj
Modified:
7 years, 11 months ago
Reviewers:
jamesr, enne (OOO)
CC:
chromium-reviews, cc-bugs_chromium.org, piman, backer
Visibility:
Public.

Description

cc: Put context-loss tests in layer_tree_host_unittest_context.cc These tests cover all of the cases covered by the context loss layout test and more. It also provides full coverage both in single-thread and multi-thread modes. I've moved tests from LayerTreeHostTests as usual, but also tests from LayerTreeHostImplTests, and implemented them using the real commit flow, instantiating layers by making the main thread versions of the layers, etc. This makes for a much more realistic test, and doesn't rely on as much internal compositor knowledge. While digging around, I found that the layersFreeTextures test was not testing anything. Then I also noticed that most of the layers in the test are not actually responsible to free their resources when they disappear. So I made the test do its job, and made the test just check layers that own resources - namely IOSurface and Video layers. Tests: LayerTreeHostContextTestLostContextSucceeds.runSingleThread LayerTreeHostContextTestLostContextSucceeds.runMultiThread LayerTreeHostContextTestLostContextSucceedsWithContent.NoSurface_SingleThread LayerTreeHostContextTestLostContextSucceedsWithContent.NoSurface_MultiThread LayerTreeHostContextTestLostContextSucceedsWithContent.WithSurface_SingleThread LayerTreeHostContextTestLostContextSucceedsWithContent.WithSurface_MultiThread LayerTreeHostContextTestLostContextFails.RepeatLoss100_SingleThread LayerTreeHostContextTestLostContextFails.RepeatLoss100_MultiThread LayerTreeHostContextTestLostContextFails.FailRecreate100_SingleThread LayerTreeHostContextTestLostContextFails.FailRecreate100_MultiThread LayerTreeHostContextTestFinishAllRenderingAfterLoss.runSingleThread LayerTreeHostContextTestFinishAllRenderingAfterLoss.runMultiThread LayerTreeHostContextTestLostContextAndEvictTextures.LoseAfterEvict_SingleThread LayerTreeHostContextTestLostContextAndEvictTextures.LoseAfterEvict_MultiThread LayerTreeHostContextTestLostContextAndEvictTextures.LoseBeforeEvict_SingleThread LayerTreeHostContextTestLostContextAndEvictTextures.LoseBeforeEvict_MultiThread LayerTreeHostContextTestLostContextWhileUpdatingResources.runSingleThread LayerTreeHostContextTestLostContextWhileUpdatingResources.runMultiThread LayerTreeHostContextTestLayersNotified.runSingleThread LayerTreeHostContextTestLayersNotified.runMultiThread LayerTreeHostContextTestDontUseLostResources.runSingleThread LayerTreeHostContextTestDontUseLostResources.runMultiThread Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175080

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : rebased #

Patch Set 4 : unused method #

Patch Set 5 : #

Total comments: 9

Patch Set 6 : comment #

Patch Set 7 : fix-tests #

Total comments: 10

Patch Set 8 : #

Patch Set 9 : rm macros #

Total comments: 2

Patch Set 10 : #

Patch Set 11 : 80cols #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1406 lines, -925 lines) Patch
M cc/cc_tests.gyp View 1 2 3 4 5 3 chunks +7 lines, -0 lines 0 comments Download
M cc/heads_up_display_layer.h View 1 chunk +2 lines, -1 line 0 comments Download
M cc/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 chunks +32 lines, -537 lines 0 comments Download
M cc/layer_tree_host_unittest.cc View 1 2 3 4 5 6 4 chunks +11 lines, -243 lines 0 comments Download
A cc/layer_tree_host_unittest_context.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +791 lines, -0 lines 0 comments Download
M cc/layer_tree_host_unittest_scroll.cc View 1 2 3 4 5 6 7 8 9 3 chunks +42 lines, -24 lines 0 comments Download
M cc/resource_provider_unittest.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M cc/scrollbar_layer_unittest.cc View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M cc/test/fake_content_layer.h View 2 chunks +9 lines, -4 lines 0 comments Download
M cc/test/fake_content_layer.cc View 3 chunks +13 lines, -0 lines 0 comments Download
A cc/test/fake_content_layer_impl.h View 1 2 3 4 5 6 7 1 chunk +38 lines, -0 lines 0 comments Download
A cc/test/fake_content_layer_impl.cc View 1 chunk +24 lines, -0 lines 0 comments Download
M cc/test/fake_scrollbar_layer.h View 1 2 3 4 5 6 2 chunks +4 lines, -3 lines 0 comments Download
M cc/test/fake_scrollbar_layer.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
A cc/test/fake_video_frame.h View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A cc/test/fake_video_frame.cc View 1 2 3 4 5 6 7 1 chunk +63 lines, -0 lines 0 comments Download
A cc/test/fake_video_frame_provider.h View 1 2 3 4 5 6 7 1 chunk +35 lines, -0 lines 0 comments Download
A cc/test/fake_video_frame_provider.cc View 1 chunk +25 lines, -0 lines 0 comments Download
M cc/test/fake_web_graphics_context_3d.h View 1 2 3 4 5 6 6 chunks +45 lines, -16 lines 0 comments Download
M cc/test/fake_web_graphics_context_3d.cc View 1 2 3 4 5 6 5 chunks +153 lines, -21 lines 0 comments Download
M cc/test/fake_web_scrollbar_theme_geometry.h View 1 2 3 4 5 6 2 chunks +5 lines, -1 line 0 comments Download
M cc/test/fake_web_scrollbar_theme_geometry.cc View 1 2 3 4 5 6 7 4 chunks +41 lines, -27 lines 0 comments Download
M cc/test/layer_tree_test_common.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -40 lines 0 comments Download
M cc/test/render_pass_test_common.cc View 1 2 3 4 5 4 chunks +9 lines, -3 lines 0 comments Download
M cc/tiled_layer.h View 1 chunk +2 lines, -0 lines 0 comments Download
M cc/tiled_layer.cc View 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
danakj
8 years ago (2012-12-21 05:36:06 UTC) #1
danakj
My intention is to land this and then remove the context lost layout tests, and ...
8 years ago (2012-12-21 05:36:54 UTC) #2
enne (OOO)
https://codereview.chromium.org/11662003/diff/8001/cc/test/fake_video_frame.h File cc/test/fake_video_frame.h (right): https://codereview.chromium.org/11662003/diff/8001/cc/test/fake_video_frame.h#newcode9 cc/test/fake_video_frame.h:9: #include "third_party/WebKit/Source/Platform/chromium/public/WebVideoFrame.h" Hmmmmmm. Because of this include, should fake ...
7 years, 11 months ago (2013-01-02 20:30:39 UTC) #3
danakj
https://codereview.chromium.org/11662003/diff/8001/cc/test/fake_video_frame.h File cc/test/fake_video_frame.h (right): https://codereview.chromium.org/11662003/diff/8001/cc/test/fake_video_frame.h#newcode9 cc/test/fake_video_frame.h:9: #include "third_party/WebKit/Source/Platform/chromium/public/WebVideoFrame.h" On 2013/01/02 20:30:39, enne wrote: > Hmmmmmm. ...
7 years, 11 months ago (2013-01-02 20:45:00 UTC) #4
danakj
https://codereview.chromium.org/11662003/diff/8001/cc/tiled_layer.h File cc/tiled_layer.h (right): https://codereview.chromium.org/11662003/diff/8001/cc/tiled_layer.h#newcode69 cc/tiled_layer.h:69: const PrioritizedResource* resourceAtForTesting(int, int) const; On 2013/01/02 20:45:00, danakj ...
7 years, 11 months ago (2013-01-02 20:46:19 UTC) #5
jamesr
On 2013/01/02 20:45:00, danakj wrote: > https://codereview.chromium.org/11662003/diff/8001/cc/test/fake_video_frame.h > File cc/test/fake_video_frame.h (right): > > https://codereview.chromium.org/11662003/diff/8001/cc/test/fake_video_frame.h#newcode9 > ...
7 years, 11 months ago (2013-01-02 21:30:18 UTC) #6
danakj
Giving the scrollbar theme geometry a thumb caused an extra texture in the atomic commit ...
7 years, 11 months ago (2013-01-03 16:06:44 UTC) #7
danakj
On Wed, Jan 2, 2013 at 4:30 PM, <jamesr@chromium.org> wrote: > There was some migration ...
7 years, 11 months ago (2013-01-03 16:07:55 UTC) #8
jamesr
I think the naming here is odd - unit tests should always end with _unittest.cc ...
7 years, 11 months ago (2013-01-03 21:30:08 UTC) #9
danakj
On 2013/01/03 21:30:08, jamesr wrote: > I think the naming here is odd - unit ...
7 years, 11 months ago (2013-01-03 21:49:10 UTC) #10
jamesr
On 2013/01/03 21:49:10, danakj wrote: > Okay.. My goal here was to minimize the number ...
7 years, 11 months ago (2013-01-03 21:52:13 UTC) #11
danakj
Comments addressed except the macros/filename, pending your reply. https://codereview.chromium.org/11662003/diff/20001/cc/test/fake_content_layer_impl.h File cc/test/fake_content_layer_impl.h (right): https://codereview.chromium.org/11662003/diff/20001/cc/test/fake_content_layer_impl.h#newcode24 cc/test/fake_content_layer_impl.h:24: return ...
7 years, 11 months ago (2013-01-03 21:52:20 UTC) #12
danakj
Removed the macros. PTAL
7 years, 11 months ago (2013-01-03 22:30:38 UTC) #13
jamesr
https://codereview.chromium.org/11662003/diff/22003/cc/layer_tree_host_unittest_context.cc File cc/layer_tree_host_unittest_context.cc (right): https://codereview.chromium.org/11662003/diff/22003/cc/layer_tree_host_unittest_context.cc#newcode187 cc/layer_tree_host_unittest_context.cc:187: template<bool kUseSurface> Why the template? Code inside a TEST_F ...
7 years, 11 months ago (2013-01-03 22:59:07 UTC) #14
danakj
OK, this is without templates. PTAL
7 years, 11 months ago (2013-01-03 23:13:32 UTC) #15
jamesr
lgtm
7 years, 11 months ago (2013-01-03 23:28:33 UTC) #16
jamesr
lgtm lgtm
7 years, 11 months ago (2013-01-03 23:28:34 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/11662003/20003
7 years, 11 months ago (2013-01-03 23:28:56 UTC) #18
commit-bot: I haz the power
7 years, 11 months ago (2013-01-04 02:08:14 UTC) #19
Message was sent while issue was closed.
Change committed as 175080

Powered by Google App Engine
This is Rietveld 408576698