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

Unified Diff: services/shape_detection/face_detection_impl_mac_unittest.mm

Issue 2875243002: RELAND: ShapeDetection: use mojom::Bitmap for mojo interface. (Closed)
Patch Set: RELAND2: ShapeDetection: use mojom::Bitmap for mojo interface. Created 3 years, 7 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
Index: services/shape_detection/face_detection_impl_mac_unittest.mm
diff --git a/services/shape_detection/face_detection_impl_mac_unittest.mm b/services/shape_detection/face_detection_impl_mac_unittest.mm
index d5f52757ad19bcee0dd2c02e7bbb1b0e1952b559..c8c2ed6bca55ef1979c0bb3de92ae19684cf046d 100644
--- a/services/shape_detection/face_detection_impl_mac_unittest.mm
+++ b/services/shape_detection/face_detection_impl_mac_unittest.mm
@@ -82,24 +82,12 @@ TEST_P(FaceDetectionImplMacTest, ScanOneFace) {
const int num_bytes = size.GetArea() * 4 /* bytes per pixel */;
ASSERT_EQ(num_bytes, image->computeSize64());
- // Generate a new ScopedSharedBufferHandle of the aproppriate size, map it and
- // copy the image pixels into it.
- mojo::ScopedSharedBufferHandle handle =
- mojo::SharedBufferHandle::Create(num_bytes);
- ASSERT_TRUE(handle->is_valid());
-
- mojo::ScopedSharedBufferMapping mapping = handle->Map(num_bytes);
- ASSERT_TRUE(mapping);
-
- memcpy(mapping.get(), image->getPixels(), num_bytes);
-
base::RunLoop run_loop;
base::Closure quit_closure = run_loop.QuitClosure();
// Send the image to Detect() and expect the response in callback.
EXPECT_CALL(*this, Detection()).WillOnce(RunClosure(quit_closure));
- impl_->Detect(std::move(handle), size.width(), size.height(),
- base::Bind(&FaceDetectionImplMacTest::DetectCallback,
- base::Unretained(this)));
+ impl_->Detect(*image, base::Bind(&FaceDetectionImplMacTest::DetectCallback,
+ base::Unretained(this)));
run_loop.Run();
}
« no previous file with comments | « services/shape_detection/face_detection_impl_mac.mm ('k') | services/shape_detection/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698