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

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

Issue 549153002: MediaStream tests need to call WebHeap::collectGarbage (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
« no previous file with comments | « no previous file | content/renderer/media/media_stream_video_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_video_capture_source_unittest.cc
diff --git a/content/renderer/media/media_stream_video_capture_source_unittest.cc b/content/renderer/media/media_stream_video_capture_source_unittest.cc
index 8492039a7bd6a6521965cc19a4f74cd5ed0c7ff1..339e49da08b1719fa37bc1da0aa02c2a4a90dd98 100644
--- a/content/renderer/media/media_stream_video_capture_source_unittest.cc
+++ b/content/renderer/media/media_stream_video_capture_source_unittest.cc
@@ -15,6 +15,7 @@
#include "media/base/bind_to_current_loop.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/WebKit/public/web/WebHeap.h"
namespace content {
@@ -41,6 +42,11 @@ class MediaStreamVideoCapturerSourceTest : public testing::Test {
source_stopped_(false) {
}
+ virtual void TearDown() OVERRIDE {
+ webkit_source_.reset();
+ blink::WebHeap::collectAllGarbageForTesting();
+ }
+
void InitWithDeviceInfo(const StreamDeviceInfo& device_info) {
delegate_ = new MockVideoCapturerDelegate(device_info);
source_ = new MediaStreamVideoCapturerSource(
@@ -53,6 +59,7 @@ class MediaStreamVideoCapturerSourceTest : public testing::Test {
blink::WebMediaStreamSource::TypeVideo,
base::UTF8ToUTF16("dummy_source_name"));
webkit_source_.setExtraData(source_);
+ webkit_source_id_ = webkit_source_.id();
}
blink::WebMediaStreamTrack StartSource() {
@@ -73,7 +80,7 @@ class MediaStreamVideoCapturerSourceTest : public testing::Test {
void OnSourceStopped(const blink::WebMediaStreamSource& source) {
source_stopped_ = true;
- EXPECT_EQ(source.id(), webkit_source_.id());
+ EXPECT_EQ(source.id(), webkit_source_id_);
}
protected:
@@ -87,6 +94,7 @@ class MediaStreamVideoCapturerSourceTest : public testing::Test {
blink::WebMediaStreamSource webkit_source_;
MediaStreamVideoCapturerSource* source_; // owned by webkit_source.
scoped_refptr<VideoCapturerDelegate> delegate_;
+ blink::WebString webkit_source_id_;
bool source_stopped_;
};
@@ -132,6 +140,7 @@ TEST_F(MediaStreamVideoCapturerSourceTest, Ended) {
blink::WebMediaStreamSource::TypeVideo,
base::UTF8ToUTF16("dummy_source_name"));
webkit_source_.setExtraData(source_);
+ webkit_source_id_ = webkit_source_.id();
blink::WebMediaStreamTrack track = StartSource();
message_loop_.RunUntilIdle();
« no previous file with comments | « no previous file | content/renderer/media/media_stream_video_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698