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

Unified Diff: services/shape_detection/face_detection_impl_mac_unittest.mm

Issue 2859413002: Shape Detection: add idl and mojom for face landmarks and wire for Mac (Closed)
Patch Set: service-worker's global-interface-listing-expected.txt updated 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 e07f700fec91406423d9dba6a1bf22e88f703ed4..0c04b132b31663f1a042aad4370a1dd5ca4942fc 100644
--- a/services/shape_detection/face_detection_impl_mac_unittest.mm
+++ b/services/shape_detection/face_detection_impl_mac_unittest.mm
@@ -37,10 +37,15 @@ class FaceDetectionImplMacTest : public TestWithParam<bool> {
public:
~FaceDetectionImplMacTest() override {}
- void DetectCallback(mojom::FaceDetectionResultPtr results) {
- Detection(results->bounding_boxes.size());
+ void DetectCallback(std::vector<mojom::FaceDetectionResultPtr> results) {
+ ASSERT_EQ(1u, results.size());
+ ASSERT_EQ(3u, results[0]->landmarks.size());
+ EXPECT_EQ(mojom::LandmarkType::EYE, results[0]->landmarks[0]->type);
+ EXPECT_EQ(mojom::LandmarkType::EYE, results[0]->landmarks[1]->type);
+ EXPECT_EQ(mojom::LandmarkType::MOUTH, results[0]->landmarks[2]->type);
+ Detection();
}
- MOCK_METHOD1(Detection, void(size_t));
+ MOCK_METHOD0(Detection, void(void));
std::unique_ptr<FaceDetectionImplMac> impl_;
const base::MessageLoop message_loop_;
@@ -90,7 +95,7 @@ TEST_P(FaceDetectionImplMacTest, ScanOneFace) {
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(1)).WillOnce(RunClosure(quit_closure));
+ EXPECT_CALL(*this, Detection()).WillOnce(RunClosure(quit_closure));
impl_->Detect(std::move(handle), size.width(), size.height(),
base::Bind(&FaceDetectionImplMacTest::DetectCallback,
base::Unretained(this)));

Powered by Google App Engine
This is Rietveld 408576698