Chromium Code Reviews| Index: blimp/engine/feature/geolocation/engine_geolocation_feature_unittest.cc |
| diff --git a/blimp/engine/feature/geolocation/engine_geolocation_feature_unittest.cc b/blimp/engine/feature/geolocation/engine_geolocation_feature_unittest.cc |
| index 25de9cc961d3d469cea442b5eddf968f61021c4e..1722d655a04249fe3836b4eacdba2a80784cd8e1 100644 |
| --- a/blimp/engine/feature/geolocation/engine_geolocation_feature_unittest.cc |
| +++ b/blimp/engine/feature/geolocation/engine_geolocation_feature_unittest.cc |
| @@ -9,6 +9,8 @@ |
| #include <utility> |
| #include "base/memory/ptr_util.h" |
| +#include "base/message_loop/message_loop.h" |
| +#include "base/run_loop.h" |
| #include "blimp/common/create_blimp_message.h" |
| #include "blimp/common/proto/blimp_message.pb.h" |
| #include "blimp/common/proto/geolocation.pb.h" |
| @@ -41,6 +43,7 @@ void SendMockLocationMessage(BlimpMessageProcessor* processor) { |
| net::TestCompletionCallback cb; |
| processor->ProcessMessage(std::move(message), cb.callback()); |
| EXPECT_EQ(net::OK, cb.WaitForResult()); |
| + base::RunLoop().RunUntilIdle(); |
| } |
| void SendMockErrorMessage(BlimpMessageProcessor* processor, |
| @@ -57,6 +60,7 @@ void SendMockErrorMessage(BlimpMessageProcessor* processor, |
| net::TestCompletionCallback cb; |
| processor->ProcessMessage(std::move(message), cb.callback()); |
| EXPECT_EQ(net::OK, cb.WaitForResult()); |
| + base::RunLoop().RunUntilIdle(); |
| } |
| void SendMalformedMessage(BlimpMessageProcessor* processor) { |
| @@ -117,6 +121,10 @@ class EngineGeolocationFeatureTest : public testing::Test { |
| // This is a raw pointer to a class that is owned by the GeolocationFeature. |
| MockBlimpMessageProcessor* out_processor_; |
| + // Provides RunLoop().RunUntilIdle() to run tasks posted during the |
|
Kevin M
2016/09/01 20:01:07
Nit: the MessageLoop doesn't actually provide that
CJ
2016/09/01 22:59:43
Done.
|
| + // processing of incoming messages. |
| + base::MessageLoop message_loop_; |
| + |
| EngineGeolocationFeature feature_; |
| std::unique_ptr<device::LocationProvider> location_provider_; |
| device::LocationProvider::LocationProviderUpdateCallback mock_callback_; |