| 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 "cc/resources/prioritized_resource_manager.h" | 7 #include "cc/resources/prioritized_resource_manager.h" |
| 8 #include "cc/test/fake_output_surface.h" | 8 #include "cc/test/fake_output_surface.h" |
| 9 #include "cc/test/fake_proxy.h" | 9 #include "cc/test/fake_proxy.h" |
| 10 #include "cc/test/scheduler_test_common.h" | 10 #include "cc/test/scheduler_test_common.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 ResourceUpdateControllerTest* test_; | 65 ResourceUpdateControllerTest* test_; |
| 66 bool support_shallow_flush_; | 66 bool support_shallow_flush_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class ResourceUpdateControllerTest : public Test { | 69 class ResourceUpdateControllerTest : public Test { |
| 70 public: | 70 public: |
| 71 ResourceUpdateControllerTest() | 71 ResourceUpdateControllerTest() |
| 72 : proxy_(scoped_ptr<Thread>(NULL)), | 72 : proxy_(scoped_ptr<Thread>(NULL)), |
| 73 queue_(make_scoped_ptr(new ResourceUpdateQueue)), | 73 queue_(make_scoped_ptr(new ResourceUpdateQueue)), |
| 74 resource_manager_(PrioritizedResourceManager::Create(&proxy_)), | 74 resource_manager_(PrioritizedResourceManager::Create(&proxy_)), |
| 75 query_results_available_(0), |
| 75 full_upload_count_expected_(0), | 76 full_upload_count_expected_(0), |
| 76 partial_count_expected_(0), | 77 partial_count_expected_(0), |
| 77 total_upload_count_expected_(0), | 78 total_upload_count_expected_(0), |
| 78 max_upload_count_per_update_(0), | 79 max_upload_count_per_update_(0), |
| 79 num_consecutive_flushes_(0), | 80 num_consecutive_flushes_(0), |
| 80 num_dangling_uploads_(0), | 81 num_dangling_uploads_(0), |
| 81 num_total_uploads_(0), | 82 num_total_uploads_(0), |
| 82 num_total_flushes_(0), | 83 num_total_flushes_(0) {} |
| 83 query_results_available_(0) {} | |
| 84 | 84 |
| 85 virtual ~ResourceUpdateControllerTest() { | 85 virtual ~ResourceUpdateControllerTest() { |
| 86 DebugScopedSetImplThreadAndMainThreadBlocked | 86 DebugScopedSetImplThreadAndMainThreadBlocked |
| 87 impl_thread_and_main_thread_blocked(&proxy_); | 87 impl_thread_and_main_thread_blocked(&proxy_); |
| 88 resource_manager_->ClearAllMemory(resource_provider_.get()); | 88 resource_manager_->ClearAllMemory(resource_provider_.get()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 public: | 91 public: |
| 92 void OnFlush() { | 92 void OnFlush() { |
| 93 // Check for back-to-back flushes. | 93 // Check for back-to-back flushes. |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 RunPendingTask(&thread, controller.get()); | 498 RunPendingTask(&thread, controller.get()); |
| 499 } | 499 } |
| 500 | 500 |
| 501 EXPECT_FALSE(thread.HasPendingTask()); | 501 EXPECT_FALSE(thread.HasPendingTask()); |
| 502 EXPECT_TRUE(client.ReadyToFinalizeCalled()); | 502 EXPECT_TRUE(client.ReadyToFinalizeCalled()); |
| 503 EXPECT_EQ(2, num_total_uploads_); | 503 EXPECT_EQ(2, num_total_uploads_); |
| 504 } | 504 } |
| 505 | 505 |
| 506 } // namespace | 506 } // namespace |
| 507 } // namespace cc | 507 } // namespace cc |
| OLD | NEW |