OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
9 #include "content/child/child_process.h" | 9 #include "content/child/child_process.h" |
10 #include "content/renderer/media/media_stream_video_capturer_source.h" | 10 #include "content/renderer/media/media_stream_video_capturer_source.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
48 class CanvasCaptureHandlerTest | 48 class CanvasCaptureHandlerTest |
49 : public TestWithParam<testing::tuple<bool, int, int>> { | 49 : public TestWithParam<testing::tuple<bool, int, int>> { |
50 public: | 50 public: |
51 CanvasCaptureHandlerTest() {} | 51 CanvasCaptureHandlerTest() {} |
52 | 52 |
53 void SetUp() override { | 53 void SetUp() override { |
54 canvas_capture_handler_.reset( | 54 canvas_capture_handler_ = CanvasCaptureHandler::CreateCanvasCaptureHandler( |
55 CanvasCaptureHandler::CreateCanvasCaptureHandler( | 55 blink::WebSize(kTestCanvasCaptureWidth, kTestCanvasCaptureHeight), |
56 blink::WebSize(kTestCanvasCaptureWidth, kTestCanvasCaptureHeight), | 56 kTestCanvasCaptureFramesPerSecond, message_loop_.task_runner(), |
57 kTestCanvasCaptureFramesPerSecond, message_loop_.task_runner(), | 57 &track_); |
58 &track_)); | |
59 } | 58 } |
60 | 59 |
61 void TearDown() override { | 60 void TearDown() override { |
62 track_.Reset(); | 61 track_.Reset(); |
63 blink::WebHeap::CollectAllGarbageForTesting(); | 62 blink::WebHeap::CollectAllGarbageForTesting(); |
64 canvas_capture_handler_.reset(); | 63 canvas_capture_handler_.reset(); |
65 | 64 |
66 // Let the message loop run to finish destroying the capturer. | 65 // Let the message loop run to finish destroying the capturer. |
67 base::RunLoop().RunUntilIdle(); | 66 base::RunLoop().RunUntilIdle(); |
68 } | 67 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 INSTANTIATE_TEST_CASE_P( | 248 INSTANTIATE_TEST_CASE_P( |
250 , | 249 , |
251 CanvasCaptureHandlerTest, | 250 CanvasCaptureHandlerTest, |
252 ::testing::Combine(::testing::Bool(), | 251 ::testing::Combine(::testing::Bool(), |
253 ::testing::Values(kTestCanvasCaptureFrameEvenSize, | 252 ::testing::Values(kTestCanvasCaptureFrameEvenSize, |
254 kTestCanvasCaptureFrameOddSize), | 253 kTestCanvasCaptureFrameOddSize), |
255 ::testing::Values(kTestCanvasCaptureFrameEvenSize, | 254 ::testing::Values(kTestCanvasCaptureFrameEvenSize, |
256 kTestCanvasCaptureFrameOddSize))); | 255 kTestCanvasCaptureFrameOddSize))); |
257 | 256 |
258 } // namespace content | 257 } // namespace content |
OLD | NEW |