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

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

Issue 2502723002: ShapeDetection: implement barcode detection, blink part (Closed)
Patch Set: haraken@ 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 var createTestForEmptyInput = function(detectorName) {
8 var image = new Image(); 8 async_test(function(t) {
9 var faceDetector = new FaceDetector(); 9 var image = new Image();
10 var tryFaceDetection = function() { 10 var detector = eval("new " + detectorName + "();");
11 faceDetector.detect(image) 11 var tryDetection = function() {
12 .then(faceDetectionResult => { 12 detector.detect(image)
13 assert_equals(faceDetectionResult.length, 0); 13 .then(detectionResult => {
14 t.done(); 14 assert_equals(detectionResult.length, 0);
15 }) 15 t.done();
16 .catch(error => { 16 })
17 assert_unreached("detect() rejected with error: " + error) 17 .catch(error => {
18 }); 18 assert_unreached("detect() rejected with error: " + error)
19 }; 19 });
20 image.onload = tryFaceDetection; 20 };
21 image.onerror = tryFaceDetection; 21 image.onload = tryDetection;
22 image.src = ""; 22 image.onerror = tryDetection;
23 }, "FaceDetector should resolve empty images with empty results."); 23 image.src = "";
24 }, "Detectors should resolve empty images with empty results.");
25 };
26
27 generate_tests(createTestForEmptyInput, [
28 [ "Face", "FaceDetector" ], [ "Barcode", "BarcodeDetector" ]
29 ]);
24 30
25 </script> 31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698