Commit 03fbd623 authored by Romain Courteaud's avatar Romain Courteaud

Test that iframe gadget loading error is correctly propagated.

parent 05471f46
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Embedded page for renderJS test</title>
<meta name="viewport" content="width=device-width, height=device-height"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="../node_modules/rsvp/dist/rsvp-2.0.4.js" type="text/javascript"></script>
<script src="../dist/renderjs-latest.js" type="text/javascript"></script>
<script src="./embedded_fail.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
(function (window, rJS) {
"use strict";
var gk = rJS(window);
gk.ready(function (g) {
return RSVP.delay(50).then(function () {
throw new Error("Manually rejected");
});
});
}(window, rJS));
......@@ -1944,6 +1944,27 @@
});
});
test('checking failing iframe gadget', function () {
// Check that declare gadget returns the gadget
var gadget = new RenderJSGadget(),
url = "./embedded_fail.html";
stop();
gadget.declareGadget(url, {
sandbox: 'iframe',
element: document.getElementById('qunit-fixture')
})
.then(function (new_gadget) {
ok(false);
})
.fail(function (error) {
equal(error, "Error: Manually rejected");
})
.always(function () {
start();
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget bootstrap
/////////////////////////////////////////////////////////////////
......
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