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

Unified Diff: chrome/test/media_router/resources/common.js

Issue 2470023002: [Presentation API] change initial state of PresentationConnection to 'connecting' (Closed)
Patch Set: resolve code review comments from Derek and rebase with master Created 4 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/presentation/presentation_service_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/media_router/resources/common.js
diff --git a/chrome/test/media_router/resources/common.js b/chrome/test/media_router/resources/common.js
index 42ce095fb441d7c173c9221e2e32f51999be7504..d356a65f632c3b3c7e23e697432c3b573f6bd26a 100644
--- a/chrome/test/media_router/resources/common.js
+++ b/chrome/test/media_router/resources/common.js
@@ -67,16 +67,23 @@ function checkSession() {
} else {
startSessionPromise.then(function(session) {
if(!session) {
- sendResult(false, 'Failed to start session');
+ sendResult(false, 'Failed to start session: connection is null');
} else {
// set the new session
startedConnection = session;
- sendResult(true, '');
+ if (startedConnection.state != "connecting") {
+ sendResult(false,
+ 'Expect connection state to be "connecting", actual "' +
+ startedConnection.state + '"');
+ }
+ startedConnection.onconnect = () => {
+ sendResult(true, '');
+ };
}
- }).catch(function() {
+ }).catch(function(e) {
// terminate old session if exists
startedConnection && startedConnection.terminate();
- sendResult(false, 'Failed to start session');
+ sendResult(false, 'Failed to start session: encountered exception ' + e);
})
}
}
« no previous file with comments | « no previous file | content/browser/presentation/presentation_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698