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

Unified Diff: third_party/WebKit/LayoutTests/presentation/presentation-start-error.html

Issue 2647723002: [Presentation API] reject request.start() with OperationError instead of UnknownError if previous s… (Closed)
Patch Set: add layout test for PREVIOUS_START_IN_PROGRESS error Created 3 years, 11 months 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/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>

Powered by Google App Engine
This is Rietveld 408576698