| 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 d356a65f632c3b3c7e23e697432c3b573f6bd26a..35029eafab22f6bb7ffb5074cfc2440640cc3071 100644
|
| --- a/chrome/test/media_router/resources/common.js
|
| +++ b/chrome/test/media_router/resources/common.js
|
| @@ -71,14 +71,18 @@ function checkSession() {
|
| } else {
|
| // set the new session
|
| startedConnection = session;
|
| - if (startedConnection.state != "connecting") {
|
| + console.log('connection state is "' + startedConnection.state + '"');
|
| + if (startedConnection.state == "connected") {
|
| + sendResult(true, '');
|
| + } else if (startedConnection.state == "connecting") {
|
| + startedConnection.onconnect = () => {
|
| + sendResult(true, '');
|
| + };
|
| + } else {
|
| sendResult(false,
|
| - 'Expect connection state to be "connecting", actual "' +
|
| - startedConnection.state + '"');
|
| + 'Expect connection state to be "connecting" or "connected", ' +
|
| + 'actual "' + startedConnection.state + '"');
|
| }
|
| - startedConnection.onconnect = () => {
|
| - sendResult(true, '');
|
| - };
|
| }
|
| }).catch(function(e) {
|
| // terminate old session if exists
|
|
|