| Index: third_party/WebKit/LayoutTests/presentation/presentation-start-error.html
|
| diff --git a/third_party/WebKit/LayoutTests/presentation/presentation-start-error.html b/third_party/WebKit/LayoutTests/presentation/presentation-start-error.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6cd746ea52f49780f28f1678f5ad744d545f3de2
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/presentation/presentation-start-error.html
|
| @@ -0,0 +1,36 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<body>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script src="../resources/mojo-helpers.js"></script>
|
| +<script src="resources/presentation-service-mock.js"></script>
|
| +<button>click me</button>
|
| +<script>
|
| +
|
| +var button = document.querySelector('button');
|
| +
|
| +async_test(t => {
|
| + presentationServiceMock.then(service => {
|
| + service.startSession = urls => {
|
| + return Promise.resolve({
|
| + sessionInfo: null,
|
| + error: {
|
| + error_type: 3 /* PresentationErrorType.PREVIOUS_START_IN_PROGRESS */,
|
| + message: 'Previous start in progress'
|
| + }
|
| + });
|
| + };
|
| + // This is receiving the user gesture and runs the callback.
|
| + waitForClick(() => {
|
| + var request = new PresentationRequest("http://example.com");
|
| + request.start().catch(t.step_func_done(ex => {
|
| + assert_equals(ex.name, 'OperationError');
|
| + }));
|
| + }, button);
|
| + });
|
| +}, "Test that the PresentationRequest.start() rejects with OperationError if PresentationService reports PREVIOUS_START_IN_PROGRESS error");
|
| +
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|