OLD | NEW |
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 Loading... |
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, WebCore::IntRect(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 |
2520 class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit : public L
ayerTreeHostTest { | 2562 class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit : public L
ayerTreeHostTest { |
2521 public: | 2563 public: |
2522 LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit() | 2564 LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit() |
2523 : m_rootLayer(ContentLayerWithUpdateTracking::create(&m_mockDelegate)) | 2565 : m_rootLayer(ContentLayerWithUpdateTracking::create(&m_mockDelegate)) |
2524 , m_surfaceLayer1(ContentLayerWithUpdateTracking::create(&m_mockDelegate
)) | 2566 , m_surfaceLayer1(ContentLayerWithUpdateTracking::create(&m_mockDelegate
)) |
2525 , m_replicaLayer1(ContentLayerWithUpdateTracking::create(&m_mockDelegate
)) | 2567 , m_replicaLayer1(ContentLayerWithUpdateTracking::create(&m_mockDelegate
)) |
2526 , m_surfaceLayer2(ContentLayerWithUpdateTracking::create(&m_mockDelegate
)) | 2568 , m_surfaceLayer2(ContentLayerWithUpdateTracking::create(&m_mockDelegate
)) |
2527 , m_replicaLayer2(ContentLayerWithUpdateTracking::create(&m_mockDelegate
)) | 2569 , m_replicaLayer2(ContentLayerWithUpdateTracking::create(&m_mockDelegate
)) |
2528 { | 2570 { |
2529 } | 2571 } |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3227 int m_numCommitsDeferred; | 3269 int m_numCommitsDeferred; |
3228 int m_numCompleteCommits; | 3270 int m_numCompleteCommits; |
3229 }; | 3271 }; |
3230 | 3272 |
3231 TEST_F(LayerTreeHostTestDeferCommits, runMultiThread) | 3273 TEST_F(LayerTreeHostTestDeferCommits, runMultiThread) |
3232 { | 3274 { |
3233 runTest(true); | 3275 runTest(true); |
3234 } | 3276 } |
3235 | 3277 |
3236 } // namespace | 3278 } // namespace |
OLD | NEW |