| Index: content/renderer/media/pepper_to_video_track_adapter_unittest.cc
|
| diff --git a/content/renderer/media/pepper_to_video_track_adapter_unittest.cc b/content/renderer/media/pepper_to_video_track_adapter_unittest.cc
|
| index da0d50cb975978cd2d78defb998acfc08d166e76..073f1aebe882deb38b100754a1dd12e2a04e3fb6 100644
|
| --- a/content/renderer/media/pepper_to_video_track_adapter_unittest.cc
|
| +++ b/content/renderer/media/pepper_to_video_track_adapter_unittest.cc
|
| @@ -2,9 +2,12 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include <memory>
|
| #include <string>
|
|
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/run_loop.h"
|
| +#include "base/task_scheduler/task_scheduler.h"
|
| #include "content/child/child_process.h"
|
| #include "content/public/test/mock_render_thread.h"
|
| #include "content/renderer/media/media_stream.h"
|
| @@ -42,14 +45,22 @@ class PepperToVideoTrackAdapterTest : public PpapiUnittest {
|
| registry_.reset();
|
| blink::WebHeap::collectAllGarbageForTesting();
|
| PpapiUnittest::TearDown();
|
| +
|
| + child_process_.reset();
|
| +
|
| + // Clear the TaskScheduler registered by the ChildProcess. ChildProcess does
|
| + // not clear the TaskScheduler itself because CONTINUE_ON_SHUTDOWN tasks are
|
| + // allowed to outlive it.
|
| + base::TaskScheduler::GetInstance()->JoinForTesting();
|
| + base::TaskScheduler::SetInstance(nullptr);
|
| }
|
|
|
| protected:
|
| - // A ChildProcess and a MessageLoop are both needed to fool the Tracks and
|
| - // Sources inside |registry_| into believing they are on the right threads.
|
| - const ChildProcess child_process_;
|
| - const MockRenderThread render_thread_;
|
| std::unique_ptr<MockMediaStreamRegistry> registry_;
|
| +
|
| + // A ChildProcess is needed by content::PepperToVideoTrackAdapter::Open.
|
| + std::unique_ptr<ChildProcess> child_process_ =
|
| + base::MakeUnique<ChildProcess>();
|
| };
|
|
|
| TEST_F(PepperToVideoTrackAdapterTest, Open) {
|
| @@ -64,6 +75,7 @@ TEST_F(PepperToVideoTrackAdapterTest, Open) {
|
| }
|
|
|
| TEST_F(PepperToVideoTrackAdapterTest, PutFrame) {
|
| + MockRenderThread render_thread;
|
| FrameWriterInterface* frame_writer = NULL;
|
| EXPECT_TRUE(PepperToVideoTrackAdapter::Open(registry_.get(),
|
| kTestStreamUrl, &frame_writer));
|
|
|