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

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

Issue 2857803002: Shape Detection: reconnect LayoutTests (Closed)
Patch Set: Removed expectation files and corrected shapedetection-empty-input test Created 3 years, 7 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 *Detector.detect() returns an empty list when fed with 6 // This test verifies *Detector.detect() returns an empty list when fed with
7 // an empty HTMLImageElement. 7 // an empty HTMLImageElement.
8 var createTestForEmptyInput = function(createDetector) { 8 var createTestForEmptyInput = function(createDetector) {
9 async_test(function(t) { 9 async_test(function(t) {
10 var image = new Image(); 10 var image = new Image();
11 var detector = createDetector(); 11 var detector = createDetector();
12 var tryDetection = function() { 12 var tryDetection = function() {
13 detector.detect(image) 13 detector.detect(image)
14 .then(detectionResult => { 14 .then(detectionResult => {
15 assert_equals(detectionResult.length, 0); 15 assert_equals(detectionResult.length, 0);
16 t.done(); 16 t.done();
17 }) 17 })
18 .catch(error => { 18 .catch(error => {
19 assert_unreached("detect() rejected with error: " + error) 19 assert_unreached("detect() rejected with error: " + error)
20 }); 20 });
21 }; 21 };
22 image.onload = tryDetection; 22 image.onload = tryDetection;
23 image.onerror = tryDetection; 23 image.onerror = tryDetection;
24 image.src = ""; 24 image.src = "";
25 }, "Detectors should resolve empty images with empty results."); 25 });
26 }; 26 };
27 27
28 generate_tests(createTestForEmptyInput, [ 28 generate_tests(createTestForEmptyInput, [
29 [ "Face", () => { return new FaceDetector(); } ], 29 [ "Face - detect(empty)", () => { return new FaceDetector(); } ],
30 [ "Barcode", () => { return new BarcodeDetector(); } ], 30 [ "Barcode - detect(empty)", () => { return new BarcodeDetector(); } ],
31 [ "Text", () => { return new TextDetector(); } ] 31 [ "Text - detect(empty)", () => { return new TextDetector(); } ]
32 ]); 32 ]);
33 33
34 </script> 34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698