Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (127153 => 127154)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-08-30 17:04:35 UTC (rev 127154)
@@ -1,3 +1,52 @@
+2012-08-30 James Robinson <[email protected]>
+
+ [chromium] Clean up some webkit compositor unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=95410
+
+ Reviewed by Adrienne Walker.
+
+ This adds includes that were implicitly being picked up, removes ones that weren't being used, removes
+ dead code, adds OVERRIDE on functions that OVERRIDE, and deinlines virtuals that the chromium clang style
+ plugin is unhappy about.
+
+ * tests/CCAnimationTestCommon.cpp:
+ (WebKitTests::FakeFloatAnimationCurve::duration):
+ (WebKitTests):
+ (WebKitTests::FakeFloatAnimationCurve::getValue):
+ (WebKitTests::FakeTransformTransition::duration):
+ (WebKitTests::FakeFloatTransition::duration):
+ (WebKitTests::FakeLayerAnimationControllerClient::id):
+ (WebKitTests::FakeLayerAnimationControllerClient::setOpacityFromAnimation):
+ (WebKitTests::FakeLayerAnimationControllerClient::opacity):
+ (WebKitTests::FakeLayerAnimationControllerClient::setTransformFromAnimation):
+ (WebKitTests::FakeLayerAnimationControllerClient::transform):
+ * tests/CCAnimationTestCommon.h:
+ (FakeFloatAnimationCurve):
+ (FakeTransformTransition):
+ (FakeFloatTransition):
+ (FakeLayerAnimationControllerClient):
+ * tests/CCTiledLayerTestCommon.cpp:
+ (WebKitTests::FakeLayerTextureUpdater::sampledTexelFormat):
+ (WebKitTests):
+ (WebKitTests::FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds):
+ (WebKitTests::FakeTiledLayerChromium::textureManager):
+ (WebKitTests::FakeTiledLayerChromium::textureUpdater):
+ (WebKitTests::FakeTiledLayerWithScaledBounds::contentBounds):
+ (WebKitTests::FakeTextureUploader::isBusy):
+ (WebKitTests::FakeTextureUploader::uploadTexture):
+ * tests/CCTiledLayerTestCommon.h:
+ (FakeLayerTextureUpdater):
+ (FakeTiledLayerChromium):
+ (FakeTiledLayerWithScaledBounds):
+ (FakeTextureUploader):
+ * tests/FakeWebCompositorOutputSurface.h:
+ * tests/TextureCopierTest.cpp:
+ (MockContext):
+ (TEST):
+ * tests/ThrottledTextureUploaderTest.cpp:
+ (WebKit::TEST):
+ * tests/WebLayerTreeViewTest.cpp:
+
2012-08-29 Hironori Bono <[email protected]>
Fix Chromium builds (Win and Mac)
Modified: trunk/Source/WebKit/chromium/tests/CCAnimationTestCommon.cpp (127153 => 127154)
--- trunk/Source/WebKit/chromium/tests/CCAnimationTestCommon.cpp 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/tests/CCAnimationTestCommon.cpp 2012-08-30 17:04:35 UTC (rev 127154)
@@ -85,6 +85,16 @@
{
}
+double FakeFloatAnimationCurve::duration() const
+{
+ return 1;
+}
+
+float FakeFloatAnimationCurve::getValue(double now) const
+{
+ return 0;
+}
+
PassOwnPtr<WebCore::CCAnimationCurve> FakeFloatAnimationCurve::clone() const
{
return adoptPtr(new FakeFloatAnimationCurve);
@@ -99,6 +109,11 @@
{
}
+double FakeTransformTransition::duration() const
+{
+ return m_duration;
+}
+
WebKit::WebTransformationMatrix FakeTransformTransition::getValue(double time) const
{
return WebKit::WebTransformationMatrix();
@@ -121,6 +136,11 @@
{
}
+double FakeFloatTransition::duration() const
+{
+ return m_duration;
+}
+
float FakeFloatTransition::getValue(double time) const
{
time /= m_duration;
@@ -138,6 +158,31 @@
{
}
+int FakeLayerAnimationControllerClient::id() const
+{
+ return 0;
+}
+
+void FakeLayerAnimationControllerClient::setOpacityFromAnimation(float opacity)
+{
+ m_opacity = opacity;
+}
+
+float FakeLayerAnimationControllerClient::opacity() const
+{
+ return m_opacity;
+}
+
+void FakeLayerAnimationControllerClient::setTransformFromAnimation(const WebKit::WebTransformationMatrix& transform)
+{
+ m_transform = transform;
+}
+
+const WebKit::WebTransformationMatrix& FakeLayerAnimationControllerClient::transform() const
+{
+ return m_transform;
+}
+
PassOwnPtr<WebCore::CCAnimationCurve> FakeFloatTransition::clone() const
{
return adoptPtr(new FakeFloatTransition(*this));
Modified: trunk/Source/WebKit/chromium/tests/CCAnimationTestCommon.h (127153 => 127154)
--- trunk/Source/WebKit/chromium/tests/CCAnimationTestCommon.h 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/tests/CCAnimationTestCommon.h 2012-08-30 17:04:35 UTC (rev 127154)
@@ -44,8 +44,8 @@
FakeFloatAnimationCurve();
virtual ~FakeFloatAnimationCurve();
- virtual double duration() const OVERRIDE { return 1; }
- virtual float getValue(double now) const OVERRIDE { return 0; }
+ virtual double duration() const OVERRIDE;
+ virtual float getValue(double now) const OVERRIDE;
virtual PassOwnPtr<WebCore::CCAnimationCurve> clone() const OVERRIDE;
};
@@ -54,7 +54,7 @@
FakeTransformTransition(double duration);
virtual ~FakeTransformTransition();
- virtual double duration() const OVERRIDE { return m_duration; }
+ virtual double duration() const OVERRIDE;
virtual WebKit::WebTransformationMatrix getValue(double time) const OVERRIDE;
virtual PassOwnPtr<WebCore::CCAnimationCurve> clone() const OVERRIDE;
@@ -68,7 +68,7 @@
FakeFloatTransition(double duration, float from, float to);
virtual ~FakeFloatTransition();
- virtual double duration() const OVERRIDE { return m_duration; }
+ virtual double duration() const OVERRIDE;
virtual float getValue(double time) const OVERRIDE;
virtual PassOwnPtr<WebCore::CCAnimationCurve> clone() const OVERRIDE;
@@ -85,11 +85,11 @@
virtual ~FakeLayerAnimationControllerClient();
// CCLayerAnimationControllerClient implementation
- virtual int id() const OVERRIDE { return 0; }
- virtual void setOpacityFromAnimation(float opacity) OVERRIDE { m_opacity = opacity; }
- virtual float opacity() const OVERRIDE { return m_opacity; }
- virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix& transform) OVERRIDE { m_transform = transform; }
- virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE { return m_transform; }
+ virtual int id() const OVERRIDE;
+ virtual void setOpacityFromAnimation(float) OVERRIDE;
+ virtual float opacity() const OVERRIDE;
+ virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix&) OVERRIDE;
+ virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE;
private:
float m_opacity;
Modified: trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp (127153 => 127154)
--- trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.cpp 2012-08-30 17:04:35 UTC (rev 127154)
@@ -85,6 +85,11 @@
return adoptPtr(new Texture(this, CCPrioritizedTexture::create(manager)));
}
+LayerTextureUpdater::SampledTexelFormat FakeLayerTextureUpdater::sampledTexelFormat(GC3Denum)
+{
+ return SampledTexelFormatRGBA;
+}
+
FakeCCTiledLayerImpl::FakeCCTiledLayerImpl(int id)
: CCTiledLayerImpl(id)
{
@@ -105,6 +110,11 @@
setIsDrawable(true); // So that we don't get false positives if any of these tests expect to return false from drawsContent() for other reasons.
}
+FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds(CCPrioritizedTextureManager* textureManager)
+ : FakeTiledLayerChromium(textureManager)
+{
+}
+
FakeTiledLayerChromium::~FakeTiledLayerChromium()
{
}
@@ -132,9 +142,29 @@
}
}
-FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds(CCPrioritizedTextureManager* textureManager)
- : FakeTiledLayerChromium(textureManager)
+WebCore::CCPrioritizedTextureManager* FakeTiledLayerChromium::textureManager() const
{
+ return m_textureManager;
}
+WebCore::LayerTextureUpdater* FakeTiledLayerChromium::textureUpdater() const
+{
+ return m_fakeTextureUpdater.get();
+}
+
+WebCore::IntSize FakeTiledLayerWithScaledBounds::contentBounds() const
+{
+ return m_forcedContentBounds;
+}
+
+bool FakeTextureUploader::isBusy()
+{
+ return false;
+}
+
+void FakeTextureUploader::uploadTexture(WebCore::CCResourceProvider* resourceProvider, Parameters upload)
+{
+ upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destOffset);
+}
+
} // namespace
Modified: trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h (127153 => 127154)
--- trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h 2012-08-30 17:04:35 UTC (rev 127154)
@@ -60,7 +60,7 @@
virtual ~FakeLayerTextureUpdater();
virtual PassOwnPtr<WebCore::LayerTextureUpdater::Texture> createTexture(WebCore::CCPrioritizedTextureManager*) OVERRIDE;
- virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE { return SampledTexelFormatRGBA; }
+ virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE;
virtual void prepareToUpdate(const WebCore::IntRect& contentRect, const WebCore::IntSize&, float, float, WebCore::IntRect& resultingOpaqueRect, WebCore::CCRenderingStats&) OVERRIDE;
// Sets the rect to invalidate during the next call to prepareToUpdate(). After the next
@@ -122,12 +122,12 @@
virtual void setTexturePriorities(const WebCore::CCPriorityCalculator&) OVERRIDE;
- virtual WebCore::CCPrioritizedTextureManager* textureManager() const OVERRIDE { return m_textureManager; }
+ virtual WebCore::CCPrioritizedTextureManager* textureManager() const OVERRIDE;
FakeLayerTextureUpdater* fakeLayerTextureUpdater() { return m_fakeTextureUpdater.get(); }
WebCore::FloatRect updateRect() { return m_updateRect; }
protected:
- virtual WebCore::LayerTextureUpdater* textureUpdater() const OVERRIDE { return m_fakeTextureUpdater.get(); }
+ virtual WebCore::LayerTextureUpdater* textureUpdater() const OVERRIDE;
virtual void createTextureUpdaterIfNeeded() OVERRIDE { }
private:
@@ -141,7 +141,7 @@
explicit FakeTiledLayerWithScaledBounds(WebCore::CCPrioritizedTextureManager*);
void setContentBounds(const WebCore::IntSize& contentBounds) { m_forcedContentBounds = contentBounds; }
- virtual WebCore::IntSize contentBounds() const OVERRIDE { return m_forcedContentBounds; }
+ virtual WebCore::IntSize contentBounds() const OVERRIDE;
protected:
WebCore::IntSize m_forcedContentBounds;
@@ -149,16 +149,16 @@
class FakeTextureCopier : public WebCore::TextureCopier {
public:
- virtual void copyTexture(Parameters) { }
- virtual void flush() { }
+ virtual void copyTexture(Parameters) OVERRIDE { }
+ virtual void flush() OVERRIDE { }
};
class FakeTextureUploader : public WebCore::TextureUploader {
public:
- virtual bool isBusy() { return false; }
- virtual void beginUploads() { }
- virtual void endUploads() { }
- virtual void uploadTexture(WebCore::CCResourceProvider* resourceProvider, Parameters upload) { upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destOffset); }
+ virtual bool isBusy() OVERRIDE;
+ virtual void beginUploads() OVERRIDE { }
+ virtual void endUploads() OVERRIDE { }
+ virtual void uploadTexture(WebCore::CCResourceProvider*, Parameters upload) OVERRIDE;
};
}
Modified: trunk/Source/WebKit/chromium/tests/FakeWebCompositorOutputSurface.h (127153 => 127154)
--- trunk/Source/WebKit/chromium/tests/FakeWebCompositorOutputSurface.h 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/tests/FakeWebCompositorOutputSurface.h 2012-08-30 17:04:35 UTC (rev 127154)
@@ -28,6 +28,8 @@
#include <public/WebCompositorOutputSurface.h>
#include <public/WebGraphicsContext3D.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
namespace WebKit {
Modified: trunk/Source/WebKit/chromium/tests/TextureCopierTest.cpp (127153 => 127154)
--- trunk/Source/WebKit/chromium/tests/TextureCopierTest.cpp 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/tests/TextureCopierTest.cpp 2012-08-30 17:04:35 UTC (rev 127154)
@@ -27,7 +27,7 @@
#include "TextureCopier.h"
#include "FakeWebGraphicsContext3D.h"
-
+#include "GraphicsContext3D.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <wtf/RefPtr.h>
@@ -41,14 +41,13 @@
class MockContext : public FakeWebGraphicsContext3D {
public:
MOCK_METHOD2(bindFramebuffer, void(WGC3Denum, WebGLId));
- MOCK_METHOD3(texParameteri, void(GC3Denum target, GC3Denum pname, GC3Dint param));
+ MOCK_METHOD3(texParameteri, void(WGC3Denum target, WGC3Denum pname, WGC3Dint param));
- MOCK_METHOD3(drawArrays, void(GC3Denum mode, GC3Dint first, GC3Dsizei count));
+ MOCK_METHOD3(drawArrays, void(WGC3Denum mode, WGC3Dint first, WGC3Dsizei count));
};
TEST(TextureCopierTest, testDrawArraysCopy)
{
- GraphicsContext3D::Attributes attrs;
OwnPtr<MockContext> mockContext = adoptPtr(new MockContext);
{
Modified: trunk/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp (127153 => 127154)
--- trunk/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/tests/ThrottledTextureUploaderTest.cpp 2012-08-30 17:04:35 UTC (rev 127154)
@@ -28,6 +28,7 @@
#include "Extensions3DChromium.h"
#include "FakeWebGraphicsContext3D.h"
+#include "GraphicsContext3D.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -64,7 +65,6 @@
TEST(ThrottledTextureUploaderTest, IsBusy)
{
- GraphicsContext3D::Attributes attrs;
OwnPtr<FakeWebGraphicsContext3DWithQueryTesting> fakeContext(adoptPtr(new FakeWebGraphicsContext3DWithQueryTesting));
OwnPtr<ThrottledTextureUploader> uploader = ThrottledTextureUploader::create(fakeContext.get(), 2);
Modified: trunk/Source/WebKit/chromium/tests/WebLayerTreeViewTest.cpp (127153 => 127154)
--- trunk/Source/WebKit/chromium/tests/WebLayerTreeViewTest.cpp 2012-08-30 16:52:18 UTC (rev 127153)
+++ trunk/Source/WebKit/chromium/tests/WebLayerTreeViewTest.cpp 2012-08-30 17:04:35 UTC (rev 127154)
@@ -35,6 +35,8 @@
#include <public/WebLayer.h>
#include <public/WebLayerTreeViewClient.h>
#include <public/WebThread.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
using namespace WebKit;
using testing::Mock;