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

Unified Diff: cc/resource_update_controller_unittest.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 165064 Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: cc/resource_update_controller_unittest.cc
diff --git a/cc/resource_update_controller_unittest.cc b/cc/resource_update_controller_unittest.cc
index ca3c3b8a478b753f0a148c2968339c3b5d0bb9e1..18238a4a9800586677d6f4249f7a60db22be8991 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"
@@ -63,8 +64,9 @@ private:
class ResourceUpdateControllerTest : public Test {
public:
ResourceUpdateControllerTest()
- : m_queue(make_scoped_ptr(new ResourceUpdateQueue))
- , m_textureManager(PrioritizedTextureManager::create(60*1024*1024, 1024, Renderer::ContentPool))
+ : m_proxy(0)
+ , m_queue(make_scoped_ptr(new ResourceUpdateQueue))
+ , m_textureManager(PrioritizedTextureManager::create(60*1024*1024, 1024, Renderer::ContentPool, &m_proxy))
, m_fullUploadCountExpected(0)
, m_partialCountExpected(0)
, m_totalUploadCountExpected(0)
@@ -79,7 +81,7 @@ public:
~ResourceUpdateControllerTest()
{
DebugScopedSetImplThreadAndMainThreadBlocked
- implThreadAndMainThreadBlocked;
+ implThreadAndMainThreadBlocked(&m_proxy);
m_textureManager->clearAllMemory(m_resourceProvider.get());
}
@@ -122,7 +124,6 @@ protected:
}
m_textureManager->prioritizeTextures();
- DebugScopedSetImplThread implThread;
m_resourceProvider = ResourceProvider::create(m_context.get());
}
@@ -169,18 +170,20 @@ 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();
}
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;
@@ -340,7 +343,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;
@@ -365,7 +368,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(
@@ -411,7 +414,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(
@@ -451,7 +454,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(

Powered by Google App Engine
This is Rietveld 408576698