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

Side by Side Diff: cc/layers/nine_patch_layer_unittest.cc

Issue 2331983002: cc: Make LayerTreeHost a protected Layer member. (Closed)
Patch Set: settings Created 4 years, 3 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
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/layers/painted_scrollbar_layer_unittest.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/layers/nine_patch_layer.h" 5 #include "cc/layers/nine_patch_layer.h"
6 6
7 #include "cc/resources/resource_provider.h" 7 #include "cc/resources/resource_provider.h"
8 #include "cc/resources/scoped_ui_resource.h" 8 #include "cc/resources/scoped_ui_resource.h"
9 #include "cc/test/fake_layer_tree_host.h" 9 #include "cc/test/fake_layer_tree_host.h"
10 #include "cc/test/fake_layer_tree_host_client.h" 10 #include "cc/test/fake_layer_tree_host_client.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 }; 43 };
44 44
45 TEST_F(NinePatchLayerTest, SetLayerProperties) { 45 TEST_F(NinePatchLayerTest, SetLayerProperties) {
46 scoped_refptr<NinePatchLayer> test_layer = NinePatchLayer::Create(); 46 scoped_refptr<NinePatchLayer> test_layer = NinePatchLayer::Create();
47 ASSERT_TRUE(test_layer.get()); 47 ASSERT_TRUE(test_layer.get());
48 test_layer->SetIsDrawable(true); 48 test_layer->SetIsDrawable(true);
49 test_layer->SetBounds(gfx::Size(100, 100)); 49 test_layer->SetBounds(gfx::Size(100, 100));
50 50
51 layer_tree_host_->SetRootLayer(test_layer); 51 layer_tree_host_->SetRootLayer(test_layer);
52 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); 52 Mock::VerifyAndClearExpectations(layer_tree_host_.get());
53 EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); 53 EXPECT_EQ(test_layer->GetLayerTreeHostForTesting(), layer_tree_host_.get());
54 54
55 gfx::Rect screen_space_clip_rect; 55 gfx::Rect screen_space_clip_rect;
56 test_layer->SavePaintProperties(); 56 test_layer->SavePaintProperties();
57 test_layer->Update(); 57 test_layer->Update();
58 58
59 EXPECT_FALSE(test_layer->DrawsContent()); 59 EXPECT_FALSE(test_layer->DrawsContent());
60 60
61 bool is_opaque = false; 61 bool is_opaque = false;
62 std::unique_ptr<ScopedUIResource> resource = 62 std::unique_ptr<ScopedUIResource> resource =
63 ScopedUIResource::Create(layer_tree_host_->GetUIResourceManager(), 63 ScopedUIResource::Create(layer_tree_host_->GetUIResourceManager(),
64 UIResourceBitmap(gfx::Size(10, 10), is_opaque)); 64 UIResourceBitmap(gfx::Size(10, 10), is_opaque));
65 gfx::Rect aperture(5, 5, 1, 1); 65 gfx::Rect aperture(5, 5, 1, 1);
66 bool fill_center = true; 66 bool fill_center = true;
67 test_layer->SetAperture(aperture); 67 test_layer->SetAperture(aperture);
68 test_layer->SetUIResourceId(resource->id()); 68 test_layer->SetUIResourceId(resource->id());
69 test_layer->SetFillCenter(fill_center); 69 test_layer->SetFillCenter(fill_center);
70 test_layer->Update(); 70 test_layer->Update();
71 71
72 EXPECT_TRUE(test_layer->DrawsContent()); 72 EXPECT_TRUE(test_layer->DrawsContent());
73 } 73 }
74 74
75 } // namespace 75 } // namespace
76 } // namespace cc 76 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/layers/painted_scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698