| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |