Sha256: bed84d9732db89c673fb255880d386596629e573cf135067404de9ba79a527f8

Contents?: true

Size: 1.42 KB

Versions: 19

Compression:

Stored size: 1.42 KB

Contents

#!/usr/bin/env envjsrb
load('base64.js');
inner = "<head><title>Hello, World from a data uri!</title></head><body></body>";
doc = "<html>"+inner+"</html>";
url_escaped = "data:text/html,"+escape(doc);
base64 = "data:text/html;base64,"+Base64.encode(doc);
debug(url_escaped);
window.location = "about:blank";
Envjs.wait();
window.location = url_escaped;
Envjs.wait();
debug(window.document.documentElement.innerHTML);
if(window.document.documentElement.innerHTML != inner){
  debug(window.document.documentElement.innerHTML);
  debug(inner);
  throw new Error(window.document.documentElement.innerHTML);
}
debug(base64);
window.location = "about:blank";
Envjs.wait();
window.location = base64;
Envjs.wait();
debug(window.document.documentElement.innerHTML);
if(window.document.documentElement.innerHTML != inner){
  throw new Error("b"+window.document.documentElement.innerHTML);
}
window.location = "about:blank";
Envjs.wait();
window.location = "data:,"+escape("Hello, World from a data uri!");
Envjs.wait();
debug(window.location+"");
debug(window.document.documentElement.innerHTML);
inner = "<head><title></title></head><body>Hello, World from a data uri!</body>";
if(window.document.documentElement.innerHTML != inner){
  throw new Error("c"+window.document.documentElement.innerHTML);
}

/* not implemented yet ...
w = open("about:blank");
w.foo = 10;
debug(w.foo);
uri = "data:text/javascript;base64,"+"foo = 20;";
w.load(uri);
debug(w.foo);
*/

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
envjs19-0.3.8.20101029121421 test/data.js
envjs-0.3.8 test/data.js
envjs-0.3.7 test/data.js
envjs-0.3.6 test/data.js
envjs-0.3.5 test/data.js
envjs-0.3.4 test/data.js
envjs-0.3.3 test/data.js
envjs-0.3.2 test/data.js
envjs-0.3.1 test/data.js
envjs-0.3.0 test/data.js
envjs-0.2.0 test/data.js
envjs-0.1.7 test/data.js
envjs-0.1.6 test/data.js
envjs-0.1.5 test/data.js
envjs-0.1.4 test/data.js
envjs-0.1.3 test/data.js
harmony-0.5.1 vendor/envjs/test/data.js
harmony-0.5 vendor/envjs/test/data.js
envjs-0.1.2 test/data.js