OLD | NEW |
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/resources/resource_update_controller.h" | 5 #include "cc/resources/resource_update_controller.h" |
6 | 6 |
7 #include "base/test/test_simple_task_runner.h" | 7 #include "base/test/test_simple_task_runner.h" |
8 #include "cc/resources/prioritized_resource_manager.h" | 8 #include "cc/resources/prioritized_resource_manager.h" |
9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
10 #include "cc/test/fake_output_surface_client.h" | 10 #include "cc/test/fake_output_surface_client.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 bool IsQueryResultAvailable() { | 101 bool IsQueryResultAvailable() { |
102 if (!query_results_available_) | 102 if (!query_results_available_) |
103 return false; | 103 return false; |
104 | 104 |
105 query_results_available_--; | 105 query_results_available_--; |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 protected: | 109 protected: |
110 virtual void SetUp() { | 110 virtual void SetUp() { |
111 bitmap_.setConfig(SkBitmap::kARGB_8888_Config, 300, 150); | 111 bitmap_.allocN32Pixels(300, 150); |
112 bitmap_.allocPixels(); | |
113 | 112 |
114 for (int i = 0; i < 4; i++) { | 113 for (int i = 0; i < 4; i++) { |
115 textures_[i] = PrioritizedResource::Create(resource_manager_.get(), | 114 textures_[i] = PrioritizedResource::Create(resource_manager_.get(), |
116 gfx::Size(300, 150), | 115 gfx::Size(300, 150), |
117 RGBA_8888); | 116 RGBA_8888); |
118 textures_[i]-> | 117 textures_[i]-> |
119 set_request_priority(PriorityCalculator::VisiblePriority(true)); | 118 set_request_priority(PriorityCalculator::VisiblePriority(true)); |
120 } | 119 } |
121 resource_manager_->PrioritizeTextures(); | 120 resource_manager_->PrioritizeTextures(); |
122 | 121 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 RunPendingTask(task_runner.get(), controller.get()); | 503 RunPendingTask(task_runner.get(), controller.get()); |
505 } | 504 } |
506 | 505 |
507 EXPECT_FALSE(task_runner->HasPendingTask()); | 506 EXPECT_FALSE(task_runner->HasPendingTask()); |
508 EXPECT_TRUE(client.ReadyToFinalizeCalled()); | 507 EXPECT_TRUE(client.ReadyToFinalizeCalled()); |
509 EXPECT_EQ(2, num_total_uploads_); | 508 EXPECT_EQ(2, num_total_uploads_); |
510 } | 509 } |
511 | 510 |
512 } // namespace | 511 } // namespace |
513 } // namespace cc | 512 } // namespace cc |
OLD | NEW |