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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-empty-input.html

Issue 2455973007: FaceDetection: add support for <video> input (Closed)
Patch Set: xianglu@ comments Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src=../../resources/testharness.js></script> 2 <script src=../../resources/testharness.js></script>
3 <script src=../../resources/testharnessreport.js></script> 3 <script src=../../resources/testharnessreport.js></script>
4 <script> 4 <script>
5 5
6 // This test verifies FaceDetector.detect() with an empty HTMLImageElement. 6 // This test verifies FaceDetector.detect() with an empty HTMLImageElement.
7 async_test(function(t) { 7 async_test(function(t) {
8 var image = new Image(); 8 var image = new Image();
9 var faceDetector = new FaceDetector(); 9 var faceDetector = new FaceDetector();
10 var tryFaceDetection = function() { 10 var tryFaceDetection = function() {
11 faceDetector.detect(image) 11 faceDetector.detect(image)
12 .then(faceDetectionResult => { 12 .then(faceDetectionResult => {
13 assert_equals(faceDetectionResult.length, 0); 13 assert_equals(faceDetectionResult.length, 0);
14 t.done(); 14 t.done();
15 }) 15 })
16 .catch(error => { 16 .catch(error => {
17 assert_unreached("detect() should not reject: " + error) 17 assert_unreached("detect() rejected with error: " + error)
18 }); 18 });
19 }; 19 };
20 image.onload = tryFaceDetection; 20 image.onload = tryFaceDetection;
21 image.onerror = tryFaceDetection; 21 image.onerror = tryFaceDetection;
22 image.src = ""; 22 image.src = "";
23 }, "FaceDetector should resolve empty images with empty results."); 23 }, "FaceDetector should resolve empty images with empty results.");
24 24
25 </script> 25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698