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

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

Issue 2448193002: ShapeDetection: support CanvasImageSource as detect() source (Closed)
Patch Set: esprehn@ comments and specific LayoutTest for empty HTMLImageElement Created 4 years, 2 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-empty-input.html
diff --git a/third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-empty-input.html b/third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-empty-input.html
new file mode 100644
index 0000000000000000000000000000000000000000..10e9c54d246fe708abd01a86179851039732dca5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-empty-input.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<script>
+
+// This test verifies FaceDetector.detect() with an empty HTMLImageElement.
+async_test(function(t) {
+ var image = new Image();
+ var faceDetector = new FaceDetector();
+ var tryFaceDetection = function() {
+ faceDetector.detect(image)
+ .then(faceDetectionResult => {
+ assert_equals(faceDetectionResult.length, 0);
+ t.done();
+ })
+ .catch(error => {
+ assert_unreached("detect() should not reject: " + error)
+ });
+ };
+ image.onload = tryFaceDetection;
+ image.onerror = tryFaceDetection;
+ image.src = "";
+}, "FaceDetector should resolve empty images with empty results.");
+
+</script>
« 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