| <!DOCTYPE html> |
| <html> |
| |
| <head> |
| <title>Skia Fuzzer Roll Demo </title> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <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 src="/res/imp/sinon-1.17.2.js"></script> |
| <!-- Makes a var called data--> |
| <!-- <script type="text/javascript" src="commits-table-35-demo.json"></script> --> |
| |
| <script type="text/javascript" charset="utf-8"> |
| sinon.format = function(object) {return JSON.stringify(object);} |
| sinon.log = function(message) {console.log(message);}; |
| |
| // Sets the time to be Thu Mar 10 2016 12:13:20 GMT-0500 (EST) |
| var clock = sinon.useFakeTimers(1457630000000, "Date"); |
| var server = sinon.fakeServer.create(); |
| server.autoRespond = true; |
| |
| server.respondWith("POST", "/roll/revision", function(req){ |
| var r = Math.random(); |
| if (r < 0.4){ |
| req.respond(200, { "Content-Type": "text/html", "Content-Length": 2 }, "OK"); |
| return; |
| } |
| if (r < 0.8) { |
| req.respond(400, { "Content-Type": "text/html", "Content-Length": 2 }, "Invalid Skia Revision"); |
| return; |
| } |
| req.respond(400, { "Content-Type": "text/html", "Content-Length": 2 }, "Skia revision must be in the future relative to the current revision."); |
| return; |
| }); |
| |
| var revisionStatus = { |
| "lastUpdated": "2016-06-28T15:45:54-07:00", |
| "current":{ |
| "hash": "deadbeef", |
| "author": "youdontknow (John Snow)" |
| }, |
| "pending": { |
| "hash": "1234567890abcdef", |
| "author": "winteriscoming (Ned Stark)" |
| } |
| }; |
| server.respondWith("GET","/json/status", JSON.stringify(revisionStatus)); |
| |
| var login = {"Email":"test@google.com","LoginURL":"http://www.example.com","IsAGoogler":true}; |
| server.respondWith("GET","/loginstatus/", JSON.stringify(login)); |
| |
| var version = {"commit":"3e0fcf9b99baf4256851a6767bc6955266fc2369","date":"2016-02-19T13:57:18-05:00"}; |
| server.respondWith("GET","/json/version", JSON.stringify(version)); |
| |
| |
| </script> |
| |
| <link rel="import" href="fuzzer-roll-sk.html"> |
| </head> |
| |
| <body> |
| <fuzzer-roll-sk></fuzzer-roll-sk> |
| </body> |
| </html> |