summaryrefslogtreecommitdiffstats
path: root/cc/resource_provider_unittest.cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-12 01:53:49 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-12 01:53:49 +0000
commitc8756fbeef2763cd62d7174d4e0253c51864fe7b (patch)
treeb9f200690c8420ea37a4652bb599ea3b91a9a1b3 /cc/resource_provider_unittest.cc
parente7cede117cf24104a57b6dd9c43e9c5f2a602063 (diff)
downloadchromium_src-c8756fbeef2763cd62d7174d4e0253c51864fe7b.zip
chromium_src-c8756fbeef2763cd62d7174d4e0253c51864fe7b.tar.gz
chromium_src-c8756fbeef2763cd62d7174d4e0253c51864fe7b.tar.bz2
Implement WebKit::WebUnitTestSupport::createLayerTreeViewForTesting()
This provides an implementation WebKit::WebUnitTestSupport::createLayerTreeViewForTesting() for webkit_unit_tests that want to instantiate compositing support and need initialization to succeed but do not need to actually render anything. Critically, this sort of view does not depend on any particular client or settings. This appears to be a lot of code, but it's actually a bit of movement and very little new code. The primary movement is extracting most of the test class cc/test/fake_web_graphics_context3d.h into cc/fake_web_graphics_context3d.h so that it can be exported to other modules as a regular class. This is necessary since webkit_unit_tests are in a different component and must use only the normally exported parts of the cc library. cc/test/test_web_graphics_context3d.h has all of the extra bells and whistles and assertions for cc_unittests. WebLayerTreeViewImplForTesting uses a very simple context and does not depend on an external client at all. This results in two subtle but very significant properties (which are the point of this whole exercise) - the unit tests no longer depend on WebLayerTreeViewClient or WebGraphicsContext3D at all. The entire notion of what the context type is now entirely hidden in the chromium side of the codebase and can be swapped out for something else (like gpu::GLES2Interface) without any further changes on the WebKit side. After this patch, the only remaining caller of WebCompositorSupport::createLayerTreeView in the WebKit tree is WebViewHost, which needs to instantiate a view that can render pixels (using mesa) for DumpRenderTree. I'll address that separately. BUG=175383 Review URL: https://codereview.chromium.org/12211110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resource_provider_unittest.cc')
-rw-r--r--cc/resource_provider_unittest.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/cc/resource_provider_unittest.cc b/cc/resource_provider_unittest.cc
index 8665bd5..2c28d02 100644
--- a/cc/resource_provider_unittest.cc
+++ b/cc/resource_provider_unittest.cc
@@ -9,7 +9,7 @@
#include "cc/scoped_ptr_deque.h"
#include "cc/scoped_ptr_hash_map.h"
#include "cc/test/fake_output_surface.h"
-#include "cc/test/fake_web_graphics_context_3d.h"
+#include "cc/test/test_web_graphics_context_3d.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -101,7 +101,7 @@ private:
base::hash_map<unsigned, unsigned> m_syncPointForMailbox;
};
-class ResourceProviderContext : public FakeWebGraphicsContext3D {
+class ResourceProviderContext : public TestWebGraphicsContext3D {
public:
static scoped_ptr<ResourceProviderContext> create(ContextSharedData* sharedData) { return make_scoped_ptr(new ResourceProviderContext(Attributes(), sharedData)); }
@@ -130,7 +130,7 @@ public:
virtual WebGLId createTexture()
{
- WebGLId id = FakeWebGraphicsContext3D::createTexture();
+ WebGLId id = TestWebGraphicsContext3D::createTexture();
m_textures.add(id, scoped_ptr<Texture>());
return id;
}
@@ -228,7 +228,7 @@ public:
protected:
ResourceProviderContext(const Attributes& attrs, ContextSharedData* sharedData)
- : FakeWebGraphicsContext3D(attrs)
+ : TestWebGraphicsContext3D(attrs)
, m_sharedData(sharedData)
, m_currentTexture(0)
, m_lastWaitedSyncPoint(0)
@@ -564,7 +564,7 @@ TEST_P(ResourceProviderTest, DeleteTransferredResources)
EXPECT_EQ(0u, childResourceProvider->numResources());
}
-class TextureStateTrackingContext : public FakeWebGraphicsContext3D {
+class TextureStateTrackingContext : public TestWebGraphicsContext3D {
public:
MOCK_METHOD2(bindTexture, void(WGC3Denum target, WebGLId texture));
MOCK_METHOD3(texParameteri, void(WGC3Denum target, WGC3Denum pname, WGC3Dint param));
@@ -650,7 +650,7 @@ TEST_P(ResourceProviderTest, ManagedResource)
Mock::VerifyAndClearExpectations(context);
}
-class AllocationTrackingContext3D : public FakeWebGraphicsContext3D {
+class AllocationTrackingContext3D : public TestWebGraphicsContext3D {
public:
MOCK_METHOD0(createTexture, WebGLId());
MOCK_METHOD1(deleteTexture, void(WebGLId texture_id));