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

Unified Diff: content/renderer/media/video_source_handler_unittest.cc

Issue 566793002: MediaStream content_unittests need to trigger a GC before tear down (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: content/renderer/media/video_source_handler_unittest.cc
diff --git a/content/renderer/media/video_source_handler_unittest.cc b/content/renderer/media/video_source_handler_unittest.cc
index 94dce46a19511a5504654eca553ce5fe10124ef8..1a5cb78326d84f2d701292ab1456b78b1f186641 100644
--- a/content/renderer/media/video_source_handler_unittest.cc
+++ b/content/renderer/media/video_source_handler_unittest.cc
@@ -17,6 +17,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
#include "third_party/WebKit/public/platform/WebString.h"
+#include "third_party/WebKit/public/web/WebHeap.h"
namespace content {
@@ -44,17 +45,22 @@ class VideoSourceHandlerTest : public ::testing::Test {
public:
VideoSourceHandlerTest()
: child_process_(new ChildProcess()),
- registry_() {
- handler_.reset(new VideoSourceHandler(&registry_));
- registry_.Init(kTestStreamUrl);
- registry_.AddVideoTrack(kTestVideoTrackId);
+ registry_(new MockMediaStreamRegistry()) {
+ handler_.reset(new VideoSourceHandler(registry_.get()));
+ registry_->Init(kTestStreamUrl);
+ registry_->AddVideoTrack(kTestVideoTrackId);
+ }
+
+ virtual void TearDown() {
+ registry_.reset();
+ blink::WebHeap::collectAllGarbageForTesting();
}
protected:
base::MessageLoop message_loop_;
scoped_ptr<ChildProcess> child_process_;
scoped_ptr<VideoSourceHandler> handler_;
- MockMediaStreamRegistry registry_;
+ scoped_ptr<MockMediaStreamRegistry> registry_;
};
TEST_F(VideoSourceHandlerTest, OpenClose) {

Powered by Google App Engine
This is Rietveld 408576698