| Index: content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
|
| diff --git a/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc b/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
|
| index 9b5cb84432dbefe4a85158628a2098e30075a424..95a54df07f9efaba0d577b27b3079763023e6475 100644
|
| --- a/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
|
| +++ b/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
|
| @@ -46,15 +46,14 @@ class MockDeviceOrientationListener
|
|
|
| class DeviceOrientationEventPumpForTesting : public DeviceOrientationEventPump {
|
| public:
|
| - DeviceOrientationEventPumpForTesting()
|
| - : DeviceOrientationEventPump(0) { }
|
| + DeviceOrientationEventPumpForTesting() { }
|
| virtual ~DeviceOrientationEventPumpForTesting() { }
|
|
|
| void OnDidStart(base::SharedMemoryHandle renderer_handle) {
|
| DeviceOrientationEventPump::OnDidStart(renderer_handle);
|
| }
|
| - virtual void SendStartMessage() OVERRIDE { }
|
| - virtual void SendStopMessage() OVERRIDE { }
|
| + virtual bool SendStartMessage() OVERRIDE { return true; }
|
| + virtual bool SendStopMessage() OVERRIDE { return true; }
|
| virtual void FireEvent() OVERRIDE {
|
| DeviceOrientationEventPump::FireEvent();
|
| Stop();
|
| @@ -122,7 +121,7 @@ TEST_F(DeviceOrientationEventPumpTest, DidStartPolling) {
|
| base::MessageLoop loop;
|
|
|
| InitBuffer();
|
| - orientation_pump()->Start(listener());
|
| + orientation_pump()->SetListener(listener());
|
| orientation_pump()->OnDidStart(handle());
|
|
|
| base::MessageLoop::current()->Run();
|
| @@ -142,7 +141,7 @@ TEST_F(DeviceOrientationEventPumpTest, FireAllNullEvent) {
|
| base::MessageLoop loop;
|
|
|
| InitBufferNoData();
|
| - orientation_pump()->Start(listener());
|
| + orientation_pump()->SetListener(listener());
|
| orientation_pump()->OnDidStart(handle());
|
|
|
| base::MessageLoop::current()->Run();
|
| @@ -159,7 +158,7 @@ TEST_F(DeviceOrientationEventPumpTest, UpdateRespectsOrientationThreshold) {
|
| base::MessageLoop loop;
|
|
|
| InitBuffer();
|
| - orientation_pump()->Start(listener());
|
| + orientation_pump()->SetListener(listener());
|
| orientation_pump()->OnDidStart(handle());
|
|
|
| base::MessageLoop::current()->Run();
|
| @@ -178,9 +177,6 @@ TEST_F(DeviceOrientationEventPumpTest, UpdateRespectsOrientationThreshold) {
|
| 1 + DeviceOrientationEventPump::kOrientationThreshold / 2.0;
|
| listener()->set_did_change_device_orientation(false);
|
|
|
| - // Reset the pump's listener.
|
| - orientation_pump()->Start(listener());
|
| -
|
| base::MessageLoop::current()->PostTask(FROM_HERE,
|
| base::Bind(&DeviceOrientationEventPumpForTesting::FireEvent,
|
| base::Unretained(orientation_pump())));
|
| @@ -199,9 +195,6 @@ TEST_F(DeviceOrientationEventPumpTest, UpdateRespectsOrientationThreshold) {
|
| 1 + DeviceOrientationEventPump::kOrientationThreshold;
|
| listener()->set_did_change_device_orientation(false);
|
|
|
| - // Reset the pump's listener.
|
| - orientation_pump()->Start(listener());
|
| -
|
| base::MessageLoop::current()->PostTask(FROM_HERE,
|
| base::Bind(&DeviceOrientationEventPumpForTesting::FireEvent,
|
| base::Unretained(orientation_pump())));
|
|
|