#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 {
public:
VideoSourceHandlerTest()
: child_process_(new ChildProcess()),
- registry_() {
- handler_.reset(new VideoSourceHandler(®istry_));
- 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) {