| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright 2015 The Chromium Authors. All rights reserved. | 2 * Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 * | 5 * |
| 6 * @fileoverview Common APIs for presentation integration tests. | 6 * @fileoverview Common APIs for presentation integration tests. |
| 7 * | 7 * |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 var startSessionPromise = null; | 10 var startSessionPromise = null; |
| 11 var startedConnection = null; | 11 var startedConnection = null; |
| 12 var reconnectedSession = null; | 12 var reconnectedSession = null; |
| 13 var presentationUrl = null; | 13 var presentationUrl = null; |
| 14 if (window.location.href.indexOf('__is_android__=true') >= 0) { | 14 if (window.location.href.indexOf('__is_android__=true') >= 0) { |
| 15 // For android, "google.com/cast" is required in presentation URL. | 15 // For android, "google.com/cast" is required in presentation URL. |
| 16 // TODO(zqzhang): this requirement may be removed in the future. | 16 // TODO(zqzhang): this requirement may be removed in the future. |
| 17 presentationUrl = "http://google.com/cast#__castAppId__=CCCCCCCC/"; | 17 presentationUrl = "https://google.com/cast#__castAppId__=CCCCCCCC/"; |
| 18 } else { | 18 } else { |
| 19 presentationUrl = "http://www.google.com/#__testprovider__=true"; | 19 presentationUrl = "http://www.google.com/#__testprovider__=true"; |
| 20 } | 20 } |
| 21 var startSessionRequest = new PresentationRequest(presentationUrl); | 21 var startSessionRequest = new PresentationRequest(presentationUrl); |
| 22 var defaultRequestSessionId = null; | 22 var defaultRequestSessionId = null; |
| 23 var lastExecutionResult = null; | 23 var lastExecutionResult = null; |
| 24 var useDomAutomationController = !!window.domAutomationController; | 24 var useDomAutomationController = !!window.domAutomationController; |
| 25 | 25 |
| 26 window.navigator.presentation.defaultRequest = startSessionRequest; | 26 window.navigator.presentation.defaultRequest = startSessionRequest; |
| 27 window.navigator.presentation.defaultRequest.onconnectionavailable = function(e) | 27 window.navigator.presentation.defaultRequest.onconnectionavailable = function(e) |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 passed: passed, | 223 passed: passed, |
| 224 errorMessage: errorMessage | 224 errorMessage: errorMessage |
| 225 })); | 225 })); |
| 226 } else { | 226 } else { |
| 227 lastExecutionResult = JSON.stringify({ | 227 lastExecutionResult = JSON.stringify({ |
| 228 passed: passed, | 228 passed: passed, |
| 229 errorMessage: errorMessage | 229 errorMessage: errorMessage |
| 230 }); | 230 }); |
| 231 } | 231 } |
| 232 } | 232 } |
| OLD | NEW |