Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
renderjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
renderjs
Commits
45b12db1
Commit
45b12db1
authored
Dec 12, 2016
by
Sebastian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inject test complete and working
parent
00db435a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
0 deletions
+70
-0
test/inject_renderjs.html
test/inject_renderjs.html
+8
-0
test/inject_renderjs.js
test/inject_renderjs.js
+17
-0
test/renderjs_test.js
test/renderjs_test.js
+45
-0
No files found.
test/inject_renderjs.html
0 → 100644
View file @
45b12db1
<!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>
test/inject_renderjs.js
0 → 100644
View file @
45b12db1
/*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
);
}
test/renderjs_test.js
View file @
45b12db1
...
@@ -5431,6 +5431,51 @@
...
@@ -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
,
}(
document
,
renderJS
,
QUnit
,
sinon
,
URI
,
URL
,
Event
,
MutationObserver
));
MutationObserver
));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment