Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Unified Diff: blimp/engine/feature/geolocation/engine_geolocation_feature_unittest.cc

Issue 2249283003: Hooks together Geolocation Feature in the Client and Engine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lai
Patch Set: Put TestingLocationArbitrator out of anonymous namespace. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/engine/feature/geolocation/engine_geolocation_feature.cc ('k') | device/geolocation/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..80305eeb3fd3f794bfa696956a4cef81d119bb2f 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_;
+ // Processes tasks that were posted as a result of processing of incoming
+ // messages.
+ base::MessageLoop message_loop_;
+
EngineGeolocationFeature feature_;
std::unique_ptr<device::LocationProvider> location_provider_;
device::LocationProvider::LocationProviderUpdateCallback mock_callback_;
« no previous file with comments | « blimp/engine/feature/geolocation/engine_geolocation_feature.cc ('k') | device/geolocation/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698