diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-09-13 14:59:13 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-09-13 14:59:13 -0700 |
commit | c10c47d9cb43e8fc41ae93874cd191bf6584d8c6 (patch) | |
tree | af72c93e12e4568a0ef5057bf2a4798171154b6a /tools/reproduceriter.py | |
parent | 64a4241e29dbe768ab16b03e487056af75a831aa (diff) |
Image and URL support in shell replay
Diffstat (limited to 'tools/reproduceriter.py')
-rwxr-xr-x | tools/reproduceriter.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/reproduceriter.py b/tools/reproduceriter.py index 755aa1fc..076de493 100755 --- a/tools/reproduceriter.py +++ b/tools/reproduceriter.py @@ -184,6 +184,12 @@ if (typeof nagivator == 'undefined') { window.fakeNow += 16.666; } }, + URL: { + createObjectURL: function(x) { + return x; // the blob itself is returned + }, + revokeObjectURL: function(x) {}, + }, }; var setTimeout = window.setTimeout; var document = { @@ -212,6 +218,11 @@ if (typeof nagivator == 'undefined') { getExtension: function() { return 1 }, }; } + case '2d': { + return { + drawImage: function(){}, + }; + } default: throw 'canvas.getContext: ' + which; } }, @@ -318,6 +329,15 @@ if (typeof nagivator == 'undefined') { var Audio = function() { return { play: function(){} }; }; + var Image = function() { + var that = this; + window.setTimeout(function() { + that.complete = true; + that.width = 64; + that.height = 64; + if (that.onload) that.onload(); + }); + }; var Worker = function(path) { path = fixPath(path); var workerCode = read(path); @@ -362,7 +382,7 @@ if (typeof nagivator == 'undefined') { this.data = combined; }; this.getBlob = function() { - return this.data.buffer; // XXX we should change this + return this.data.buffer; // return the buffer as a "blob". XXX We might need to change this if it is not opaque }; }; } |