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

Side by Side Diff: cc/LayerChromiumTest.cpp

Issue 11099040: [cc] Store CCLayerImpls as scoped_ptrs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix cc unit tests Created 8 years, 2 months 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/LayerChromium.cpp ('k') | cc/ScrollbarLayerChromium.h » ('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 "LayerChromium.h" 7 #include "LayerChromium.h"
8 8
9 #include "CCGeometryTestUtils.h" 9 #include "CCGeometryTestUtils.h"
10 #include "CCKeyframedAnimationCurve.h" 10 #include "CCKeyframedAnimationCurve.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // Test properties that should call setNeedsDisplay and setNeedsCommit 514 // Test properties that should call setNeedsDisplay and setNeedsCommit
515 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setBounds(IntSize (5, 10))); 515 EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setBounds(IntSize (5, 10)));
516 EXPECT_TRUE(testLayer->needsDisplay()); 516 EXPECT_TRUE(testLayer->needsDisplay());
517 } 517 }
518 518
519 TEST_F(LayerChromiumTest, verifyPushPropertiesAccumulatesUpdateRect) 519 TEST_F(LayerChromiumTest, verifyPushPropertiesAccumulatesUpdateRect)
520 { 520 {
521 DebugScopedSetImplThread setImplThread; 521 DebugScopedSetImplThread setImplThread;
522 522
523 scoped_refptr<LayerChromium> testLayer = LayerChromium::create(); 523 scoped_refptr<LayerChromium> testLayer = LayerChromium::create();
524 OwnPtr<CCLayerImpl> implLayer = CCLayerImpl::create(1); 524 scoped_ptr<CCLayerImpl> implLayer = CCLayerImpl::create(1);
525 525
526 testLayer->setNeedsDisplayRect(FloatRect(FloatPoint::zero(), FloatSize(5, 5) )); 526 testLayer->setNeedsDisplayRect(FloatRect(FloatPoint::zero(), FloatSize(5, 5) ));
527 testLayer->pushPropertiesTo(implLayer.get()); 527 testLayer->pushPropertiesTo(implLayer.get());
528 EXPECT_FLOAT_RECT_EQ(FloatRect(FloatPoint::zero(), FloatSize(5, 5)), implLay er->updateRect()); 528 EXPECT_FLOAT_RECT_EQ(FloatRect(FloatPoint::zero(), FloatSize(5, 5)), implLay er->updateRect());
529 529
530 // The CCLayerImpl's updateRect should be accumulated here, since we did not do anything to clear it. 530 // The CCLayerImpl's updateRect should be accumulated here, since we did not do anything to clear it.
531 testLayer->setNeedsDisplayRect(FloatRect(FloatPoint(10, 10), FloatSize(5, 5) )); 531 testLayer->setNeedsDisplayRect(FloatRect(FloatPoint(10, 10), FloatSize(5, 5) ));
532 testLayer->pushPropertiesTo(implLayer.get()); 532 testLayer->pushPropertiesTo(implLayer.get());
533 EXPECT_FLOAT_RECT_EQ(FloatRect(FloatPoint::zero(), FloatSize(15, 15)), implL ayer->updateRect()); 533 EXPECT_FLOAT_RECT_EQ(FloatRect(FloatPoint::zero(), FloatSize(15, 15)), implL ayer->updateRect());
534 534
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 scoped_refptr<MockLayerChromium> layer(new MockLayerChromium); 838 scoped_refptr<MockLayerChromium> layer(new MockLayerChromium);
839 EXPECT_FALSE(layer->needsDisplay()); 839 EXPECT_FALSE(layer->needsDisplay());
840 layer->setBounds(IntSize(0, 10)); 840 layer->setBounds(IntSize(0, 10));
841 EXPECT_FALSE(layer->needsDisplay()); 841 EXPECT_FALSE(layer->needsDisplay());
842 layer->setBounds(IntSize(10, 10)); 842 layer->setBounds(IntSize(10, 10));
843 EXPECT_TRUE(layer->needsDisplay()); 843 EXPECT_TRUE(layer->needsDisplay());
844 } 844 }
845 845
846 846
847 } // namespace 847 } // namespace
OLDNEW
« no previous file with comments | « cc/LayerChromium.cpp ('k') | cc/ScrollbarLayerChromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698