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

Unified Diff: third_party/WebKit/LayoutTests/presentation/resources/embedded-smoke-tests.html

Issue 2643473002: [Presentation API] Allow PresentationConnection state change to "Connecting" (Closed)
Patch Set: Address Mark and Bin's comments Created 3 years, 11 months 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
Index: third_party/WebKit/LayoutTests/presentation/resources/embedded-smoke-tests.html
diff --git a/third_party/WebKit/LayoutTests/presentation/resources/embedded-smoke-tests.html b/third_party/WebKit/LayoutTests/presentation/resources/embedded-smoke-tests.html
index 2769287a3ab8e57a04fbc698abb2f11ca3a1a96f..8dddc30fc313d7b0383b37c8c7d0bb882aafd67c 100644
--- a/third_party/WebKit/LayoutTests/presentation/resources/embedded-smoke-tests.html
+++ b/third_party/WebKit/LayoutTests/presentation/resources/embedded-smoke-tests.html
@@ -3,8 +3,8 @@
<body>
<script>
-var FAKE_SESSION_ID = 'fake';
-var gCurrentConnection = null;
+const FAKE_SESSION_ID = 'fake';
+let gCurrentConnection = null;
// Returns the test runner used to run this test..
// Current possible values are 'blink' and 'manual'.
@@ -24,7 +24,7 @@ function getUserGesture() {
setTimeout(resolve);
break;
case 'manual':
- var button = document.createElement('button');
+ const button = document.createElement('button');
button.textContent = 'click me';
button.onclick = function() {
document.body.removeChild(button);
@@ -38,18 +38,18 @@ function getUserGesture() {
});
}
-var results = [];
+const results = [];
// start()
getUserGesture().then(function() {
if (getTestRunner() == 'manual') {
- var description = document.createElement('div');
+ const description = document.createElement('div');
description.id = 'description';
description.textContent = 'Pick a device if asked for it';
document.body.appendChild(description);
}
- var p = new PresentationRequest('https://example.com');
+ const p = new PresentationRequest('https://example.com');
return p.start().then(function(connection) {
gCurrentConnection = connection;
results.push({ test: 'start', status: 'success' })
@@ -62,8 +62,10 @@ getUserGesture().then(function() {
}).then(function() {
// reconnect()
return getUserGesture().then(function() {
- var p = new PresentationRequest('https://example.com');
- return p.reconnect(gCurrentConnection ? gCurrentConnection.id : FAKE_SESSION_ID).then(function() {
+ const p = new PresentationRequest('https://example.com');
+ return p.reconnect(gCurrentConnection ?
+ gCurrentConnection.id :
+ FAKE_SESSION_ID).then(function() {
results.push({ test: 'reconnect', status: 'success' })
}, function(e) {
results.push({ test: 'reconnect', status: 'failure', name: e.name });
@@ -72,7 +74,7 @@ getUserGesture().then(function() {
}).then(function() {
// getAvailability()
return getUserGesture().then(function() {
- var p = new PresentationRequest('https://example.com');
+ const p = new PresentationRequest('https://example.com');
return p.getAvailability().then(function() {
results.push({ test: 'getAvailability', status: 'success' })
}, function(e) {

Powered by Google App Engine
This is Rietveld 408576698