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

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

Issue 2470023002: [Presentation API] change initial state of PresentationConnection to 'connecting' (Closed)
Patch Set: add integration test to check connection state 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..a1036240a8f11ce8e727d957cd290f22cfe81e39 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: encounter exception ' + e);
imcheng 2016/11/09 00:38:25 s/encounter/encountered
})
}
}
« 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