diff --git a/gfx/tests/gtest/TestAsyncPanZoomController.cpp b/gfx/tests/gtest/TestAsyncPanZoomController.cpp index 1dcad9ffddd..ad48725ff92 100644 --- a/gfx/tests/gtest/TestAsyncPanZoomController.cpp +++ b/gfx/tests/gtest/TestAsyncPanZoomController.cpp @@ -7,7 +7,6 @@ #include "gmock/gmock.h" #include "mozilla/Attributes.h" -#include "mozilla/gfx/Tools.h" // For NudgeToInteger #include "mozilla/layers/AsyncCompositionManager.h" // for ViewTransform #include "mozilla/layers/AsyncPanZoomController.h" #include "mozilla/layers/LayerManagerComposite.h" @@ -21,6 +20,7 @@ using namespace mozilla; using namespace mozilla::gfx; using namespace mozilla::layers; using ::testing::_; +using ::testing::NiceMock; class MockContentController : public GeckoContentController { public: @@ -151,13 +151,13 @@ ApzcPinch(AsyncPanZoomController* aApzc, int aFocusX, int aFocusY, float aScale) TEST(AsyncPanZoomController, Constructor) { // RefCounted class can't live in the stack - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); nsRefPtr apzc = new TestAsyncPanZoomController(0, mcc); apzc->SetFrameMetrics(TestFrameMetrics()); } TEST(AsyncPanZoomController, Pinch) { - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); nsRefPtr apzc = new TestAsyncPanZoomController(0, mcc); FrameMetrics fm; @@ -197,7 +197,7 @@ TEST(AsyncPanZoomController, Pinch) { } TEST(AsyncPanZoomController, Overzoom) { - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); nsRefPtr apzc = new TestAsyncPanZoomController(0, mcc); FrameMetrics fm; @@ -225,7 +225,7 @@ TEST(AsyncPanZoomController, Overzoom) { TEST(AsyncPanZoomController, SimpleTransform) { TimeStamp testStartTime = TimeStamp::Now(); // RefCounted class can't live in the stack - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); nsRefPtr apzc = new TestAsyncPanZoomController(0, mcc); apzc->SetFrameMetrics(TestFrameMetrics()); @@ -257,7 +257,7 @@ TEST(AsyncPanZoomController, ComplexTransform) { // CSS pixels). The displayport is 1 extra CSS pixel on all // sides. - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); nsRefPtr apzc = new TestAsyncPanZoomController(0, mcc); nsRefPtr childApzc = new TestAsyncPanZoomController(0, mcc); @@ -346,7 +346,7 @@ TEST(AsyncPanZoomController, Pan) { TimeStamp testStartTime = TimeStamp::Now(); AsyncPanZoomController::SetFrameTime(testStartTime); - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); nsRefPtr tm = new TestAPZCTreeManager(); nsRefPtr apzc = new TestAsyncPanZoomController(0, mcc, tm); @@ -379,7 +379,7 @@ TEST(AsyncPanZoomController, Fling) { TimeStamp testStartTime = TimeStamp::Now(); AsyncPanZoomController::SetFrameTime(testStartTime); - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); nsRefPtr tm = new TestAPZCTreeManager(); nsRefPtr apzc = new TestAsyncPanZoomController(0, mcc, tm); @@ -409,7 +409,7 @@ TEST(AsyncPanZoomController, OverScrollPanning) { TimeStamp testStartTime = TimeStamp::Now(); AsyncPanZoomController::SetFrameTime(testStartTime); - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); nsRefPtr tm = new TestAPZCTreeManager(); nsRefPtr apzc = new TestAsyncPanZoomController(0, mcc, tm); @@ -491,20 +491,6 @@ SetScrollableFrameMetrics(Layer* aLayer, FrameMetrics::ViewID aScrollId, container->SetFrameMetrics(metrics); } -static gfxPoint -NudgeToIntegers(const gfxPoint& aPoint) -{ - // gfxPoint has doubles but NudgeToInteger takes - // floats so use local vars. The loss in precision - // shouldn't affect this because these are supposed - // to be integers anyway. - float x = aPoint.x; - float y = aPoint.y; - NudgeToInteger(&x); - NudgeToInteger(&y); - return gfxPoint(x, y); -} - static already_AddRefed GetTargetAPZC(APZCTreeManager* manager, const ScreenPoint& aPoint, gfx3DMatrix& aTransformToApzcOut, gfx3DMatrix& aTransformToGeckoOut) @@ -524,7 +510,7 @@ TEST(APZCTreeManager, HitTesting1) { TimeStamp testStartTime = TimeStamp::Now(); AsyncPanZoomController::SetFrameTime(testStartTime); - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); ScopedLayerTreeRegistration controller(0, root, mcc); nsRefPtr manager = new TestAPZCTreeManager(); @@ -596,7 +582,7 @@ TEST(APZCTreeManager, HitTesting2) { TimeStamp testStartTime = TimeStamp::Now(); AsyncPanZoomController::SetFrameTime(testStartTime); - nsRefPtr mcc = new MockContentController(); + nsRefPtr mcc = new NiceMock(); ScopedLayerTreeRegistration controller(0, root, mcc); nsRefPtr manager = new TestAPZCTreeManager();