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

Side by Side Diff: content/renderer/device_sensors/device_orientation_event_pump_unittest.cc

Issue 686523002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device_orientation_event_pump.h" 5 #include "device_orientation_event_pump.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" 9 #include "content/common/device_sensors/device_orientation_hardware_buffer.h"
10 #include "content/public/test/test_utils.h" 10 #include "content/public/test/test_utils.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 }; 66 };
67 67
68 class DeviceOrientationEventPumpTest : public testing::Test { 68 class DeviceOrientationEventPumpTest : public testing::Test {
69 public: 69 public:
70 DeviceOrientationEventPumpTest() { 70 DeviceOrientationEventPumpTest() {
71 EXPECT_TRUE(shared_memory_.CreateAndMapAnonymous( 71 EXPECT_TRUE(shared_memory_.CreateAndMapAnonymous(
72 sizeof(DeviceOrientationHardwareBuffer))); 72 sizeof(DeviceOrientationHardwareBuffer)));
73 } 73 }
74 74
75 protected: 75 protected:
76 virtual void SetUp() override { 76 void SetUp() override {
77 const DeviceOrientationHardwareBuffer* null_buffer = NULL; 77 const DeviceOrientationHardwareBuffer* null_buffer = NULL;
78 listener_.reset(new MockDeviceOrientationListener); 78 listener_.reset(new MockDeviceOrientationListener);
79 orientation_pump_.reset(new DeviceOrientationEventPumpForTesting); 79 orientation_pump_.reset(new DeviceOrientationEventPumpForTesting);
80 buffer_ = static_cast<DeviceOrientationHardwareBuffer*>( 80 buffer_ = static_cast<DeviceOrientationHardwareBuffer*>(
81 shared_memory_.memory()); 81 shared_memory_.memory());
82 ASSERT_NE(null_buffer, buffer_); 82 ASSERT_NE(null_buffer, buffer_);
83 memset(buffer_, 0, sizeof(DeviceOrientationHardwareBuffer)); 83 memset(buffer_, 0, sizeof(DeviceOrientationHardwareBuffer));
84 ASSERT_TRUE(shared_memory_.ShareToProcess(base::GetCurrentProcessHandle(), 84 ASSERT_TRUE(shared_memory_.ShareToProcess(base::GetCurrentProcessHandle(),
85 &handle_)); 85 &handle_));
86 } 86 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 base::Bind(&DeviceOrientationEventPumpForTesting::FireEvent, 206 base::Bind(&DeviceOrientationEventPumpForTesting::FireEvent,
207 base::Unretained(orientation_pump()))); 207 base::Unretained(orientation_pump())));
208 base::MessageLoop::current()->Run(); 208 base::MessageLoop::current()->Run();
209 209
210 EXPECT_TRUE(listener()->did_change_device_orientation()); 210 EXPECT_TRUE(listener()->did_change_device_orientation());
211 EXPECT_EQ(1 + DeviceOrientationEventPump::kOrientationThreshold, 211 EXPECT_EQ(1 + DeviceOrientationEventPump::kOrientationThreshold,
212 static_cast<double>(received_data.alpha)); 212 static_cast<double>(received_data.alpha));
213 } 213 }
214 214
215 } // namespace content 215 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698