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

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

Issue 1383803003: content/renderer/media: Use collectAllGarbageForTesting in tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/user_media_client_impl_unittest.cc
diff --git a/content/renderer/media/user_media_client_impl_unittest.cc b/content/renderer/media/user_media_client_impl_unittest.cc
index f92443ce7e763909e7df526bb941575c4080d324..c2123214e0a336d5b01367149f51be39d5ddf28c 100644
--- a/content/renderer/media/user_media_client_impl_unittest.cc
+++ b/content/renderer/media/user_media_client_impl_unittest.cc
@@ -371,7 +371,7 @@ TEST_F(UserMediaClientImplTest, StopSourceWhenMediaStreamGoesOutOfScope) {
// Makes sure the test itself don't hold a reference to the created
// MediaStream.
used_media_impl_->ClearLastGeneratedStream();
- blink::WebHeap::collectGarbageForTesting();
+ blink::WebHeap::collectAllGarbageForTesting();
// Expect the sources to be stopped when the MediaStream goes out of scope.
EXPECT_EQ(1, ms_dispatcher_->stop_audio_device_counter());
@@ -385,6 +385,7 @@ TEST_F(UserMediaClientImplTest, FrameWillClose) {
blink::WebMediaStream mixed_desc = RequestLocalMediaStream();
blink::WebMediaStream desc2 = RequestLocalMediaStream();
used_media_impl_->FrameWillClose();
+ blink::WebHeap::collectAllGarbageForTesting();
EXPECT_EQ(1, ms_dispatcher_->stop_audio_device_counter());
EXPECT_EQ(1, ms_dispatcher_->stop_video_device_counter());
}
@@ -398,7 +399,7 @@ TEST_F(UserMediaClientImplTest, MediaVideoSourceFailToStart) {
used_media_impl_->request_state());
EXPECT_EQ(MEDIA_DEVICE_TRACK_START_FAILURE,
used_media_impl_->error_reason());
- blink::WebHeap::collectGarbageForTesting();
+ blink::WebHeap::collectAllGarbageForTesting();
EXPECT_EQ(1, ms_dispatcher_->request_stream_counter());
EXPECT_EQ(1, ms_dispatcher_->stop_audio_device_counter());
EXPECT_EQ(1, ms_dispatcher_->stop_video_device_counter());
@@ -414,7 +415,7 @@ TEST_F(UserMediaClientImplTest, MediaAudioSourceFailToInitialize) {
used_media_impl_->request_state());
EXPECT_EQ(MEDIA_DEVICE_TRACK_START_FAILURE,
used_media_impl_->error_reason());
- blink::WebHeap::collectGarbageForTesting();
+ blink::WebHeap::collectAllGarbageForTesting();
EXPECT_EQ(1, ms_dispatcher_->request_stream_counter());
EXPECT_EQ(1, ms_dispatcher_->stop_audio_device_counter());
EXPECT_EQ(1, ms_dispatcher_->stop_video_device_counter());
@@ -462,6 +463,7 @@ TEST_F(UserMediaClientImplTest, StopTrackAfterReload) {
blink::WebMediaStream mixed_desc = RequestLocalMediaStream();
EXPECT_EQ(1, ms_dispatcher_->request_stream_counter());
used_media_impl_->FrameWillClose();
+ blink::WebHeap::collectAllGarbageForTesting();
EXPECT_EQ(1, ms_dispatcher_->stop_audio_device_counter());
EXPECT_EQ(1, ms_dispatcher_->stop_video_device_counter());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698