Commit 45b12db1 authored by Sebastian's avatar Sebastian

inject test complete and working

parent 00db435a
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="./inject_renderjs.js"></script>
</head>
<body></body>
</html>
/*jslint nomen: true*/
function test_iframe_append () {
var tele = document.createTextNode(" . doing the loading . ");
document.body.appendChild(tele);
}
// can't use RSVP here because its not loaded (neccessarily)
function test_inject_lib(libsrc, resolve) {
// inject RSVP
var script = document.createElement("script");
script.onload = function() {
resolve();
};
script.src = libsrc;
document.body.appendChild(script);
}
......@@ -5431,6 +5431,51 @@
});
});
test('check manual bootstrap', function () {
var fixture = document.getElementById("qunit-fixture"),
iframe;
fixture.innerHTML = "<iframe id=renderjsIsolatedIframe " +
"src='./inject_renderjs.html'></iframe>";
iframe = document.getElementById("renderjsIsolatedIframe");
stop();
return new RSVP.Promise(function (resolve, reject) {
iframe.addEventListener("load", function (e) {
resolve(e.target.result);
});
})
.then(function () {
iframe.contentWindow.test_iframe_append();
return new RSVP.Promise(function (resolve, reject) {
iframe.contentWindow.test_inject_lib(
"../node_modules/rsvp/dist/rsvp-2.0.4.js",
resolve
);
});
})
.then(function () {
return new RSVP.Promise(function (resolve, reject) {
iframe.contentWindow.test_inject_lib(
"../dist/renderjs-latest.js",
resolve
);
});
})
.then(function () {
var rjsLoaded = iframe.contentWindow.rJS !== undefined;
ok(rjsLoaded, "injected RJS available in iframe");
})
.then(function () {
iframe.contentWindow.rJS.manualBootstrap();
})
.fail(function (error) {
ok(false, error);
})
.always(function () {
start();
});
});
}(document, renderJS, QUnit, sinon, URI, URL, Event,
MutationObserver));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment