Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/shapedetection/shapedetection-options.html |
| diff --git a/third_party/WebKit/LayoutTests/shapedetection/shapedetection-options.html b/third_party/WebKit/LayoutTests/shapedetection/shapedetection-options.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e07be53fd365b9f1b2b241f555a86435fa63618c |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/shapedetection/shapedetection-options.html |
| @@ -0,0 +1,44 @@ |
| +<!DOCTYPE html> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="../resources/mojo-helpers.js"></script> |
| +<script src="resources/mock-shapedetection.js"></script> |
| +<body> |
| +<img id='img' src='../media/content/greenbox.png'/> |
| +</body> |
| +<script> |
| +async_test(function(t) { |
| + var img = document.getElementById("img"); |
| + var theMock = null; |
| + mockShapeDetectionReady |
| + .then(mock => { |
| + theMock = mock; |
| + return new FaceDetector(); |
| + }) |
| + .catch(error => { |
| + assert_unreached("Error creating MockShapeDetection: " + error); |
| + }) |
| + .then(detectorWithDefault => { |
| + return detectorWithDefault.detect(img); |
| + }) |
| + .then(t.step_func(faceDetectionResult => { |
| + assert_equals(theMock.getMaxDetectedFaces(), 10, "default maxDetectedFaces"); |
| + assert_equals(theMock.getFastMode(), false, "default maxDetectedFaces"); |
| + return new FaceDetector({ |
| + maxDetectedFaces: 7, |
| + fastMode: true, |
| + }); |
|
mcasas
2016/11/21 23:19:26
nit: collapse l.27-30 ?
xianglu
2016/11/22 00:59:13
Done.
|
| + })) |
| + .then(detectorWithOptions => { |
| + return detectorWithOptions.detect(img) |
| + }) |
| + .then(t.step_func(faceDetectionResult => { |
| + assert_equals(theMock.getMaxDetectedFaces(), 7, "maxDetectedFaces"); |
| + assert_equals(theMock.getFastMode(), true, "maxDetectedFaces"); |
| + t.done(); |
| + })) |
| + .catch(error => { |
| + assert_unreached("Error creating detectors: " + error); |
| + }); |
| +}, "Test that FaceDetectionOptions are correctly propagated"); |
| +</script> |