summaryrefslogtreecommitdiffstats
path: root/cc/resource_update_controller_unittest.cc
diff options
context:
space:
mode:
authoraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 07:03:44 +0000
committeraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 07:03:44 +0000
commit61de581375ce3d76628772a78719cad63f0aabae (patch)
tree90e5818095cfa31182ceca09224c42d999644e4d /cc/resource_update_controller_unittest.cc
parentde8686ed05a28324b0978b2bb81cf3407f13762b (diff)
downloadchromium_src-61de581375ce3d76628772a78719cad63f0aabae.zip
chromium_src-61de581375ce3d76628772a78719cad63f0aabae.tar.gz
chromium_src-61de581375ce3d76628772a78719cad63f0aabae.tar.bz2
Remove static thread pointers from CC, attempt 3
BUG=152904 Review URL: https://chromiumcodereview.appspot.com/11232051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166627 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resource_update_controller_unittest.cc')
-rw-r--r--cc/resource_update_controller_unittest.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/cc/resource_update_controller_unittest.cc b/cc/resource_update_controller_unittest.cc
index cf58a11..2bb9ff8 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(