| 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_ = CanvasCaptureHandler::CreateCanvasCaptureHandler( | 54 canvas_capture_handler_.reset( |
| 55 blink::WebSize(kTestCanvasCaptureWidth, kTestCanvasCaptureHeight), | 55 CanvasCaptureHandler::CreateCanvasCaptureHandler( |
| 56 kTestCanvasCaptureFramesPerSecond, message_loop_.task_runner(), | 56 blink::WebSize(kTestCanvasCaptureWidth, kTestCanvasCaptureHeight), |
| 57 &track_); | 57 kTestCanvasCaptureFramesPerSecond, message_loop_.task_runner(), |
| 58 &track_)); |
| 58 } | 59 } |
| 59 | 60 |
| 60 void TearDown() override { | 61 void TearDown() override { |
| 61 track_.Reset(); | 62 track_.Reset(); |
| 62 blink::WebHeap::CollectAllGarbageForTesting(); | 63 blink::WebHeap::CollectAllGarbageForTesting(); |
| 63 canvas_capture_handler_.reset(); | 64 canvas_capture_handler_.reset(); |
| 64 | 65 |
| 65 // Let the message loop run to finish destroying the capturer. | 66 // Let the message loop run to finish destroying the capturer. |
| 66 base::RunLoop().RunUntilIdle(); | 67 base::RunLoop().RunUntilIdle(); |
| 67 } | 68 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 INSTANTIATE_TEST_CASE_P( | 249 INSTANTIATE_TEST_CASE_P( |
| 249 , | 250 , |
| 250 CanvasCaptureHandlerTest, | 251 CanvasCaptureHandlerTest, |
| 251 ::testing::Combine(::testing::Bool(), | 252 ::testing::Combine(::testing::Bool(), |
| 252 ::testing::Values(kTestCanvasCaptureFrameEvenSize, | 253 ::testing::Values(kTestCanvasCaptureFrameEvenSize, |
| 253 kTestCanvasCaptureFrameOddSize), | 254 kTestCanvasCaptureFrameOddSize), |
| 254 ::testing::Values(kTestCanvasCaptureFrameEvenSize, | 255 ::testing::Values(kTestCanvasCaptureFrameEvenSize, |
| 255 kTestCanvasCaptureFrameOddSize))); | 256 kTestCanvasCaptureFrameOddSize))); |
| 256 | 257 |
| 257 } // namespace content | 258 } // namespace content |
| OLD | NEW |