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

Side by Side Diff: content/renderer/media/video_source_handler_unittest.cc

Issue 596923003: Fix memory leakage in VideoSourceHandlerTest.OpenWithoutClose (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/child/child_process.h" 9 #include "content/child/child_process.h"
10 #include "content/common/media/video_capture.h" 10 #include "content/common/media/video_capture.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 VideoSourceHandlerTest() 46 VideoSourceHandlerTest()
47 : child_process_(new ChildProcess()), 47 : child_process_(new ChildProcess()),
48 registry_(new MockMediaStreamRegistry()) { 48 registry_(new MockMediaStreamRegistry()) {
49 handler_.reset(new VideoSourceHandler(registry_.get())); 49 handler_.reset(new VideoSourceHandler(registry_.get()));
50 registry_->Init(kTestStreamUrl); 50 registry_->Init(kTestStreamUrl);
51 registry_->AddVideoTrack(kTestVideoTrackId); 51 registry_->AddVideoTrack(kTestVideoTrackId);
52 } 52 }
53 53
54 virtual void TearDown() { 54 virtual void TearDown() {
55 registry_.reset(); 55 registry_.reset();
56 handler_.reset();
56 blink::WebHeap::collectAllGarbageForTesting(); 57 blink::WebHeap::collectAllGarbageForTesting();
57 } 58 }
58 59
59 protected: 60 protected:
60 base::MessageLoop message_loop_; 61 base::MessageLoop message_loop_;
61 scoped_ptr<ChildProcess> child_process_; 62 scoped_ptr<ChildProcess> child_process_;
62 scoped_ptr<VideoSourceHandler> handler_; 63 scoped_ptr<VideoSourceHandler> handler_;
63 scoped_ptr<MockMediaStreamRegistry> registry_; 64 scoped_ptr<MockMediaStreamRegistry> registry_;
64 }; 65 };
65 66
(...skipping 27 matching lines...) Expand all
93 EXPECT_FALSE(handler_->Close(NULL)); 94 EXPECT_FALSE(handler_->Close(NULL));
94 EXPECT_TRUE(handler_->Close(&reader)); 95 EXPECT_TRUE(handler_->Close(&reader));
95 } 96 }
96 97
97 TEST_F(VideoSourceHandlerTest, OpenWithoutClose) { 98 TEST_F(VideoSourceHandlerTest, OpenWithoutClose) {
98 FakeFrameReader reader; 99 FakeFrameReader reader;
99 EXPECT_TRUE(handler_->Open(kTestStreamUrl, &reader)); 100 EXPECT_TRUE(handler_->Open(kTestStreamUrl, &reader));
100 } 101 }
101 102
102 } // namespace content 103 } // namespace content
OLDNEW
« 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