Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: content/renderer/device_sensors/device_light_event_pump_unittest.cc

Issue 470683002: Revert "Refactor code listening to platform events in content/renderer/." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/device_sensors/device_light_event_pump_unittest.cc
diff --git a/content/renderer/device_sensors/device_light_event_pump_unittest.cc b/content/renderer/device_sensors/device_light_event_pump_unittest.cc
index b1c97c56f18fb810476feefcf8ce1647f714b12b..08182f7b1b48e5433f7f63cacb6c17e9f1214e0f 100644
--- a/content/renderer/device_sensors/device_light_event_pump_unittest.cc
+++ b/content/renderer/device_sensors/device_light_event_pump_unittest.cc
@@ -39,15 +39,14 @@ class MockDeviceLightListener : public blink::WebDeviceLightListener {
class DeviceLightEventPumpForTesting : public DeviceLightEventPump {
public:
- DeviceLightEventPumpForTesting()
- : DeviceLightEventPump(0) {}
+ DeviceLightEventPumpForTesting() {}
virtual ~DeviceLightEventPumpForTesting() {}
void OnDidStart(base::SharedMemoryHandle renderer_handle) {
DeviceLightEventPump::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 {
DeviceLightEventPump::FireEvent();
Stop();
@@ -101,7 +100,7 @@ TEST_F(DeviceLightEventPumpTest, DidStartPolling) {
InitBuffer();
- light_pump()->Start(listener());
+ light_pump()->SetListener(listener());
light_pump()->OnDidStart(handle());
base::MessageLoop::current()->Run();
@@ -116,7 +115,7 @@ TEST_F(DeviceLightEventPumpTest, DidStartPollingValuesEqual) {
InitBuffer();
- light_pump()->Start(listener());
+ light_pump()->SetListener(listener());
light_pump()->OnDidStart(handle());
base::MessageLoop::current()->Run();
@@ -129,10 +128,6 @@ TEST_F(DeviceLightEventPumpTest, DidStartPollingValuesEqual) {
// Set next value to be same as previous value.
buffer()->data.value = 1.0;
listener()->set_did_change_device_light(false);
-
- // Reset the pump's listener.
- light_pump()->Start(listener());
-
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&DeviceLightEventPumpForTesting::FireEvent,
« no previous file with comments | « content/renderer/device_sensors/device_light_event_pump.cc ('k') | content/renderer/device_sensors/device_motion_event_pump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698