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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 bool IsQueryResultAvailable() { | 100 bool IsQueryResultAvailable() { |
101 if (!query_results_available_) | 101 if (!query_results_available_) |
102 return false; | 102 return false; |
103 | 103 |
104 query_results_available_--; | 104 query_results_available_--; |
105 return true; | 105 return true; |
106 } | 106 } |
107 | 107 |
108 protected: | 108 protected: |
109 virtual void SetUp() { | 109 virtual void SetUp() { |
110 bitmap_.setConfig(SkBitmap::kARGB_8888_Config, 300, 150); | 110 bitmap_.allocN32Pixels(300, 150); |
111 bitmap_.allocPixels(); | |
112 | 111 |
113 for (int i = 0; i < 4; i++) { | 112 for (int i = 0; i < 4; i++) { |
114 textures_[i] = PrioritizedResource::Create(resource_manager_.get(), | 113 textures_[i] = PrioritizedResource::Create(resource_manager_.get(), |
115 gfx::Size(300, 150), | 114 gfx::Size(300, 150), |
116 RGBA_8888); | 115 RGBA_8888); |
117 textures_[i]-> | 116 textures_[i]-> |
118 set_request_priority(PriorityCalculator::VisiblePriority(true)); | 117 set_request_priority(PriorityCalculator::VisiblePriority(true)); |
119 } | 118 } |
120 resource_manager_->PrioritizeTextures(); | 119 resource_manager_->PrioritizeTextures(); |
121 | 120 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 RunPendingTask(task_runner.get(), controller.get()); | 500 RunPendingTask(task_runner.get(), controller.get()); |
502 } | 501 } |
503 | 502 |
504 EXPECT_FALSE(task_runner->HasPendingTask()); | 503 EXPECT_FALSE(task_runner->HasPendingTask()); |
505 EXPECT_TRUE(client.ReadyToFinalizeCalled()); | 504 EXPECT_TRUE(client.ReadyToFinalizeCalled()); |
506 EXPECT_EQ(2, num_total_uploads_); | 505 EXPECT_EQ(2, num_total_uploads_); |
507 } | 506 } |
508 | 507 |
509 } // namespace | 508 } // namespace |
510 } // namespace cc | 509 } // namespace cc |
OLD | NEW |