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

Unified Diff: third_party/WebKit/LayoutTests/shapedetection/detection-HTMLVideoElement.html

Issue 2553343003: ShapeDetection: add support for all CanvasImageSource input types (Closed)
Patch Set: reillyg@s comments Created 4 years 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/shapedetection/detection-HTMLVideoElement.html
diff --git a/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLVideoElement.html b/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLVideoElement.html
index 879251e20df9c337b5b54789e14aaf0e53932206..65ef40e77cb3e6390d582a8e8ce225ab4809db22 100644
--- a/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLVideoElement.html
+++ b/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLVideoElement.html
@@ -6,10 +6,10 @@
<script src="resources/mock-facedetection.js"></script>
<script>
-var createTestForVideoElement = function(detectorName, mockReady,
+var createTestForVideoElement = function(createDetector, mockReady,
detectionResultTest) {
async_test(function(t) {
- var video = document.createElement('video');
+ var video = document.createElement("video");
video.src = "../imported/wpt/media/white.webm";
video.loop = true;
video.autoplay = true;
@@ -19,11 +19,11 @@ var createTestForVideoElement = function(detectorName, mockReady,
mockReady()
.then(mock => {
theMock = mock;
- var detector = eval("new " + detectorName + "();");
+ var detector = createDetector();
return detector;
})
.catch(error => {
- assert_unreached("Error creating MockFaceDetection: " + error);
+ assert_unreached("Error creating Mock Detector: " + error);
})
.then(detector => {
return detector.detect(video);
@@ -61,13 +61,13 @@ function BarcodeDetectorDetectionResultTest(detectionResult, mock) {
generate_tests(createTestForVideoElement, [
[
"Face",
- "FaceDetector",
+ () => { return new FaceDetector(); },
() => { return mockFaceDetectionReady; },
FaceDetectorDetectionResultTest
],
[
"Barcode",
- "BarcodeDetector",
+ () => { return new BarcodeDetector(); },
() => { return mockBarcodeDetectionReady; },
BarcodeDetectorDetectionResultTest
]

Powered by Google App Engine
This is Rietveld 408576698