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

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

Issue 2588293005: Shape Detection: Add Text Detection in Chrome Android (Closed)
Patch Set: jochen@ comments, rebase Created 3 years, 11 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 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 var createTestForEmptyInput = function(detectorName) { 7 var createTestForEmptyInput = function(detectorName) {
8 async_test(function(t) { 8 async_test(function(t) {
9 var image = new Image(); 9 var image = new Image();
10 var detector = eval("new " + detectorName + "();"); 10 var detector = eval("new " + detectorName + "();");
11 var tryDetection = function() { 11 var tryDetection = function() {
12 detector.detect(image) 12 detector.detect(image)
13 .then(detectionResult => { 13 .then(detectionResult => {
14 assert_equals(detectionResult.length, 0); 14 assert_equals(detectionResult.length, 0);
15 t.done(); 15 t.done();
16 }) 16 })
17 .catch(error => { 17 .catch(error => {
18 assert_unreached("detect() rejected with error: " + error) 18 assert_unreached("detect() rejected with error: " + error)
19 }); 19 });
20 }; 20 };
21 image.onload = tryDetection; 21 image.onload = tryDetection;
22 image.onerror = tryDetection; 22 image.onerror = tryDetection;
23 image.src = ""; 23 image.src = "";
24 }, "Detectors should resolve empty images with empty results."); 24 }, "Detectors should resolve empty images with empty results.");
25 }; 25 };
26 26
27 generate_tests(createTestForEmptyInput, [ 27 generate_tests(createTestForEmptyInput, [
28 [ "Face", "FaceDetector" ], [ "Barcode", "BarcodeDetector" ] 28 [ "Face", "FaceDetector" ],
29 [ "Barcode", "BarcodeDetector" ],
30 [ "Text", "TextDetector" ]
29 ]); 31 ]);
30 32
31 </script> 33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698