Index: cc/resource_update_controller_unittest.cc |
diff --git a/cc/resource_update_controller_unittest.cc b/cc/resource_update_controller_unittest.cc |
index cf58a1105fb7cac151483ab5d96fa37331dfc9b2..2bb9ff8296c0bc243b9bbc16b6f72bc0930fb454 100644 |
--- a/cc/resource_update_controller_unittest.cc |
+++ b/cc/resource_update_controller_unittest.cc |
@@ -7,6 +7,7 @@ |
#include "cc/resource_update_controller.h" |
#include "cc/single_thread_proxy.h" // For DebugScopedSetImplThread |
+#include "cc/test/fake_proxy.h" |
#include "cc/test/fake_web_compositor_output_surface.h" |
#include "cc/test/fake_web_graphics_context_3d.h" |
#include "cc/test/scheduler_test_common.h" |
@@ -64,8 +65,9 @@ private: |
class ResourceUpdateControllerTest : public Test { |
public: |
ResourceUpdateControllerTest() |
- : m_queue(make_scoped_ptr(new ResourceUpdateQueue)) |
- , m_resourceManager(PrioritizedResourceManager::create(60*1024*1024, 1024, Renderer::ContentPool)) |
+ : m_proxy(scoped_ptr<Thread>(NULL)) |
+ , m_queue(make_scoped_ptr(new ResourceUpdateQueue)) |
+ , m_resourceManager(PrioritizedResourceManager::create(60*1024*1024, 1024, Renderer::ContentPool, &m_proxy)) |
, m_fullUploadCountExpected(0) |
, m_partialCountExpected(0) |
, m_totalUploadCountExpected(0) |
@@ -81,7 +83,7 @@ public: |
~ResourceUpdateControllerTest() |
{ |
DebugScopedSetImplThreadAndMainThreadBlocked |
- implThreadAndMainThreadBlocked; |
+ implThreadAndMainThreadBlocked(&m_proxy); |
m_resourceManager->clearAllMemory(m_resourceProvider.get()); |
} |
@@ -133,7 +135,6 @@ protected: |
} |
m_resourceManager->prioritizeTextures(); |
- DebugScopedSetImplThread implThread; |
m_resourceProvider = ResourceProvider::create(m_context.get()); |
} |
@@ -180,13 +181,14 @@ protected: |
void updateTextures() |
{ |
DebugScopedSetImplThreadAndMainThreadBlocked |
- implThreadAndMainThreadBlocked; |
+ implThreadAndMainThreadBlocked(&m_proxy); |
scoped_ptr<ResourceUpdateController> updateController = |
ResourceUpdateController::create( |
NULL, |
- Proxy::implThread(), |
+ m_proxy.implThread(), |
m_queue.Pass(), |
- m_resourceProvider.get()); |
+ m_resourceProvider.get(), |
+ m_proxy.hasImplThread()); |
updateController->finalize(); |
} |
@@ -197,6 +199,7 @@ protected: |
protected: |
// Classes required to interact and test the ResourceUpdateController |
+ FakeProxy m_proxy; |
scoped_ptr<GraphicsContext> m_context; |
scoped_ptr<ResourceProvider> m_resourceProvider; |
scoped_ptr<ResourceUpdateQueue> m_queue; |
@@ -364,7 +367,7 @@ public: |
protected: |
FakeResourceUpdateController(cc::ResourceUpdateControllerClient* client, cc::Thread* thread, scoped_ptr<ResourceUpdateQueue> queue, ResourceProvider* resourceProvider) |
- : cc::ResourceUpdateController(client, thread, queue.Pass(), resourceProvider) |
+ : cc::ResourceUpdateController(client, thread, queue.Pass(), resourceProvider, false) |
, m_updateMoreTexturesSize(0) { } |
base::TimeTicks m_now; |
@@ -389,7 +392,7 @@ TEST_F(ResourceUpdateControllerTest, UpdateMoreTextures) |
appendPartialUploadsToUpdateQueue(0); |
DebugScopedSetImplThreadAndMainThreadBlocked |
- implThreadAndMainThreadBlocked; |
+ implThreadAndMainThreadBlocked(&m_proxy); |
scoped_ptr<FakeResourceUpdateController> controller(FakeResourceUpdateController::create(&client, &thread, m_queue.Pass(), m_resourceProvider.get())); |
controller->setNow( |
@@ -436,7 +439,7 @@ TEST_F(ResourceUpdateControllerTest, NoMoreUpdates) |
appendPartialUploadsToUpdateQueue(0); |
DebugScopedSetImplThreadAndMainThreadBlocked |
- implThreadAndMainThreadBlocked; |
+ implThreadAndMainThreadBlocked(&m_proxy); |
scoped_ptr<FakeResourceUpdateController> controller(FakeResourceUpdateController::create(&client, &thread, m_queue.Pass(), m_resourceProvider.get())); |
controller->setNow( |
@@ -475,7 +478,7 @@ TEST_F(ResourceUpdateControllerTest, UpdatesCompleteInFiniteTime) |
appendPartialUploadsToUpdateQueue(0); |
DebugScopedSetImplThreadAndMainThreadBlocked |
- implThreadAndMainThreadBlocked; |
+ implThreadAndMainThreadBlocked(&m_proxy); |
scoped_ptr<FakeResourceUpdateController> controller(FakeResourceUpdateController::create(&client, &thread, m_queue.Pass(), m_resourceProvider.get())); |
controller->setNow( |