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

Unified Diff: third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.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-HTMLImageElement.html
diff --git a/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html b/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html
index b9b3b8a2b946f7b327e318cb94be3ade34aae04f..3eef1a2c3dd01de19deba64fec90cdbcdc038358 100644
--- a/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html
+++ b/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html
@@ -5,11 +5,11 @@
<script src="resources/mock-barcodedetection.js"></script>
<script src="resources/mock-facedetection.js"></script>
<body>
-<img id='img' src='../media/content/greenbox.png'/>
+<img id="img" src="../media/content/greenbox.png"/>
</body>
<script>
-var createTestForImageElement = function(detectorName, mockReady,
+var createTestForImageElement = function(createDetector, mockReady,
detectionResultTest) {
async_test(function(t) {
var img = document.getElementById("img");
@@ -18,11 +18,11 @@ var createTestForImageElement = 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(img);
@@ -57,13 +57,13 @@ function BarcodeDetectorDetectionResultTest(detectionResult, mock) {
generate_tests(createTestForImageElement, [
[
"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