Index: remoting/host/screen_recorder_unittest.cc |
diff --git a/remoting/host/screen_recorder_unittest.cc b/remoting/host/screen_recorder_unittest.cc |
index 9540997552455bd83b368817468b4d954755626e..86608ba44efdb955fda006f10134a793c77b37ec 100644 |
--- a/remoting/host/screen_recorder_unittest.cc |
+++ b/remoting/host/screen_recorder_unittest.cc |
@@ -87,7 +87,16 @@ class ScreenRecorderTest : public testing::Test { |
&capturer_, encoder_); |
} |
+ virtual void TearDown() OVERRIDE { |
+ record_ = NULL; |
+ connection_ = NULL; |
+ // Run message loop before destroying because protocol::Session is |
+ // destroyed asynchronously. |
+ message_loop_.RunAllPending(); |
+ } |
+ |
protected: |
+ MessageLoop message_loop_; |
scoped_refptr<ScreenRecorder> record_; |
MockConnectionToClientEventHandler handler_; |
@@ -99,7 +108,7 @@ class ScreenRecorderTest : public testing::Test { |
// The following mock objects are owned by ScreenRecorder. |
MockCapturer capturer_; |
MockEncoder* encoder_; |
- MessageLoop message_loop_; |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(ScreenRecorderTest); |
}; |