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

Side by Side Diff: third_party/WebKit/LayoutTests/shapedetection/detection-security-test.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
« no previous file with comments | « third_party/WebKit/LayoutTests/shapedetection/detection-ImageData.html ('k') | no next file » | 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 src="../resources/mojo-helpers.js"></script> 4 <script src="../resources/mojo-helpers.js"></script>
5 <script src="resources/mock-facedetection.js"></script> 5 <script src="resources/mock-facedetection.js"></script>
6 <script> 6 <script>
7 7
8 // Returns a Promise that is resolve()d if detect() is rejected. Needs an input 8 // Returns a Promise that is resolve()d if detect() is rejected. Needs an input
9 // |element| (e.g. an HTMLImageElement or HTMLVideoElement) and a |url| to load. 9 // |element| (e.g. an HTMLImageElement or HTMLVideoElement) and a |url| to load.
10 function detectOnElementAndExpectError(createDetector, element, url) { 10 function detectOnElementAndExpectError(createDetector, element, url) {
(...skipping 22 matching lines...) Expand all
33 33
34 // This test verifies that a Detector will reject an undecodable image. 34 // This test verifies that a Detector will reject an undecodable image.
35 var createTestForBadImage = function(createDetector) { 35 var createTestForBadImage = function(createDetector) {
36 promise_test(function(t) { 36 promise_test(function(t) {
37 var image = new Image(); 37 var image = new Image();
38 return detectOnElementAndExpectError(createDetector, image, 38 return detectOnElementAndExpectError(createDetector, image,
39 "../external/wpt/images/broken.png") 39 "../external/wpt/images/broken.png")
40 .then(function(error) { 40 .then(function(error) {
41 assert_equals(error.name, "InvalidStateError"); 41 assert_equals(error.name, "InvalidStateError");
42 }); 42 });
43 }, "Detector should reject undecodable images with an InvalidStateError."); 43 });
44 }; 44 };
45 45
46 // Detectors should reject undecodable images with an InvalidStateError.
46 generate_tests(createTestForBadImage, [ 47 generate_tests(createTestForBadImage, [
47 [ "Face", () => { return new FaceDetector(); } ], 48 [ "Face - detect(broken image)", () => { return new FaceDetector(); } ],
48 [ "Barcode", () => { return new BarcodeDetector(); } ], 49 [ "Barcode - detect(broken image)", () => { return new BarcodeDetector(); } ],
49 [ "Text", () => { return new TextDetector(); } ] 50 [ "Text - detect(broken image)", () => { return new TextDetector(); } ]
50 ]); 51 ]);
51 52
52 // This test verifies that a Detector will reject a broken video. 53 // This test verifies that a Detector will reject a broken video.
53 var createTestForBadVideo = function(createDetector) { 54 var createTestForBadVideo = function(createDetector) {
54 promise_test(function(t) { 55 promise_test(function(t) {
55 var video = document.createElement('video'); 56 var video = document.createElement('video');
56 return detectOnElementAndExpectError(createDetector, video, 57 return detectOnElementAndExpectError(createDetector, video,
57 "content/garbage.webm") 58 "content/garbage.webm")
58 .then(function(error) { 59 .then(function(error) {
59 assert_equals(error.name, "InvalidStateError"); 60 assert_equals(error.name, "InvalidStateError");
60 }); 61 });
61 }, "Detector should reject undecodable videos with an InvalidStateError."); 62 });
62 }; 63 };
63 64
65 // Detectors should reject undecodable videos with an InvalidStateError.
64 generate_tests(createTestForBadVideo, [ 66 generate_tests(createTestForBadVideo, [
65 [ "Face", () => { return new FaceDetector(); } ], 67 [ "Face - detect(broken video)", () => { return new FaceDetector(); } ],
66 [ "Barcode", () => { return new BarcodeDetector(); } ], 68 [ "Barcode - detect(broken video)", () => { return new BarcodeDetector(); } ],
67 [ "Text", () => { return new TextDetector(); } ] 69 [ "Text - detect(broken video)", () => { return new TextDetector(); } ]
68 ]); 70 ]);
69 71
70 </script> 72 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/shapedetection/detection-ImageData.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698