| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../resources/testharness.js"></script> |
| 5 <script src="../resources/testharnessreport.js"></script> |
| 6 <script src="../resources/mojo-helpers.js"></script> |
| 7 <script src="resources/presentation-service-mock.js"></script> |
| 8 <button>click me</button> |
| 9 <script> |
| 10 |
| 11 var button = document.querySelector('button'); |
| 12 |
| 13 async_test(t => { |
| 14 presentationServiceMock.then(service => { |
| 15 service.startSession = urls => { |
| 16 return Promise.resolve({ |
| 17 sessionInfo: null, |
| 18 error: { |
| 19 error_type: 3 /* PresentationErrorType.PREVIOUS_START_IN_PROGRESS */, |
| 20 message: 'Previous start in progress' |
| 21 } |
| 22 }); |
| 23 }; |
| 24 // This is receiving the user gesture and runs the callback. |
| 25 waitForClick(() => { |
| 26 var request = new PresentationRequest("http://example.com"); |
| 27 request.start().catch(t.step_func_done(ex => { |
| 28 assert_equals(ex.name, 'OperationError'); |
| 29 })); |
| 30 }, button); |
| 31 }); |
| 32 }, "Test that the PresentationRequest.start() rejects with OperationError if Pre
sentationService reports PREVIOUS_START_IN_PROGRESS error"); |
| 33 |
| 34 </script> |
| 35 </body> |
| 36 </html> |
| OLD | NEW |