OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "content/browser/geolocation/fake_access_token_store.h" | 6 #include "content/browser/geolocation/fake_access_token_store.h" |
7 #include "content/browser/geolocation/geolocation_observer.h" | 7 #include "content/browser/geolocation/geolocation_observer.h" |
8 #include "content/browser/geolocation/location_arbitrator_impl.h" | 8 #include "content/browser/geolocation/location_arbitrator_impl.h" |
9 #include "content/browser/geolocation/location_provider.h" | 9 #include "content/browser/geolocation/location_provider.h" |
10 #include "content/browser/geolocation/mock_location_provider.h" | 10 #include "content/browser/geolocation/mock_location_provider.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return arbitrator_->cell_; | 137 return arbitrator_->cell_; |
138 } | 138 } |
139 | 139 |
140 MockLocationProvider* gps() { | 140 MockLocationProvider* gps() { |
141 return arbitrator_->gps_; | 141 return arbitrator_->gps_; |
142 } | 142 } |
143 | 143 |
144 scoped_refptr<FakeAccessTokenStore> access_token_store_; | 144 scoped_refptr<FakeAccessTokenStore> access_token_store_; |
145 scoped_ptr<MockLocationObserver> observer_; | 145 scoped_ptr<MockLocationObserver> observer_; |
146 scoped_ptr<TestingGeolocationArbitrator> arbitrator_; | 146 scoped_ptr<TestingGeolocationArbitrator> arbitrator_; |
147 MessageLoop loop_; | 147 base::MessageLoop loop_; |
148 }; | 148 }; |
149 | 149 |
150 TEST_F(GeolocationLocationArbitratorTest, CreateDestroy) { | 150 TEST_F(GeolocationLocationArbitratorTest, CreateDestroy) { |
151 EXPECT_TRUE(access_token_store_); | 151 EXPECT_TRUE(access_token_store_); |
152 EXPECT_TRUE(arbitrator_ != NULL); | 152 EXPECT_TRUE(arbitrator_ != NULL); |
153 arbitrator_.reset(); | 153 arbitrator_.reset(); |
154 SUCCEED(); | 154 SUCCEED(); |
155 } | 155 } |
156 | 156 |
157 TEST_F(GeolocationLocationArbitratorTest, OnPermissionGranted) { | 157 TEST_F(GeolocationLocationArbitratorTest, OnPermissionGranted) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 CheckLastPositionInfo(3.5657104, 139.690341, 300); | 285 CheckLastPositionInfo(3.5657104, 139.690341, 300); |
286 | 286 |
287 // 2 minutes later | 287 // 2 minutes later |
288 AdvanceTimeNow(base::TimeDelta::FromMinutes(2)); | 288 AdvanceTimeNow(base::TimeDelta::FromMinutes(2)); |
289 // Arrive in station. Cell moves but GPS is stale. Switch to fresher cell. | 289 // Arrive in station. Cell moves but GPS is stale. Switch to fresher cell. |
290 SetPositionFix(cell(), 3.5658700, 139.069979, 1000); | 290 SetPositionFix(cell(), 3.5658700, 139.069979, 1000); |
291 CheckLastPositionInfo(3.5658700, 139.069979, 1000); | 291 CheckLastPositionInfo(3.5658700, 139.069979, 1000); |
292 } | 292 } |
293 | 293 |
294 } // namespace content | 294 } // namespace content |
OLD | NEW |