OLD | NEW |
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 package org.chromium.device.sensors; | 5 package org.chromium.device.sensors; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.hardware.Sensor; | 8 import android.hardware.Sensor; |
9 import android.hardware.SensorEventListener; | 9 import android.hardware.SensorEventListener; |
10 import android.hardware.SensorManager; | 10 import android.hardware.SensorManager; |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 468 |
469 // -- End Tests for correct Device Orientation angles. | 469 // -- End Tests for correct Device Orientation angles. |
470 | 470 |
471 private static class DeviceSensorsForTests extends DeviceSensors { | 471 private static class DeviceSensorsForTests extends DeviceSensors { |
472 private double mValue1 = 0; | 472 private double mValue1 = 0; |
473 private double mValue2 = 0; | 473 private double mValue2 = 0; |
474 private double mValue3 = 0; | 474 private double mValue3 = 0; |
475 private String mCalls = ""; | 475 private String mCalls = ""; |
476 | 476 |
477 private DeviceSensorsForTests(Context context) { | 477 private DeviceSensorsForTests(Context context) { |
478 super(context); | 478 super(); |
479 } | 479 } |
480 | 480 |
481 static DeviceSensorsForTests getInstance(Context context) { | 481 static DeviceSensorsForTests getInstance(Context context) { |
482 return new DeviceSensorsForTests(context); | 482 return new DeviceSensorsForTests(context); |
483 } | 483 } |
484 | 484 |
485 private void verifyValue(double v1) { | 485 private void verifyValue(double v1) { |
486 assertEquals(v1, mValue1); | 486 assertEquals(v1, mValue1); |
487 } | 487 } |
488 | 488 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 } | 585 } |
586 return false; | 586 return false; |
587 } | 587 } |
588 | 588 |
589 @Override | 589 @Override |
590 public void unregisterListener(SensorEventListener listener, int sensorT
ype) { | 590 public void unregisterListener(SensorEventListener listener, int sensorT
ype) { |
591 mNumUnRegistered++; | 591 mNumUnRegistered++; |
592 } | 592 } |
593 } | 593 } |
594 } | 594 } |
OLD | NEW |