| <html> |
| <head> |
| <title>arb-status-sk demo</title> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> |
| <script src="/res/common/js/common.js"></script> |
| <script src="/res/imp/bower_components/webcomponentsjs/webcomponents-lite.js"></script> |
| <script type="text/javascript"> |
| var fakeStatus = { |
| "currentRoll": { |
| "closed": false, |
| "commitQueue": true, |
| "committed": false, |
| "issue": 1415573003, |
| "modified": "2015-10-23T15:05:33.06468Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "in progress", |
| "subject": "Roll src/third_party/skia/ 38a88e4c0..450ee8f26 (4 commits).", |
| "tryResults": [ |
| { |
| "builder": "trybot_name", |
| "master": "try_master", |
| "number": 0, |
| "result": "FAILED", |
| "status": "STARTED" |
| } |
| ] |
| }, |
| "error": null, |
| "lastRoll": { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1422543007, |
| "modified": "2015-10-23T15:05:05.47221Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..450ee8f26 (5 commits).", |
| "tryResults": [] |
| }, |
| "mode": { |
| "message": "Let's roll!", |
| "mode": "running", |
| "time": "2015-10-23T15:05:05.47221Z", |
| "user": "user@google.com", |
| }, |
| "recent": [ |
| { |
| "closed": false, |
| "commitQueue": true, |
| "committed": false, |
| "issue": 1415573003, |
| "modified": "2015-10-23T15:05:33.06468Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "in progress", |
| "subject": "Roll src/third_party/skia/ 38a88e4c0..450ee8f26 (4 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1422543007, |
| "modified": "2015-10-23T15:05:05.47221Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..450ee8f26 (5 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1419183003, |
| "modified": "2015-10-23T15:03:40.4796Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..450ee8f26 (5 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1412803005, |
| "modified": "2015-10-23T15:01:40.51842Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..ccdbc1d06 (4 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1420233003, |
| "modified": "2015-10-23T14:59:56.61024Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..ccdbc1d06 (4 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1418133006, |
| "modified": "2015-10-23T14:58:29.50867Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..ccdbc1d06 (4 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1411073004, |
| "modified": "2015-10-23T14:55:28.90072Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..ccdbc1d06 (4 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1418133005, |
| "modified": "2015-10-23T14:51:29.32814Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..ccdbc1d06 (4 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1405023009, |
| "modified": "2015-10-23T14:41:21.06715Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..ccdbc1d06 (4 commits).", |
| "tryResults": [] |
| }, |
| { |
| "closed": true, |
| "commitQueue": false, |
| "committed": false, |
| "issue": 1419013003, |
| "modified": "2015-10-23T14:26:59.94732Z", |
| "patchSets": [ |
| 1 |
| ], |
| "result": "failed", |
| "subject": "Roll src/third_party/skia/ 5a06df468..33eefcd58 (3 commits).", |
| "tryResults": [] |
| } |
| ], |
| "status": "in progress", |
| "validModes": [ |
| "running", |
| "stopped", |
| "dry run" |
| ] |
| }; |
| |
| |
| var params = sk.query.toParamSet(window.location.search.substring(1)); |
| if (params.status == "error") { |
| fakeStatus["status"] = "error"; |
| fakeStatus["error"] = "Error message goes here!"; |
| } |
| |
| // Mock out sk.get and sk.post so we can fake a response from the server. |
| sk.get = function(url) { |
| return new Promise(function (resolve, reject) { |
| if (url == "/json/status") { |
| resolve(JSON.stringify(fakeStatus)); |
| } else if (url == "/loginstatus/") { |
| resolve('{"Email":"user@google.com","LoginURL":"https://accounts.google.com/","IsAGoogler":true}'); |
| } else { |
| reject("Unknown url " + url); |
| } |
| }); |
| }; |
| |
| sk.post = function(url, body) { |
| return new Promise(function(resolve, reject) { |
| var res = JSON.parse(body); |
| res["user"] = "you@google.com"; |
| var validMode = fakeStatus["validModes"].indexOf(res.mode); |
| if (validMode) { |
| fakeStatus["mode"] = res; |
| resolve(JSON.stringify(fakeStatus)); |
| } else { |
| reject("Invalid mode: " + res.mode); |
| } |
| }); |
| }; |
| </script> |
| <link rel=import href="arb-status-sk.html"> |
| <link rel=import href="/res/common/imp/error-toast-sk.html"> |
| <link rel=import href="/res/common/imp/login.html"> |
| </head> |
| <body> |
| <login-sk style="display:none"></login-sk> |
| <h1>arb-status-sk demo</h1> |
| <arb-status-sk roll-user="skia-deps-roller"></arb-status-sk> |
| <error-toast-sk></error-toast-sk> |
| </body> |
| </html> |