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

Unified Diff: third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html

Issue 2756793002: RELAND: Shape Detection: move the Mac service to the sandboxed GPU process (Closed)
Patch Set: moved shapedetection-security-test.html to non-fast LayoutTests to use the mock mojo service Created 3 years, 9 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
Index: third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html
diff --git a/third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html b/third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html
deleted file mode 100644
index 9a03b2ea83dacc8bf8871bee2634ce1612e696fa..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html>
-<script src=../../resources/testharness.js></script>
-<script src=../../resources/testharnessreport.js></script>
-<script>
-
-// Returns a Promise that is resolve()d if detect() is rejected. Needs an input
-// |element| (e.g. an HTMLImageElement or HTMLVideoElement) and a |url| to load.
-function detectOnElementAndExpectError(createDetector, element, url) {
- return new Promise(function(resolve, reject) {
- var tryDetection = function() {
- var detector = createDetector();
- detector.detect(element)
- .then(detectionResult => {
- reject("Promise should have been rejected.");
- })
- .catch(error => {
- resolve(error);
- });
- };
- element.onload = tryDetection;
- element.onerror = tryDetection;
- element.src = url;
- });
-};
-
-// This test verifies that a Detector will reject an undecodable image.
-var createTestForBadImage = function(createDetector) {
- promise_test(function(t) {
- var image = new Image();
- return detectOnElementAndExpectError(createDetector, image,
- "../../external/wpt/images/broken.png")
- .then(function(error) {
- assert_equals(error.name, "InvalidStateError");
- });
- }, "Detector should reject undecodable images with an InvalidStateError.");
-};
-
-generate_tests(createTestForBadImage, [
- [ "Face", () => { return new FaceDetector(); } ],
- [ "Barcode", () => { return new BarcodeDetector(); } ],
- [ "Text", () => { return new TextDetector(); } ]
-]);
-
-// This test verifies that a Detector will reject a broken video.
-var createTestForBadVideo = function(createDetector) {
- promise_test(function(t) {
- var video = document.createElement('video');
- return detectOnElementAndExpectError(createDetector, video,
- "content/garbage.webm")
- .then(function(error) {
- assert_equals(error.name, "InvalidStateError");
- });
- }, "Detector should reject undecodable videos with an InvalidStateError.");
-};
-
-generate_tests(createTestForBadVideo, [
- [ "Face", () => { return new FaceDetector(); } ],
- [ "Barcode", () => { return new BarcodeDetector(); } ],
- [ "Text", () => { return new TextDetector(); } ]
-]);
-
-</script>
« no previous file with comments | « content/gpu/gpu_service_factory.cc ('k') | third_party/WebKit/LayoutTests/shapedetection/detection-security-test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698