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

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: Addresses nyquist's #46 comments. 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
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..1794481332c62955724aae73933c8bd53b52700a 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,9 @@ class EngineGeolocationFeatureTest : public testing::Test {
// This is a raw pointer to a class that is owned by the GeolocationFeature.
MockBlimpMessageProcessor* out_processor_;
+ // Runs tasks posted during the processing of incoming messages.
Wez 2016/09/01 02:45:43 nit: "Used to run tasks..." It's really the RunLo
CJ 2016/09/01 18:17:05 Done.
+ base::MessageLoop message_loop_;
+
EngineGeolocationFeature feature_;
std::unique_ptr<device::LocationProvider> location_provider_;
device::LocationProvider::LocationProviderUpdateCallback mock_callback_;

Powered by Google App Engine
This is Rietveld 408576698