| 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/memory/weak_ptr.h" | 5 #include "base/memory/weak_ptr.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "content/renderer/media/html_video_element_capturer_source.h" | 8 #include "content/renderer/media/html_video_element_capturer_source.h" |
| 9 #include "media/base/limits.h" | 9 #include "media/base/limits.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 bool didPassCORSAccessCheck() const override { return true; } | 67 bool didPassCORSAccessCheck() const override { return true; } |
| 68 double mediaTimeForTimeValue(double timeValue) const override { return 0.0; } | 68 double mediaTimeForTimeValue(double timeValue) const override { return 0.0; } |
| 69 unsigned decodedFrameCount() const override { return 0; } | 69 unsigned decodedFrameCount() const override { return 0; } |
| 70 unsigned droppedFrameCount() const override { return 0; } | 70 unsigned droppedFrameCount() const override { return 0; } |
| 71 unsigned corruptedFrameCount() const override { return 0; } | 71 unsigned corruptedFrameCount() const override { return 0; } |
| 72 size_t audioDecodedByteCount() const override { return 0; } | 72 size_t audioDecodedByteCount() const override { return 0; } |
| 73 size_t videoDecodedByteCount() const override { return 0; } | 73 size_t videoDecodedByteCount() const override { return 0; } |
| 74 | 74 |
| 75 void paint(blink::WebCanvas* canvas, | 75 void paint(blink::WebCanvas* canvas, |
| 76 const blink::WebRect& paint_rectangle, | 76 const blink::WebRect& paint_rectangle, |
| 77 unsigned char alpha, | 77 const SkPaint*) override { |
| 78 SkXfermode::Mode mode) override { | |
| 79 // We could fill in |canvas| with a meaningful pattern in ARGB and verify | 78 // We could fill in |canvas| with a meaningful pattern in ARGB and verify |
| 80 // that is correctly captured (as I420) by HTMLVideoElementCapturerSource | 79 // that is correctly captured (as I420) by HTMLVideoElementCapturerSource |
| 81 // but I don't think that'll be easy/useful/robust, so just let go here. | 80 // but I don't think that'll be easy/useful/robust, so just let go here. |
| 82 return; | 81 return; |
| 83 } | 82 } |
| 84 }; | 83 }; |
| 85 | 84 |
| 86 class HTMLVideoElementCapturerSourceTest : public testing::Test { | 85 class HTMLVideoElementCapturerSourceTest : public testing::Test { |
| 87 public: | 86 public: |
| 88 HTMLVideoElementCapturerSourceTest() | 87 HTMLVideoElementCapturerSourceTest() |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 base::Bind(&HTMLVideoElementCapturerSourceTest::OnRunning, | 161 base::Bind(&HTMLVideoElementCapturerSourceTest::OnRunning, |
| 163 base::Unretained(this))); | 162 base::Unretained(this))); |
| 164 | 163 |
| 165 run_loop.Run(); | 164 run_loop.Run(); |
| 166 | 165 |
| 167 html_video_capturer_->StopCapture(); | 166 html_video_capturer_->StopCapture(); |
| 168 Mock::VerifyAndClearExpectations(this); | 167 Mock::VerifyAndClearExpectations(this); |
| 169 } | 168 } |
| 170 | 169 |
| 171 } // namespace content | 170 } // namespace content |
| OLD | NEW |