| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/media/video_capture_host.h" | 5 #include "content/browser/renderer_host/media/video_capture_host.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 std::map<int, base::SharedMemory*>::iterator it = filled_dib_.begin(); | 169 std::map<int, base::SharedMemory*>::iterator it = filled_dib_.begin(); |
| 170 int h = it->first; | 170 int h = it->first; |
| 171 delete it->second; | 171 delete it->second; |
| 172 filled_dib_.erase(it); | 172 filled_dib_.erase(it); |
| 173 | 173 |
| 174 return h; | 174 return h; |
| 175 } | 175 } |
| 176 | 176 |
| 177 private: | 177 private: |
| 178 ~MockVideoCaptureHost() override { | 178 ~MockVideoCaptureHost() override { |
| 179 STLDeleteContainerPairSecondPointers(filled_dib_.begin(), | 179 base::STLDeleteContainerPairSecondPointers(filled_dib_.begin(), |
| 180 filled_dib_.end()); | 180 filled_dib_.end()); |
| 181 } | 181 } |
| 182 | 182 |
| 183 // This method is used to dispatch IPC messages to the renderer. We intercept | 183 // This method is used to dispatch IPC messages to the renderer. We intercept |
| 184 // these messages here and dispatch to our mock methods to verify the | 184 // these messages here and dispatch to our mock methods to verify the |
| 185 // conversation between this object and the renderer. | 185 // conversation between this object and the renderer. |
| 186 bool Send(IPC::Message* message) override { | 186 bool Send(IPC::Message* message) override { |
| 187 CHECK(message); | 187 CHECK(message); |
| 188 | 188 |
| 189 // In this method we dispatch the messages to the according handlers as if | 189 // In this method we dispatch the messages to the according handlers as if |
| 190 // we are the renderer. | 190 // we are the renderer. |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 #ifdef DUMP_VIDEO | 541 #ifdef DUMP_VIDEO |
| 542 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { | 542 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { |
| 543 CaptureAndDumpVideo(640, 480, 30); | 543 CaptureAndDumpVideo(640, 480, 30); |
| 544 } | 544 } |
| 545 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { | 545 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { |
| 546 CaptureAndDumpVideo(1280, 720, 30); | 546 CaptureAndDumpVideo(1280, 720, 30); |
| 547 } | 547 } |
| 548 #endif | 548 #endif |
| 549 | 549 |
| 550 } // namespace content | 550 } // namespace content |
| OLD | NEW |