| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 # Copyright 2016 The LUCI Authors. All rights reserved. | 2 # Copyright 2016 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed by the Apache v2.0 license that can be | 3 # Use of this source code is governed by the Apache v2.0 license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 <!DOCTYPE html> | 6 <!DOCTYPE html> |
| 7 <html> | 7 <html> |
| 8 <head> | 8 <head> |
| 9 <title>Swarming index Demo</title> | 9 <title>Swarming index Demo</title> |
| 10 <meta charset="utf-8"> | 10 <meta charset="utf-8"> |
| 11 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 11 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 12 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-
scale=1, user-scalable=yes"> | 12 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-
scale=1, user-scalable=yes"> |
| 13 <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></scri
pt> | 13 <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></scri
pt> |
| 14 <script src="../../../node_modules/skia-common-js/common.js"></script> | 14 <script src="../../../node_modules/skia-common-js/common.js"></script> |
| 15 <script src="/res/js/common.js"></script> | 15 <script src="/res/js/common.js"></script> |
| 16 <script src="/res/js/alias.js"></script> | 16 <script src="/res/js/alias.js"></script> |
| 17 <script src="../../../node_modules/sinon/pkg/sinon-1.17.5.js"></script> | 17 <script src="../../../node_modules/sinon/pkg/sinon-1.17.5.js"></script> |
| 18 | 18 |
| 19 <script type="text/javascript" charset="utf-8"> | 19 <script type="text/javascript" charset="utf-8"> |
| 20 sinon.format = function(object) {return JSON.stringify(object);} | 20 sinon.format = function(object) {return JSON.stringify(object);} |
| 21 sinon.log = function(message) {console.log(message);}; | 21 sinon.log = function(message) {console.log(message);}; |
| 22 var server = sinon.fakeServer.create(); | 22 var server = sinon.fakeServer.create(); |
| 23 server.autoRespondAfter = 1200; | 23 server.autoRespondAfter = 1200; |
| 24 server.autoRespond = true; | 24 server.autoRespond = true; |
| 25 | 25 |
| 26 var details = { | 26 var details = { |
| 27 server_version: "not-quite-ready", | 27 server_version: "1234-deadbeef", |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 var respond = function(request){ | 30 var respond = function(request){ |
| 31 if (!request.requestHeaders.authorization) { | 31 if (!request.requestHeaders.authorization) { |
| 32 sinon.log("You must be logged in (check your Oauth?)"); | 32 sinon.log("You must be logged in (check your Oauth?)"); |
| 33 request.respond(403, {}, "You must be logged in (check your Oauth?)"); | 33 request.respond(403, {}, "You must be logged in (check your Oauth?)"); |
| 34 return; | 34 return; |
| 35 } | 35 } |
| 36 sinon.log("User authenticated :) "+ request.requestHeaders.authorization); | 36 sinon.log("User authenticated :) "+ request.requestHeaders.authorization); |
| 37 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(d
etails)); | 37 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(d
etails)); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 50 <link rel="import" href="swarming-index.html"> | 50 <link rel="import" href="swarming-index.html"> |
| 51 </head> | 51 </head> |
| 52 <body> | 52 <body> |
| 53 | 53 |
| 54 <swarming-index | 54 <swarming-index |
| 55 client_id="20770472288-t5smpbpjptka4nd888fv0ctd23ftba2o.apps.googleusercontent
.com"> | 55 client_id="20770472288-t5smpbpjptka4nd888fv0ctd23ftba2o.apps.googleusercontent
.com"> |
| 56 </swarming-index> | 56 </swarming-index> |
| 57 | 57 |
| 58 </body> | 58 </body> |
| 59 </html> | 59 </html> |
| OLD | NEW |