| Index: third_party/WebKit/LayoutTests/shapedetection/detection-security-test.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html b/third_party/WebKit/LayoutTests/shapedetection/detection-security-test.html
|
| similarity index 79%
|
| rename from third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html
|
| rename to third_party/WebKit/LayoutTests/shapedetection/detection-security-test.html
|
| index 9a03b2ea83dacc8bf8871bee2634ce1612e696fa..6d2689cb7bf8bebb5c283e906fe98f95f7881eef 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/shapedetection/shapedetection-security-test.html
|
| +++ b/third_party/WebKit/LayoutTests/shapedetection/detection-security-test.html
|
| @@ -1,6 +1,8 @@
|
| <!DOCTYPE html>
|
| -<script src=../../resources/testharness.js></script>
|
| -<script src=../../resources/testharnessreport.js></script>
|
| +<script src=../resources/testharness.js></script>
|
| +<script src=../resources/testharnessreport.js></script>
|
| +<script src="../resources/mojo-helpers.js"></script>
|
| +<script src="resources/mock-facedetection.js"></script>
|
| <script>
|
|
|
| // Returns a Promise that is resolve()d if detect() is rejected. Needs an input
|
| @@ -8,8 +10,14 @@
|
| function detectOnElementAndExpectError(createDetector, element, url) {
|
| return new Promise(function(resolve, reject) {
|
| var tryDetection = function() {
|
| - var detector = createDetector();
|
| - detector.detect(element)
|
| + var theMock = null;
|
| + mockFaceDetectionProviderReady
|
| + .then(mock => {
|
| + return createDetector();
|
| + })
|
| + .then(detector => {
|
| + return detector.detect(element);
|
| + })
|
| .then(detectionResult => {
|
| reject("Promise should have been rejected.");
|
| })
|
| @@ -28,7 +36,7 @@ var createTestForBadImage = function(createDetector) {
|
| promise_test(function(t) {
|
| var image = new Image();
|
| return detectOnElementAndExpectError(createDetector, image,
|
| - "../../external/wpt/images/broken.png")
|
| + "../external/wpt/images/broken.png")
|
| .then(function(error) {
|
| assert_equals(error.name, "InvalidStateError");
|
| });
|
|
|