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
098ce602
Commit
098ce602
authored
Mar 16, 2017
by
Sebastian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated manual-inject tests to conform with naming conventions
parent
5c43f74a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
14 deletions
+15
-14
test/inject_script.html
test/inject_script.html
+1
-1
test/inject_script.js
test/inject_script.js
+2
-2
test/renderjs_test.js
test/renderjs_test.js
+9
-8
test/trigger_rjsready_event_on_ready_gadget.html
test/trigger_rjsready_event_on_ready_gadget.html
+1
-1
test/trigger_rjsready_event_on_ready_gadget.js
test/trigger_rjsready_event_on_ready_gadget.js
+2
-2
No files found.
test/inject_
renderjs
.html
→
test/inject_
script
.html
View file @
098ce602
...
...
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script
src=
"./inject_
renderjs
.js"
></script>
<script
src=
"./inject_
script
.js"
></script>
</head>
<body></body>
</html>
test/inject_
renderjs
.js
→
test/inject_
script
.js
View file @
098ce602
...
...
@@ -2,12 +2,12 @@
// can't use RSVP here because its not loaded (neccessarily)
function
test_inject_lib
(
lib
src
,
resolve
)
{
function
inject_script
(
src
,
resolve
)
{
// inject RSVP
var
script
=
document
.
createElement
(
"
script
"
);
script
.
onload
=
function
()
{
resolve
();
};
script
.
src
=
lib
src
;
script
.
src
=
src
;
document
.
body
.
appendChild
(
script
);
}
test/renderjs_test.js
View file @
098ce602
...
...
@@ -5433,10 +5433,11 @@
test
(
'
check manual bootstrap
'
,
function
()
{
var
fixture
=
document
.
getElementById
(
"
qunit-fixture
"
),
rjsReadyCalled
=
false
,
iframe
;
// The iframe for an isolated renderjs-free environment
// to test the manual inject
fixture
.
innerHTML
=
"
<iframe id=renderjsIsolatedIframe
"
+
"
src='./inject_
renderjs
.html'></iframe>
"
;
"
src='./inject_
script
.html'></iframe>
"
;
iframe
=
document
.
getElementById
(
"
renderjsIsolatedIframe
"
);
stop
();
...
...
@@ -5451,7 +5452,7 @@
"
RJS NOT available before inject
"
);
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
iframe
.
contentWindow
.
test_inject_lib
(
iframe
.
contentWindow
.
inject_script
(
"
../node_modules/rsvp/dist/rsvp-2.0.4.js
"
,
resolve
);
...
...
@@ -5459,7 +5460,7 @@
})
.
then
(
function
()
{
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
iframe
.
contentWindow
.
test_inject_lib
(
iframe
.
contentWindow
.
inject_script
(
"
../dist/renderjs-latest.js
"
,
resolve
);
...
...
@@ -5476,25 +5477,24 @@
var
parentDiv
=
iframe
.
contentDocument
.
createElement
(
"
div
"
);
parentDiv
.
setAttribute
(
"
data-gadget-url
"
,
"
./
inject_parent
gadget.html
"
"
./
trigger_rjsready_event_on_ready_
gadget.html
"
);
iframe
.
contentDocument
.
body
.
appendChild
(
parentDiv
);
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
// listen for an event fired in the ready function of the parent
// gadget
parentDiv
.
addEventListener
(
"
rjsready
"
,
function
(
e
)
{
rjsReadyCalled
=
true
;
resolve
();
});
// if no event is fired within 500ms, just resolve and fail later
window
.
setTimeout
(
function
()
{
re
solve
(
);
re
ject
(
"
Timeout, RenderJS is not Ready
"
);
},
500
);
iframe
.
contentWindow
.
rJS
.
manualBootstrap
();
});
})
.
then
(
function
()
{
ok
(
rjsReadyCalled
,
"
RJS correctly bootstrapped and parent is ready
"
);
ok
(
true
,
"
RJS correctly bootstrapped and parent is ready
"
);
})
.
fail
(
function
(
error
)
{
ok
(
false
,
error
);
...
...
@@ -5506,3 +5506,4 @@
}(
document
,
renderJS
,
QUnit
,
sinon
,
URI
,
URL
,
Event
,
MutationObserver
));
test/
inject_parent
gadget.html
→
test/
trigger_rjsready_event_on_ready_
gadget.html
View file @
098ce602
...
...
@@ -6,7 +6,7 @@
<script
src=
"../node_modules/rsvp/dist/rsvp-2.0.4.js"
></script>
<script
src=
"../dist/renderjs-latest.js"
></script>
<script
src=
"
inject_parent
gadget.js"
type=
"text/javascript"
></script>
<script
src=
"
trigger_rjsready_event_on_ready_
gadget.js"
type=
"text/javascript"
></script>
</head>
<body>
</body>
...
...
test/
inject_parent
gadget.js
→
test/
trigger_rjsready_event_on_ready_
gadget.js
View file @
098ce602
...
...
@@ -7,8 +7,8 @@
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
return
gadget
.
getElement
()
.
push
(
function
(
ele
)
{
ele
.
dispatchEvent
(
new
Event
(
"
rjsready
"
));
.
push
(
function
(
ele
ment
)
{
ele
ment
.
dispatchEvent
(
new
Event
(
"
rjsready
"
));
});
});
}(
window
,
rJS
));
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