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

Side by Side Diff: content/renderer/media/android/stream_texture_wrapper_impl_unittest.cc

Issue 2800893002: Use ScopedTaskEnvironment instead of MessageLoop in content unit tests. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/renderer/media/android/stream_texture_wrapper_impl.h" 5 #include "content/renderer/media/android/stream_texture_wrapper_impl.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/test/scoped_task_environment.h"
8 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
9 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
10 11
11 namespace content { 12 namespace content {
12 13
13 class StreamTextureWrapperImplTest : public testing::Test { 14 class StreamTextureWrapperImplTest : public testing::Test {
14 public: 15 public:
15 StreamTextureWrapperImplTest() {} 16 StreamTextureWrapperImplTest() {}
16 17
17 // Necessary, or else base::ThreadTaskRunnerHandle::Get() fails. 18 // Necessary, or else base::ThreadTaskRunnerHandle::Get() fails.
18 base::MessageLoop message_loop_; 19 base::test::ScopedTaskEnvironment scoped_task_environment_;
19 20
20 private: 21 private:
21 DISALLOW_COPY_AND_ASSIGN(StreamTextureWrapperImplTest); 22 DISALLOW_COPY_AND_ASSIGN(StreamTextureWrapperImplTest);
22 }; 23 };
23 24
24 // This test's purpose is to make sure the StreamTextureWrapperImpl can properly 25 // This test's purpose is to make sure the StreamTextureWrapperImpl can properly
25 // be destroyed via StreamTextureWrapper::Deleter. 26 // be destroyed via StreamTextureWrapper::Deleter.
26 TEST_F(StreamTextureWrapperImplTest, ConstructionDestruction_ShouldSucceed) { 27 TEST_F(StreamTextureWrapperImplTest, ConstructionDestruction_ShouldSucceed) {
27 media::ScopedStreamTextureWrapper stream_texture_wrapper = 28 media::ScopedStreamTextureWrapper stream_texture_wrapper =
28 StreamTextureWrapperImpl::Create(false, nullptr, 29 StreamTextureWrapperImpl::Create(false, nullptr,
29 base::ThreadTaskRunnerHandle::Get()); 30 base::ThreadTaskRunnerHandle::Get());
30 } 31 }
31 32
32 } // Content 33 } // Content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698