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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 new WebGraphicsContext3DForUploadTest(this))); | 123 new WebGraphicsContext3DForUploadTest(this))); |
124 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 124 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
125 | 125 |
126 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 126 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); |
127 resource_provider_ = ResourceProvider::Create(output_surface_.get(), | 127 resource_provider_ = ResourceProvider::Create(output_surface_.get(), |
128 shared_bitmap_manager_.get(), | 128 shared_bitmap_manager_.get(), |
129 NULL, | 129 NULL, |
130 NULL, | 130 NULL, |
131 0, | 131 0, |
132 false, | 132 false, |
133 1, | 133 1); |
134 false); | |
135 } | 134 } |
136 | 135 |
137 void AppendFullUploadsOfIndexedTextureToUpdateQueue(int count, | 136 void AppendFullUploadsOfIndexedTextureToUpdateQueue(int count, |
138 int texture_index) { | 137 int texture_index) { |
139 full_upload_count_expected_ += count; | 138 full_upload_count_expected_ += count; |
140 total_upload_count_expected_ += count; | 139 total_upload_count_expected_ += count; |
141 | 140 |
142 const gfx::Rect rect(0, 0, 300, 150); | 141 const gfx::Rect rect(0, 0, 300, 150); |
143 const ResourceUpdate upload = ResourceUpdate::Create( | 142 const ResourceUpdate upload = ResourceUpdate::Create( |
144 textures_[texture_index].get(), &bitmap_, rect, rect, gfx::Vector2d()); | 143 textures_[texture_index].get(), &bitmap_, rect, rect, gfx::Vector2d()); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 RunPendingTask(task_runner.get(), controller.get()); | 507 RunPendingTask(task_runner.get(), controller.get()); |
509 } | 508 } |
510 | 509 |
511 EXPECT_FALSE(task_runner->HasPendingTask()); | 510 EXPECT_FALSE(task_runner->HasPendingTask()); |
512 EXPECT_TRUE(client.ReadyToFinalizeCalled()); | 511 EXPECT_TRUE(client.ReadyToFinalizeCalled()); |
513 EXPECT_EQ(2, num_total_uploads_); | 512 EXPECT_EQ(2, num_total_uploads_); |
514 } | 513 } |
515 | 514 |
516 } // namespace | 515 } // namespace |
517 } // namespace cc | 516 } // namespace cc |
OLD | NEW |