Chromium Code Reviews| Index: third_party/WebKit/Source/platform/testing/WebLayerMock.h |
| diff --git a/third_party/WebKit/Source/platform/testing/WebLayerMock.h b/third_party/WebKit/Source/platform/testing/WebLayerMock.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4f5869c3b88a58a535a8311aedc2dd36f49570a5 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/platform/testing/WebLayerMock.h |
| @@ -0,0 +1,125 @@ |
| +/* |
| + * Copyright (C) 2015 Google Inc. All rights reserved. |
|
esprehn
2016/01/04 21:15:21
use short copyright for all new files
|
| + * |
| + * Redistribution and use in source and binary forms, with or without |
| + * modification, are permitted provided that the following conditions |
| + * are met: |
| + * 1. Redistributions of source code must retain the above copyright |
| + * notice, this list of conditions and the following disclaimer. |
| + * 2. Redistributions in binary form must reproduce the above copyright |
| + * notice, this list of conditions and the following disclaimer in the |
| + * documentation and/or other materials provided with the distribution. |
| + * |
| + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY |
| + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| + */ |
| + |
| +#ifndef WebLayerMock_h |
| +#define WebLayerMock_h |
| + |
| +#include "platform/transforms/TransformationMatrix.h" |
| +#include "public/platform/WebLayer.h" |
| +#include "public/platform/WebLayerPositionConstraint.h" |
| + |
| +#include <gmock/gmock.h> |
| +#include <gtest/gtest.h> |
| + |
| +namespace blink { |
| + |
| +class WebLayerMock : public WebLayer { |
| +public: |
| + MOCK_CONST_METHOD0(id, int()); |
| + MOCK_METHOD1(invalidateRect, void(const WebRect&)); |
| + MOCK_METHOD0(invalidate, void()); |
| + MOCK_METHOD1(addChild, void(WebLayer*)); |
| + MOCK_METHOD2(insertChild, void(WebLayer*, size_t index)); |
| + MOCK_METHOD2(replaceChild, void(WebLayer* reference, WebLayer* newLayer)); |
| + MOCK_METHOD0(removeFromParent, void()); |
| + MOCK_METHOD0(removeAllChildren, void()); |
| + MOCK_METHOD1(setBounds, void(const WebSize&)); |
| + MOCK_CONST_METHOD0(bounds, WebSize()); |
| + MOCK_METHOD1(setMasksToBounds, void(bool)); |
| + MOCK_CONST_METHOD0(masksToBounds, bool()); |
| + MOCK_METHOD1(setMaskLayer, void(WebLayer*)); |
| + MOCK_METHOD1(setReplicaLayer, void(WebLayer*)); |
| + MOCK_METHOD1(setOpacity, void(float)); |
| + MOCK_CONST_METHOD0(opacity, float()); |
| + MOCK_METHOD1(setBlendMode, void(WebBlendMode)); |
| + MOCK_CONST_METHOD0(blendMode, WebBlendMode()); |
| + MOCK_METHOD1(setIsRootForIsolatedGroup, void(bool)); |
| + MOCK_METHOD0(isRootForIsolatedGroup, bool()); |
| + MOCK_METHOD1(setOpaque, void(bool)); |
| + MOCK_CONST_METHOD0(opaque, bool()); |
| + MOCK_METHOD1(setPosition, void(const WebFloatPoint&)); |
| + MOCK_CONST_METHOD0(position, WebFloatPoint()); |
| + MOCK_METHOD1(setTransform, void(const SkMatrix44&)); |
| + MOCK_CONST_METHOD0(transform, SkMatrix44()); |
| + MOCK_METHOD1(setTransformOrigin, void(const WebFloatPoint3D&)); |
| + MOCK_CONST_METHOD0(transformOrigin, WebFloatPoint3D()); |
| + MOCK_METHOD1(setDrawsContent, void(bool)); |
| + MOCK_CONST_METHOD0(drawsContent, bool()); |
| + MOCK_METHOD1(setDoubleSided, void(bool)); |
| + MOCK_METHOD1(setShouldFlattenTransform, void(bool)); |
| + MOCK_METHOD1(setRenderingContext, void(int id)); |
| + MOCK_METHOD1(setUseParentBackfaceVisibility, void(bool)); |
| + MOCK_METHOD1(setBackgroundColor, void(WebColor)); |
| + MOCK_CONST_METHOD0(backgroundColor, WebColor()); |
| + MOCK_METHOD1(setFilters, void(const WebFilterOperations&)); |
| + MOCK_METHOD1(setBackgroundFilters, void(const WebFilterOperations&)); |
| + MOCK_METHOD1(setAnimationDelegate, void(WebCompositorAnimationDelegate*)); |
| + MOCK_METHOD1(addAnimation, bool(WebCompositorAnimation*)); |
| + MOCK_METHOD1(removeAnimation, void(int animationId)); |
| + MOCK_METHOD2(removeAnimation, void(int animationId, WebCompositorAnimation::TargetProperty)); |
| + MOCK_METHOD2(pauseAnimation, void(int animationId, double timeOffset)); |
| + MOCK_METHOD1(abortAnimation, void(int animationId)); |
| + MOCK_METHOD0(hasActiveAnimation, bool()); |
| + MOCK_METHOD1(setScrollParent, void(WebLayer*)); |
| + MOCK_METHOD1(setClipParent, void(WebLayer*)); |
| + MOCK_METHOD1(setScrollPositionDouble, void(WebDoublePoint)); |
| + MOCK_CONST_METHOD0(scrollPositionDouble, WebDoublePoint()); |
| + MOCK_METHOD1(setScrollCompensationAdjustment, void(WebDoublePoint)); |
| + MOCK_METHOD1(setScrollClipLayer, void(WebLayer*)); |
| + MOCK_CONST_METHOD0(scrollable, bool()); |
| + MOCK_METHOD2(setUserScrollable, void(bool horizontal, bool vertical)); |
| + MOCK_CONST_METHOD0(userScrollableHorizontal, bool()); |
| + MOCK_CONST_METHOD0(userScrollableVertical, bool()); |
| + MOCK_METHOD1(setHaveWheelEventHandlers, void(bool)); |
| + MOCK_CONST_METHOD0(haveWheelEventHandlers, bool()); |
| + MOCK_METHOD1(setHaveScrollEventHandlers, void(bool)); |
| + MOCK_CONST_METHOD0(haveScrollEventHandlers, bool()); |
| + MOCK_METHOD1(setShouldScrollOnMainThread, void(bool)); |
| + MOCK_CONST_METHOD0(shouldScrollOnMainThread, bool()); |
| + MOCK_METHOD1(setNonFastScrollableRegion, void(const WebVector<WebRect>&)); |
| + MOCK_CONST_METHOD0(nonFastScrollableRegion, WebVector<WebRect>()); |
| + MOCK_METHOD1(setTouchEventHandlerRegion, void(const WebVector<WebRect>&)); |
| + MOCK_CONST_METHOD0(touchEventHandlerRegion, WebVector<WebRect>()); |
| + MOCK_METHOD1(setFrameTimingRequests, void(const WebVector<std::pair<int64_t, WebRect>>&)); |
| + MOCK_CONST_METHOD0(frameTimingRequests, WebVector<std::pair<int64_t, WebRect>>()); |
| + MOCK_METHOD1(setScrollBlocksOn, void(WebScrollBlocksOn)); |
| + MOCK_CONST_METHOD0(scrollBlocksOn, WebScrollBlocksOn()); |
| + MOCK_METHOD1(setIsContainerForFixedPositionLayers, void(bool)); |
| + MOCK_CONST_METHOD0(isContainerForFixedPositionLayers, bool()); |
| + MOCK_METHOD1(setPositionConstraint, void(const WebLayerPositionConstraint&)); |
| + MOCK_CONST_METHOD0(positionConstraint, WebLayerPositionConstraint()); |
| + MOCK_METHOD1(setScrollClient, void(WebLayerScrollClient*)); |
| + MOCK_METHOD1(setForceRenderSurface, void(bool)); |
| + MOCK_CONST_METHOD0(isOrphan, bool()); |
| + MOCK_METHOD1(setLayerClient, void(cc::LayerClient*)); |
| + MOCK_CONST_METHOD0(ccLayer, const cc::Layer*()); |
| + MOCK_METHOD1(setElementId, void(uint64_t)); |
| + MOCK_CONST_METHOD0(elementId, uint64_t()); |
| + MOCK_METHOD1(setCompositorMutableProperties, void(uint32_t)); |
| + MOCK_CONST_METHOD0(compositorMutableProperties, uint32_t()); |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // WebLayerMock_h |