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

Side by Side Diff: cc/resources/resource_update_controller_unittest.cc

Issue 17114008: cc: Remove cc::Thread and cc::ThreadImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-thread: NULLrefptrs Created 7 years, 6 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
« no previous file with comments | « cc/resources/prioritized_resource_unittest.cc ('k') | cc/scheduler/rate_limiter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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_proxy.h" 10 #include "cc/test/fake_proxy.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 WGC3Duint* value); 63 WGC3Duint* value);
64 64
65 private: 65 private:
66 ResourceUpdateControllerTest* test_; 66 ResourceUpdateControllerTest* test_;
67 bool support_shallow_flush_; 67 bool support_shallow_flush_;
68 }; 68 };
69 69
70 class ResourceUpdateControllerTest : public Test { 70 class ResourceUpdateControllerTest : public Test {
71 public: 71 public:
72 ResourceUpdateControllerTest() 72 ResourceUpdateControllerTest()
73 : proxy_(scoped_ptr<Thread>()), 73 : proxy_(),
74 queue_(make_scoped_ptr(new ResourceUpdateQueue)), 74 queue_(make_scoped_ptr(new ResourceUpdateQueue)),
75 resource_manager_(PrioritizedResourceManager::Create(&proxy_)), 75 resource_manager_(PrioritizedResourceManager::Create(&proxy_)),
76 query_results_available_(0), 76 query_results_available_(0),
77 full_upload_count_expected_(0), 77 full_upload_count_expected_(0),
78 partial_count_expected_(0), 78 partial_count_expected_(0),
79 total_upload_count_expected_(0), 79 total_upload_count_expected_(0),
80 max_upload_count_per_update_(0), 80 max_upload_count_per_update_(0),
81 num_consecutive_flushes_(0), 81 num_consecutive_flushes_(0),
82 num_dangling_uploads_(0), 82 num_dangling_uploads_(0),
83 num_total_uploads_(0), 83 num_total_uploads_(0),
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 void SetMaxUploadCountPerUpdate(int count) { 176 void SetMaxUploadCountPerUpdate(int count) {
177 max_upload_count_per_update_ = count; 177 max_upload_count_per_update_ = count;
178 } 178 }
179 179
180 void UpdateTextures() { 180 void UpdateTextures() {
181 DebugScopedSetImplThreadAndMainThreadBlocked 181 DebugScopedSetImplThreadAndMainThreadBlocked
182 impl_thread_and_main_thread_blocked(&proxy_); 182 impl_thread_and_main_thread_blocked(&proxy_);
183 scoped_ptr<ResourceUpdateController> update_controller = 183 scoped_ptr<ResourceUpdateController> update_controller =
184 ResourceUpdateController::Create(NULL, 184 ResourceUpdateController::Create(NULL,
185 NULL, 185 proxy_.ImplThreadTaskRunner(),
186 queue_.Pass(), 186 queue_.Pass(),
187 resource_provider_.get()); 187 resource_provider_.get());
188 update_controller->Finalize(); 188 update_controller->Finalize();
189 } 189 }
190 190
191 void MakeQueryResultAvailable() { query_results_available_++; } 191 void MakeQueryResultAvailable() { query_results_available_++; }
192 192
193 protected: 193 protected:
194 // Classes required to interact and test the ResourceUpdateController 194 // Classes required to interact and test the ResourceUpdateController
195 FakeProxy proxy_; 195 FakeProxy proxy_;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 RunPendingTask(task_runner.get(), controller.get()); 510 RunPendingTask(task_runner.get(), controller.get());
511 } 511 }
512 512
513 EXPECT_FALSE(task_runner->HasPendingTask()); 513 EXPECT_FALSE(task_runner->HasPendingTask());
514 EXPECT_TRUE(client.ReadyToFinalizeCalled()); 514 EXPECT_TRUE(client.ReadyToFinalizeCalled());
515 EXPECT_EQ(2, num_total_uploads_); 515 EXPECT_EQ(2, num_total_uploads_);
516 } 516 }
517 517
518 } // namespace 518 } // namespace
519 } // namespace cc 519 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/prioritized_resource_unittest.cc ('k') | cc/scheduler/rate_limiter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698