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 "CCLayerTreeHost.h" | 7 #include "CCLayerTreeHost.h" |
8 | 8 |
9 #include "CCGraphicsContext.h" | 9 #include "CCGraphicsContext.h" |
10 #include "CCLayerTreeHostImpl.h" | 10 #include "CCLayerTreeHostImpl.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 490 } |
491 | 491 |
492 private: | 492 private: |
493 }; | 493 }; |
494 | 494 |
495 TEST_F(CCLayerTreeHostTestAbortFrameWhenInvisible, runMultiThread) | 495 TEST_F(CCLayerTreeHostTestAbortFrameWhenInvisible, runMultiThread) |
496 { | 496 { |
497 runTest(true); | 497 runTest(true); |
498 } | 498 } |
499 | 499 |
| 500 // Makes sure that setNedsAnimate does not cause the commitRequested() state to
be set. |
| 501 class CCLayerTreeHostTestSetNeedsAnimateShouldNotSetCommitRequested : public CCL
ayerTreeHostTest { |
| 502 public: |
| 503 CCLayerTreeHostTestSetNeedsAnimateShouldNotSetCommitRequested() |
| 504 : m_numCommits(0) |
| 505 { |
| 506 } |
| 507 |
| 508 virtual void beginTest() OVERRIDE |
| 509 { |
| 510 // The tests start up with a commit pending because we give them a root
layer. |
| 511 // We need to wait for the commit to happen before doing anything. |
| 512 EXPECT_TRUE(m_layerTreeHost->commitRequested()); |
| 513 } |
| 514 |
| 515 virtual void animate(double monotonicTime) OVERRIDE |
| 516 { |
| 517 // We skip the first commit becasue its the commit that populates the |
| 518 // impl thread with a tree. |
| 519 if (!m_numCommits) |
| 520 return; |
| 521 |
| 522 m_layerTreeHost->setNeedsAnimate(); |
| 523 // Right now, commitRequested is going to be true, because during |
| 524 // beginFrame, we force commitRequested to true to prevent requests from |
| 525 // hitting the impl thread. But, when the next didCommit happens, we sho
uld |
| 526 // verify that commitRequested has gone back to false. |
| 527 } |
| 528 virtual void didCommit() OVERRIDE |
| 529 { |
| 530 if (!m_numCommits) { |
| 531 EXPECT_FALSE(m_layerTreeHost->commitRequested()); |
| 532 m_layerTreeHost->setNeedsAnimate(); |
| 533 EXPECT_FALSE(m_layerTreeHost->commitRequested()); |
| 534 m_numCommits++; |
| 535 } |
| 536 |
| 537 // Verifies that the setNeedsAnimate we made in ::animate did not |
| 538 // trigger commitRequested. |
| 539 EXPECT_FALSE(m_layerTreeHost->commitRequested()); |
| 540 endTest(); |
| 541 } |
| 542 |
| 543 virtual void afterTest() OVERRIDE |
| 544 { |
| 545 } |
| 546 |
| 547 private: |
| 548 int m_numCommits; |
| 549 }; |
| 550 |
| 551 TEST_F(CCLayerTreeHostTestSetNeedsAnimateShouldNotSetCommitRequested, runMultiTh
read) |
| 552 { |
| 553 runTest(true); |
| 554 } |
| 555 |
500 | 556 |
| 557 |
501 // Trigger a frame with setNeedsCommit. Then, inside the resulting animate | 558 // Trigger a frame with setNeedsCommit. Then, inside the resulting animate |
502 // callback, requet another frame using setNeedsAnimate. End the test when | 559 // callback, requet another frame using setNeedsAnimate. End the test when |
503 // animate gets called yet-again, indicating that the proxy is correctly | 560 // animate gets called yet-again, indicating that the proxy is correctly |
504 // handling the case where setNeedsAnimate() is called inside the begin frame | 561 // handling the case where setNeedsAnimate() is called inside the begin frame |
505 // flow. | 562 // flow. |
506 class CCLayerTreeHostTestSetNeedsAnimateInsideAnimationCallback : public CCLayer
TreeHostTest { | 563 class CCLayerTreeHostTestSetNeedsAnimateInsideAnimationCallback : public CCLayer
TreeHostTest { |
507 public: | 564 public: |
508 CCLayerTreeHostTestSetNeedsAnimateInsideAnimationCallback() | 565 CCLayerTreeHostTestSetNeedsAnimateInsideAnimationCallback() |
509 : m_numAnimates(0) | 566 : m_numAnimates(0) |
510 { | 567 { |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 { | 941 { |
885 EXPECT_EQ(1, m_scrolls); | 942 EXPECT_EQ(1, m_scrolls); |
886 } | 943 } |
887 private: | 944 private: |
888 IntPoint m_initialScroll; | 945 IntPoint m_initialScroll; |
889 IntPoint m_secondScroll; | 946 IntPoint m_secondScroll; |
890 IntSize m_scrollAmount; | 947 IntSize m_scrollAmount; |
891 int m_scrolls; | 948 int m_scrolls; |
892 }; | 949 }; |
893 | 950 |
894 TEST_F(CCLayerTreeHostTestScrollSimple, DISABLED_runMultiThread) | 951 TEST_F(CCLayerTreeHostTestScrollSimple, runMultiThread) |
895 { | 952 { |
896 runTest(true); | 953 runTest(true); |
897 } | 954 } |
898 | 955 |
899 class CCLayerTreeHostTestScrollMultipleRedraw : public CCLayerTreeHostTest { | 956 class CCLayerTreeHostTestScrollMultipleRedraw : public CCLayerTreeHostTest { |
900 public: | 957 public: |
901 CCLayerTreeHostTestScrollMultipleRedraw() | 958 CCLayerTreeHostTestScrollMultipleRedraw() |
902 : m_initialScroll(IntPoint(40, 10)) | 959 : m_initialScroll(IntPoint(40, 10)) |
903 , m_scrollAmount(-3, 17) | 960 , m_scrollAmount(-3, 17) |
904 , m_scrolls(0) | 961 , m_scrolls(0) |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2211 } | 2268 } |
2212 | 2269 |
2213 private: | 2270 private: |
2214 const IntSize m_scrollAmount; | 2271 const IntSize m_scrollAmount; |
2215 IntSize m_reportedScrollAmount; | 2272 IntSize m_reportedScrollAmount; |
2216 MockContentLayerDelegate m_mockDelegate; | 2273 MockContentLayerDelegate m_mockDelegate; |
2217 RefPtr<LayerChromium> m_childLayer; | 2274 RefPtr<LayerChromium> m_childLayer; |
2218 RefPtr<LayerChromium> m_rootScrollLayer; | 2275 RefPtr<LayerChromium> m_rootScrollLayer; |
2219 }; | 2276 }; |
2220 | 2277 |
2221 // https://bugs.webkit.org/show_bug.cgi?id=95358 | 2278 TEST_F(CCLayerTreeHostTestScrollChildLayer, runMultiThread) |
2222 TEST_F(CCLayerTreeHostTestScrollChildLayer, DISABLED_runMultiThread) | |
2223 { | 2279 { |
2224 runTest(true); | 2280 runTest(true); |
2225 } | 2281 } |
2226 | 2282 |
2227 class CCLayerTreeHostTestCompositeAndReadbackCleanup : public CCLayerTreeHostTes
t { | 2283 class CCLayerTreeHostTestCompositeAndReadbackCleanup : public CCLayerTreeHostTes
t { |
2228 public: | 2284 public: |
2229 CCLayerTreeHostTestCompositeAndReadbackCleanup() { } | 2285 CCLayerTreeHostTestCompositeAndReadbackCleanup() { } |
2230 | 2286 |
2231 virtual void beginTest() OVERRIDE | 2287 virtual void beginTest() OVERRIDE |
2232 { | 2288 { |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2754 int m_numChildren; | 2810 int m_numChildren; |
2755 Vector<RefPtr<ContentLayerChromiumWithUpdateTracking> > m_children; | 2811 Vector<RefPtr<ContentLayerChromiumWithUpdateTracking> > m_children; |
2756 }; | 2812 }; |
2757 | 2813 |
2758 TEST_F(CCLayerTreeHostTestLostContextWhileUpdatingResources, runMultiThread) | 2814 TEST_F(CCLayerTreeHostTestLostContextWhileUpdatingResources, runMultiThread) |
2759 { | 2815 { |
2760 runTest(true); | 2816 runTest(true); |
2761 } | 2817 } |
2762 | 2818 |
2763 } // namespace | 2819 } // namespace |
OLD | NEW |