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

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

Issue 348093004: Make cc output surface creation async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android compile fixes Created 6 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
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/prioritized_resource_manager.h" 7 #include "cc/resources/prioritized_resource_manager.h"
8 #include "cc/resources/resource_provider.h" 8 #include "cc/resources/resource_provider.h"
9 #include "cc/resources/resource_update_queue.h" 9 #include "cc/resources/resource_update_queue.h"
10 #include "cc/resources/scoped_ui_resource.h" 10 #include "cc/resources/scoped_ui_resource.h"
(...skipping 17 matching lines...) Expand all
28 28
29 namespace cc { 29 namespace cc {
30 namespace { 30 namespace {
31 31
32 class NinePatchLayerTest : public testing::Test { 32 class NinePatchLayerTest : public testing::Test {
33 public: 33 public:
34 NinePatchLayerTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} 34 NinePatchLayerTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {}
35 35
36 protected: 36 protected:
37 virtual void SetUp() { 37 virtual void SetUp() {
38 layer_tree_host_ = FakeLayerTreeHost::Create(); 38 layer_tree_host_ = FakeLayerTreeHost::Create(&fake_client_);
39 } 39 }
40 40
41 virtual void TearDown() { 41 virtual void TearDown() {
42 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); 42 Mock::VerifyAndClearExpectations(layer_tree_host_.get());
43 } 43 }
44 44
45 FakeLayerTreeHostClient fake_client_;
45 scoped_ptr<FakeLayerTreeHost> layer_tree_host_; 46 scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
46 FakeLayerTreeHostClient fake_client_;
47 }; 47 };
48 48
49 TEST_F(NinePatchLayerTest, SetLayerProperties) { 49 TEST_F(NinePatchLayerTest, SetLayerProperties) {
50 scoped_refptr<NinePatchLayer> test_layer = NinePatchLayer::Create(); 50 scoped_refptr<NinePatchLayer> test_layer = NinePatchLayer::Create();
51 ASSERT_TRUE(test_layer.get()); 51 ASSERT_TRUE(test_layer.get());
52 test_layer->SetIsDrawable(true); 52 test_layer->SetIsDrawable(true);
53 test_layer->SetBounds(gfx::Size(100, 100)); 53 test_layer->SetBounds(gfx::Size(100, 100));
54 54
55 layer_tree_host_->SetRootLayer(test_layer); 55 layer_tree_host_->SetRootLayer(test_layer);
56 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); 56 Mock::VerifyAndClearExpectations(layer_tree_host_.get());
(...skipping 15 matching lines...) Expand all
72 test_layer->SetAperture(aperture); 72 test_layer->SetAperture(aperture);
73 test_layer->SetUIResourceId(resource->id()); 73 test_layer->SetUIResourceId(resource->id());
74 test_layer->SetFillCenter(fill_center); 74 test_layer->SetFillCenter(fill_center);
75 test_layer->Update(&queue, &occlusion_tracker); 75 test_layer->Update(&queue, &occlusion_tracker);
76 76
77 EXPECT_TRUE(test_layer->DrawsContent()); 77 EXPECT_TRUE(test_layer->DrawsContent());
78 } 78 }
79 79
80 } // namespace 80 } // namespace
81 } // namespace cc 81 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698