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

Unified Diff: media/capture/video/video_capture_device_unittest.cc

Issue 2359243002: VideoCaptureDeviceTest: improve error logging (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_capture_device_unittest.cc
diff --git a/media/capture/video/video_capture_device_unittest.cc b/media/capture/video/video_capture_device_unittest.cc
index 11031fec944b74abf4c0bca026dcd47d6706e7fe..500e9662f2602aaa72a71ca44e6424fa43d6fede 100644
--- a/media/capture/video/video_capture_device_unittest.cc
+++ b/media/capture/video/video_capture_device_unittest.cc
@@ -72,11 +72,18 @@
#endif
using ::testing::_;
+using ::testing::Invoke;
using ::testing::SaveArg;
+using ::testing::WithArgs;
namespace media {
namespace {
+void DumpError(const tracked_objects::Location& location,
+ const std::string& message) {
+ DPLOG(ERROR) << location.ToString() << " " << message;
+}
+
class MockVideoCaptureClient : public VideoCaptureDevice::Client {
public:
MOCK_METHOD0(DoReserveOutputBuffer, void(void));
@@ -90,8 +97,10 @@ class MockVideoCaptureClient : public VideoCaptureDevice::Client {
explicit MockVideoCaptureClient(
base::Callback<void(const VideoCaptureFormat&)> frame_cb)
- : main_thread_(base::ThreadTaskRunnerHandle::Get()),
- frame_cb_(frame_cb) {}
+ : main_thread_(base::ThreadTaskRunnerHandle::Get()), frame_cb_(frame_cb) {
+ ON_CALL(*this, OnError(_, _))
+ .WillByDefault(WithArgs<0, 1>(Invoke(DumpError)));
chfremer 2016/09/22 17:44:18 Is the WithArgs<0, 1> really needed? It seems the
mcasas 2016/09/22 17:58:36 Ooops, isn't needed indeed, it's a leftover from a
+ }
void OnIncomingCapturedData(const uint8_t* data,
int length,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698