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

Side by Side Diff: cc/layer_tree_host_unittest.cc

Issue 11348083: Revert 168095 - Merge 167537 - Use message passing for BeginFrameAndCommitState and clean up forced… (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "cc/layer_tree_host.h" 7 #include "cc/layer_tree_host.h"
8 8
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "cc/content_layer.h" 10 #include "cc/content_layer.h"
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 endTest(); 2510 endTest();
2511 } 2511 }
2512 2512
2513 virtual void afterTest() OVERRIDE 2513 virtual void afterTest() OVERRIDE
2514 { 2514 {
2515 } 2515 }
2516 }; 2516 };
2517 2517
2518 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestCompositeAndReadbackCleanup) 2518 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestCompositeAndReadbackCleanup)
2519 2519
2520 class LayerTreeHostTestCompositeAndReadbackAnimateCount : public LayerTreeHostTe st {
2521 public:
2522 LayerTreeHostTestCompositeAndReadbackAnimateCount()
2523 : m_layoutCount(0)
2524 {
2525 }
2526
2527 virtual void animate(base::TimeTicks) OVERRIDE
2528 {
2529 // We shouldn't animate on the compositeAndReadback-forced commit, but w e should
2530 // for the setNeedsCommit-triggered commit.
2531 EXPECT_EQ(1, m_layoutCount);
2532 }
2533
2534 virtual void layout() OVERRIDE
2535 {
2536 m_layoutCount++;
2537 if (m_layoutCount == 2)
2538 endTest();
2539 }
2540
2541 virtual void beginTest() OVERRIDE
2542 {
2543 m_layerTreeHost->setNeedsCommit();
2544
2545 char pixels[4];
2546 m_layerTreeHost->compositeAndReadback(&pixels, gfx::Rect(0, 0, 1, 1));
2547 }
2548
2549 virtual void afterTest() OVERRIDE
2550 {
2551 }
2552
2553 private:
2554 int m_layoutCount;
2555 };
2556
2557 TEST_F(LayerTreeHostTestCompositeAndReadbackAnimateCount, runMultiThread)
2558 {
2559 runTest(true);
2560 }
2561
2562 class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit : public L ayerTreeHostTest { 2520 class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit : public L ayerTreeHostTest {
2563 public: 2521 public:
2564 LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit() 2522 LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit()
2565 : m_rootLayer(ContentLayerWithUpdateTracking::create(&m_mockDelegate)) 2523 : m_rootLayer(ContentLayerWithUpdateTracking::create(&m_mockDelegate))
2566 , m_surfaceLayer1(ContentLayerWithUpdateTracking::create(&m_mockDelegate )) 2524 , m_surfaceLayer1(ContentLayerWithUpdateTracking::create(&m_mockDelegate ))
2567 , m_replicaLayer1(ContentLayerWithUpdateTracking::create(&m_mockDelegate )) 2525 , m_replicaLayer1(ContentLayerWithUpdateTracking::create(&m_mockDelegate ))
2568 , m_surfaceLayer2(ContentLayerWithUpdateTracking::create(&m_mockDelegate )) 2526 , m_surfaceLayer2(ContentLayerWithUpdateTracking::create(&m_mockDelegate ))
2569 , m_replicaLayer2(ContentLayerWithUpdateTracking::create(&m_mockDelegate )) 2527 , m_replicaLayer2(ContentLayerWithUpdateTracking::create(&m_mockDelegate ))
2570 { 2528 {
2571 } 2529 }
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
3269 int m_numCommitsDeferred; 3227 int m_numCommitsDeferred;
3270 int m_numCompleteCommits; 3228 int m_numCompleteCommits;
3271 }; 3229 };
3272 3230
3273 TEST_F(LayerTreeHostTestDeferCommits, runMultiThread) 3231 TEST_F(LayerTreeHostTestDeferCommits, runMultiThread)
3274 { 3232 {
3275 runTest(true); 3233 runTest(true);
3276 } 3234 }
3277 3235
3278 } // namespace 3236 } // namespace
OLDNEW
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698