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

Unified Diff: content/test/data/media/face_detection_test.html

Issue 2419273002: Shape Detection: Add two content browser tests for face detection (Closed)
Patch Set: Move MAYBE_ to the test fixture class Created 4 years, 2 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/test/BUILD.gn ('k') | content/test/data/single_face.jpg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/media/face_detection_test.html
diff --git a/content/test/data/media/face_detection_test.html b/content/test/data/media/face_detection_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..9efa5f8238e8eaf57eb9a72ad6db5fe26a2c40f9
--- /dev/null
+++ b/content/test/data/media/face_detection_test.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+
+<body>
+ <img id="myImage">
+</body>
+
+<script>
+ var img = document.getElementById("myImage");
+
+ function detectFacesOnImageUrl(url) {
+ img.src = url;
+ img.onload = function() {
+ var detector = new FaceDetector();
+ var results = "";
+ detector.detect(img)
+ .then(boundingBoxes => {
+ for (var i=0; i<boundingBoxes.length; i++) {
+ var boundingBox = boundingBoxes[i];
+ var result = boundingBox.x + "," + boundingBox.y + "," +
+ boundingBox.width + "," + boundingBox.height;
+ results += result + "#";
+ }
+ window.domAutomationController.send(results);
+ })
+ .catch(error => {
+ error = new Error("Error during detection:" + error);
+ window.domAutomationController.send(error.stack);
+ });
+ }
+ }
+ </script>
+</html>
« no previous file with comments | « content/test/BUILD.gn ('k') | content/test/data/single_face.jpg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698