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

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

Issue 2492393002: [Presentation API] Fix integration test - initial state of connection can be 'connecting' or 'conne… (Closed)
Patch Set: 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 | no next file » | 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 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698