OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.geolocation; | 5 package org.chromium.content.browser.test.util; |
6 | 6 |
7 import android.os.Handler; | 7 import android.os.Handler; |
8 import android.os.HandlerThread; | 8 import android.os.HandlerThread; |
9 import android.os.Message; | 9 import android.os.Message; |
10 | 10 |
| 11 import org.chromium.content.browser.LocationProviderAdapter; |
| 12 import org.chromium.content.browser.LocationProviderFactory; |
| 13 |
11 /** | 14 /** |
12 * A mock location provider. When started, runs a background thread that periodi
cally | 15 * A mock location provider. When started, runs a background thread that periodi
cally |
13 * posts location updates. This does not involve any system Location APIs and th
us | 16 * posts location updates. This does not involve any system Location APIs and th
us |
14 * does not require any special permissions in the test app or on the device. | 17 * does not require any special permissions in the test app or on the device. |
15 */ | 18 */ |
16 public class MockLocationProvider implements LocationProviderFactory.LocationPro
vider { | 19 public class MockLocationProvider implements LocationProviderFactory.LocationPro
vider { |
17 private boolean mIsRunning; | 20 private boolean mIsRunning; |
18 private Handler mHandler; | 21 private Handler mHandler; |
19 private HandlerThread mHandlerThread; | 22 private HandlerThread mHandlerThread; |
20 private final Object mLock = new Object(); | 23 private final Object mLock = new Object(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 private void newLocation() { | 83 private void newLocation() { |
81 LocationProviderAdapter.newLocationAvailable( | 84 LocationProviderAdapter.newLocationAvailable( |
82 0, 0, System.currentTimeMillis() / 1000.0, | 85 0, 0, System.currentTimeMillis() / 1000.0, |
83 false, 0, | 86 false, 0, |
84 true, 0.5, | 87 true, 0.5, |
85 false, 0, | 88 false, 0, |
86 false, 0); | 89 false, 0); |
87 } | 90 } |
88 }; | 91 }; |
89 | 92 |
OLD | NEW |