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

Side by Side Diff: third_party/WebKit/LayoutTests/shapedetection/resources/worker.js

Issue 2629523008: Shape Detection: Remove ConstructorCallWith=Document (Closed)
Patch Set: Add layout test for worker 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
OLDNEW
(Empty)
1 importScripts("../../resources/testharness.js");
2
3 onmessage = function(e) {
4 var detector;
5 switch (e.data.detectorType) {
6 case "Face": detector = new FaceDetector(); break;
7 case "Barcode": detector = new BarcodeDetector(); break;
8 case "Text": detector = new TextDetector(); break;
9 }
10
11 var imageBitmap = e.data.bitmap;
12 detector.detect(imageBitmap)
13 .then(detectionResult => {
14 assert_equals(detectionResult.length, e.data.expectedLength,
15 "Number of " + e.data.detectorType);
16 postMessage("PASS");
17 })
18 .catch(error => {
19 assert_unreached("Error during detect(img): " + error);
20 });
21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698