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

Side by Side Diff: media/capture/video/fake_video_capture_device_unittest.cc

Issue 2062333002: mojo::Callback -> base::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « mash/app_driver/app_driver.cc ('k') | media/capture/video/scoped_result_callback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/capture/video/fake_video_capture_device.h" 5 #include "media/capture/video/fake_video_capture_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 private: 132 private:
133 friend class base::RefCounted<DeviceEnumerationListener>; 133 friend class base::RefCounted<DeviceEnumerationListener>;
134 virtual ~DeviceEnumerationListener() {} 134 virtual ~DeviceEnumerationListener() {}
135 }; 135 };
136 136
137 class PhotoTakenListener : public base::RefCounted<PhotoTakenListener> { 137 class PhotoTakenListener : public base::RefCounted<PhotoTakenListener> {
138 public: 138 public:
139 MOCK_METHOD0(OnCorrectPhotoTaken, void(void)); 139 MOCK_METHOD0(OnCorrectPhotoTaken, void(void));
140 // GMock doesn't support move-only arguments, so we use this forward method. 140 // GMock doesn't support move-only arguments, so we use this forward method.
141 void DoOnPhotoTaken(const mojo::String& mime_type, 141 void DoOnPhotoTaken(mojo::String mime_type, mojo::Array<uint8_t> data) {
142 mojo::Array<uint8_t> data) {
143 // Only PNG images are supported right now. 142 // Only PNG images are supported right now.
144 EXPECT_STREQ("image/png", mime_type.storage().c_str()); 143 EXPECT_STREQ("image/png", mime_type.storage().c_str());
145 // Not worth decoding the incoming data. Just check that the header is PNG. 144 // Not worth decoding the incoming data. Just check that the header is PNG.
146 // http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-sign ature 145 // http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-sign ature
147 ASSERT_GT(data.size(), 4u); 146 ASSERT_GT(data.size(), 4u);
148 EXPECT_EQ('P', data[1]); 147 EXPECT_EQ('P', data[1]);
149 EXPECT_EQ('N', data[2]); 148 EXPECT_EQ('N', data[2]);
150 EXPECT_EQ('G', data[3]); 149 EXPECT_EQ('G', data[3]);
151 OnCorrectPhotoTaken(); 150 OnCorrectPhotoTaken();
152 } 151 }
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 } 325 }
327 } 326 }
328 327
329 INSTANTIATE_TEST_CASE_P(, 328 INSTANTIATE_TEST_CASE_P(,
330 FakeVideoCaptureDeviceCommandLineTest, 329 FakeVideoCaptureDeviceCommandLineTest,
331 Values(CommandLineTestData{"fps=-1", 5}, 330 Values(CommandLineTestData{"fps=-1", 5},
332 CommandLineTestData{"fps=29.97", 29.97f}, 331 CommandLineTestData{"fps=29.97", 29.97f},
333 CommandLineTestData{"fps=60", 60}, 332 CommandLineTestData{"fps=60", 60},
334 CommandLineTestData{"fps=1000", 60})); 333 CommandLineTestData{"fps=1000", 60}));
335 }; // namespace media 334 }; // namespace media
OLDNEW
« no previous file with comments | « mash/app_driver/app_driver.cc ('k') | media/capture/video/scoped_result_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698