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

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

Issue 2626743002: Shape Detection: resolve with empty results if any input element's dimension is zero (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 *Detector.detect() returns an empty list when fed with
7 var createTestForEmptyInput = function(detectorName) { 7 // an empty HTMLImageElement.
8 var createTestForEmptyInput = function(createDetector) {
8 async_test(function(t) { 9 async_test(function(t) {
9 var image = new Image(); 10 var image = new Image();
10 var detector = eval("new " + detectorName + "();"); 11 var detector = createDetector();
11 var tryDetection = function() { 12 var tryDetection = function() {
12 detector.detect(image) 13 detector.detect(image)
13 .then(detectionResult => { 14 .then(detectionResult => {
14 assert_equals(detectionResult.length, 0); 15 assert_equals(detectionResult.length, 0);
15 t.done(); 16 t.done();
16 }) 17 })
17 .catch(error => { 18 .catch(error => {
18 assert_unreached("detect() rejected with error: " + error) 19 assert_unreached("detect() rejected with error: " + error)
19 }); 20 });
20 }; 21 };
21 image.onload = tryDetection; 22 image.onload = tryDetection;
22 image.onerror = tryDetection; 23 image.onerror = tryDetection;
23 image.src = ""; 24 image.src = "";
24 }, "Detectors should resolve empty images with empty results."); 25 }, "Detectors should resolve empty images with empty results.");
25 }; 26 };
26 27
27 generate_tests(createTestForEmptyInput, [ 28 generate_tests(createTestForEmptyInput, [
28 [ "Face", "FaceDetector" ], 29 [ "Face", () => { return new FaceDetector(); } ],
29 [ "Barcode", "BarcodeDetector" ], 30 [ "Barcode", () => { return new BarcodeDetector(); } ],
30 [ "Text", "TextDetector" ] 31 [ "Text", () => { return new TextDetector(); } ]
31 ]); 32 ]);
32 33
33 </script> 34 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698