OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/engine/feature/geolocation/engine_geolocation_feature.h" | 5 #include "blimp/engine/feature/geolocation/engine_geolocation_feature.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 | 174 |
175 TEST_F(EngineGeolocationFeatureTest, UnexpectedMessageReceived) { | 175 TEST_F(EngineGeolocationFeatureTest, UnexpectedMessageReceived) { |
176 std::unique_ptr<BlimpMessage> message = CreateUnexpectedMessage(); | 176 std::unique_ptr<BlimpMessage> message = CreateUnexpectedMessage(); |
177 net::TestCompletionCallback cb; | 177 net::TestCompletionCallback cb; |
178 feature_.ProcessMessage(std::move(message), cb.callback()); | 178 feature_.ProcessMessage(std::move(message), cb.callback()); |
179 | 179 |
180 EXPECT_EQ(net::ERR_UNEXPECTED, cb.WaitForResult()); | 180 EXPECT_EQ(net::ERR_UNEXPECTED, cb.WaitForResult()); |
181 } | 181 } |
182 | 182 |
183 TEST_F(EngineGeolocationFeatureTest, RequestRefresh) { | 183 TEST_F(EngineGeolocationFeatureTest, |
| 184 OnPermissionGrantedTriggersRefreshRequest) { |
184 EXPECT_CALL(*out_processor_, | 185 EXPECT_CALL(*out_processor_, |
185 MockableProcessMessage( | 186 MockableProcessMessage( |
186 EqualsUpdatedRequestLevel( | 187 EqualsUpdatedRequestLevel( |
187 GeolocationSetInterestLevelMessage::HIGH_ACCURACY), | 188 GeolocationSetInterestLevelMessage::HIGH_ACCURACY), |
188 _)) | 189 _)) |
189 .Times(1); | 190 .Times(1); |
190 | 191 |
191 EXPECT_CALL(*out_processor_, | 192 EXPECT_CALL(*out_processor_, |
192 MockableProcessMessage(EqualsRequestRefresh(), _)) | 193 MockableProcessMessage(EqualsRequestRefresh(), _)) |
193 .Times(1); | 194 .Times(1); |
194 EXPECT_CALL(*out_processor_, | 195 EXPECT_CALL(*out_processor_, |
195 MockableProcessMessage( | 196 MockableProcessMessage( |
196 EqualsUpdatedRequestLevel( | 197 EqualsUpdatedRequestLevel( |
197 GeolocationSetInterestLevelMessage::NO_INTEREST), | 198 GeolocationSetInterestLevelMessage::NO_INTEREST), |
198 _)) | 199 _)) |
199 .Times(1); | 200 .Times(1); |
200 | 201 |
201 location_provider_->StartProvider(true); | 202 location_provider_->StartProvider(true); |
202 location_provider_->RequestRefresh(); | 203 location_provider_->OnPermissionGranted(); |
203 } | 204 } |
204 | 205 |
205 } // namespace engine | 206 } // namespace engine |
206 } // namespace blimp | 207 } // namespace blimp |
OLD | NEW |