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

Side by Side Diff: content/browser/device_sensors/sensor_manager_android_unittest.cc

Issue 884103004: Update {virtual,override,final} to follow C++11 style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 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 "content/browser/device_sensors/sensor_manager_android.h" 5 #include "content/browser/device_sensors/sensor_manager_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "content/browser/device_sensors/inertial_sensor_consts.h" 10 #include "content/browser/device_sensors/inertial_sensor_consts.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 namespace { 15 namespace {
16 16
17 class FakeSensorManagerAndroid : public SensorManagerAndroid { 17 class FakeSensorManagerAndroid : public SensorManagerAndroid {
18 public: 18 public:
19 FakeSensorManagerAndroid() { } 19 FakeSensorManagerAndroid() { }
20 virtual ~FakeSensorManagerAndroid() { } 20 ~FakeSensorManagerAndroid() override {}
21 21
22 virtual int GetNumberActiveDeviceMotionSensors() override { 22 int GetNumberActiveDeviceMotionSensors() override {
23 return number_active_sensors_; 23 return number_active_sensors_;
24 } 24 }
25 25
26 void SetNumberActiveDeviceMotionSensors(int number_active_sensors) { 26 void SetNumberActiveDeviceMotionSensors(int number_active_sensors) {
27 number_active_sensors_ = number_active_sensors; 27 number_active_sensors_ = number_active_sensors;
28 } 28 }
29 29
30 protected: 30 protected:
31 virtual bool Start(EventType event_type) override { 31 bool Start(EventType event_type) override { return true; }
32 return true;
33 }
34 32
35 virtual void Stop(EventType event_type) override { 33 void Stop(EventType event_type) override {}
36 }
37 34
38 private: 35 private:
39 int number_active_sensors_; 36 int number_active_sensors_;
40 }; 37 };
41 38
42 class AndroidSensorManagerTest : public testing::Test { 39 class AndroidSensorManagerTest : public testing::Test {
43 protected: 40 protected:
44 AndroidSensorManagerTest() { 41 AndroidSensorManagerTest() {
45 light_buffer_.reset(new DeviceLightHardwareBuffer); 42 light_buffer_.reset(new DeviceLightHardwareBuffer);
46 motion_buffer_.reset(new DeviceMotionHardwareBuffer); 43 motion_buffer_.reset(new DeviceMotionHardwareBuffer);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 sensorManager.GotLight(0, 0, 100); 154 sensorManager.GotLight(0, 0, 100);
158 ASSERT_EQ(100, light_buffer_->data.value); 155 ASSERT_EQ(100, light_buffer_->data.value);
159 156
160 sensorManager.StopFetchingDeviceLightData(); 157 sensorManager.StopFetchingDeviceLightData();
161 ASSERT_EQ(-1, light_buffer_->data.value); 158 ASSERT_EQ(-1, light_buffer_->data.value);
162 } 159 }
163 160
164 } // namespace 161 } // namespace
165 162
166 } // namespace content 163 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698