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

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

Issue 2711893003: Shape detection: moar content_browsertests (face, qr/barcode) (Closed)
Patch Set: Make initialization of std::vector<std::vector<float>> explicit to avoid 'error: chosen constructor… Created 3 years, 10 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/data/media/face_detection_test.html ('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/shape_detection_test.html
diff --git a/content/test/data/media/face_detection_test.html b/content/test/data/media/shape_detection_test.html
similarity index 60%
rename from content/test/data/media/face_detection_test.html
rename to content/test/data/media/shape_detection_test.html
index 16b5dd73cb5c4ecbf979cab6dfec5d6460afb773..6f098369651d2f4d304003971d015073f018805b 100644
--- a/content/test/data/media/face_detection_test.html
+++ b/content/test/data/media/shape_detection_test.html
@@ -10,15 +10,17 @@
<script>
var img = document.getElementById("myImage");
- function detectFacesOnImageUrl(url) {
- img.src = url;
+ function detectShapesOnImageUrl(detector, url) {
+ var detector = eval('new ' + detector + '()');
+ console.log(detector);
img.onload = function() {
- var detector = new FaceDetector();
+ console.log('image loaded');
var results = "";
detector.detect(img)
- .then(detectedFaces => {
- for (var i = 0; i < detectedFaces.length; i++) {
- var boundingBox = detectedFaces[i].boundingBox;
+ .then(detectedObjects => {
+ console.log('something detected');
+ for (var i = 0; i < detectedObjects.length; i++) {
+ var boundingBox = detectedObjects[i].boundingBox;
var result = boundingBox.x + "," + boundingBox.y + "," +
boundingBox.width + "," + boundingBox.height;
results += result + "#";
@@ -26,10 +28,11 @@
window.domAutomationController.send(results);
})
.catch(error => {
- error = new Error("Error during detection:" + error.message);
+ console.error(error.mesage);
window.domAutomationController.send(error.message);
});
}
+ img.src = url;
}
</script>
</html>
« no previous file with comments | « content/test/data/media/face_detection_test.html ('k') | content/test/data/single_face.jpg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698