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

Unified Diff: content/browser/shapedetection/shapedetection_browsertest.cc

Issue 2528743002: Shape Detection: Implement FaceDetection on Mac as out-of-process service (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « content/browser/shapedetection/face_detection_service_dispatcher.h ('k') | content/public/app/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/shapedetection/shapedetection_browsertest.cc
diff --git a/content/browser/shapedetection/shapedetection_browsertest.cc b/content/browser/shapedetection/shapedetection_browsertest.cc
index fa24aa4745c169cb2b46aa6887162e5e44705b6d..9d9c1e2a004ac42c9e147839c212451441ee0f5d 100644
--- a/content/browser/shapedetection/shapedetection_browsertest.cc
+++ b/content/browser/shapedetection/shapedetection_browsertest.cc
@@ -11,8 +11,8 @@
namespace content {
-// TODO(xianglu): Enable other platforms with support. https://crbug.com/646083
-#if defined(OS_ANDROID)
+// TODO(xianglu): Enable other platforms support. https://crbug.com/646083
+#if defined(OS_ANDROID) || defined(OS_MACOSX)
#define MAYBE_ShapeDetectionBrowserTest ShapeDetectionBrowserTest
#else
#define MAYBE_ShapeDetectionBrowserTest DISABLED_ShapeDetectionBrowserTest
@@ -25,11 +25,11 @@ const char kFaceDetectionTestHtml[] = "/media/face_detection_test.html";
} // namespace
// This class contains content_browsertests for Shape Detection API, which
-// allows for generating bounding boxes for faces on still images..
+// allows for generating bounding boxes in still images.
class MAYBE_ShapeDetectionBrowserTest : public ContentBrowserTest {
public:
void SetUpCommandLine(base::CommandLine* command_line) override {
- // Specific flag to enable ShapeDetection and DOMRect API.
+ // Flag to enable ShapeDetection and DOMRect API.
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kEnableBlinkFeatures, "ShapeDetection, GeometryInterfaces");
}
@@ -65,7 +65,7 @@ class MAYBE_ShapeDetectionBrowserTest : public ContentBrowserTest {
const std::vector<float> expected_result = expected_results[face_id];
const std::vector<float> result = results[face_id];
for (size_t i = 0; i < 4; ++i)
- EXPECT_NEAR(expected_result[i], result[i], 0.1) << "At index " << i;
+ EXPECT_NEAR(expected_result[i], result[i], 2) << "At index " << i;
}
}
};
@@ -80,9 +80,16 @@ IN_PROC_BROWSER_TEST_F(MAYBE_ShapeDetectionBrowserTest,
IN_PROC_BROWSER_TEST_F(MAYBE_ShapeDetectionBrowserTest,
DetectFacesOnImageWithOneFace) {
const std::string image_path = "/single_face.jpg";
+ std::vector<std::vector<float>> expected_results;
+#if defined(OS_ANDROID)
const std::vector<float> expected_result = {68.640625, 102.96875, 171.5625,
171.5625};
- const std::vector<std::vector<float>> expected_results = {expected_result};
+ expected_results.push_back(expected_result);
+#elif defined(OS_MACOSX)
+ const std::vector<float> expected_result = {0, 93, 290, 290};
+ expected_results.push_back(expected_result);
+#endif
+
RunDetectFacesOnImageUrl(image_path, expected_results);
}
« no previous file with comments | « content/browser/shapedetection/face_detection_service_dispatcher.h ('k') | content/public/app/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698