| 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..f7566473fb33b2396f79f51af757fdacfe0068f7
|
| --- /dev/null
|
| +++ b/content/test/data/media/face_detection_test.html
|
| @@ -0,0 +1,36 @@
|
| +<!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(faceDetectionResult => {
|
| + for (var i=0; i<faceDetectionResult.length; i++) {
|
| + var boundingBox = faceDetectionResult[i];
|
| + var result = "x=" + boundingBox.x + ",y=" + boundingBox.y +
|
| + ",w=" + boundingBox.width + ",h=" + boundingBox.height;
|
| + results += result + "#";
|
| + }
|
| + window.domAutomationController.send(results);
|
| + })
|
| + .catch(error => {
|
| + var error = new Error("Error during detection:" + error);
|
| + window.domAutomationController.send(error.stack);
|
| + });
|
| +
|
| + }
|
| + }
|
| +</script>
|
| +</html>
|
|
|