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
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
renderjs
Commits
84bcf0e9
Commit
84bcf0e9
authored
Jul 31, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Iframe: ensure all channels are OK before calling ready
parent
987147b7
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
361 additions
and
383 deletions
+361
-383
renderjs.js
renderjs.js
+345
-369
test/embedded.js
test/embedded.js
+1
-2
test/renderjs_test.js
test/renderjs_test.js
+14
-8
test/trigger_rjsready_event_on_ready_gadget.js
test/trigger_rjsready_event_on_ready_gadget.js
+1
-4
No files found.
renderjs.js
View file @
84bcf0e9
This diff is collapsed.
Click to expand it.
test/embedded.js
View file @
84bcf0e9
...
...
@@ -15,8 +15,7 @@
(
modification_dict
.
foo
===
'
bar
'
);
state_change_count
+=
1
;
};
gk
.
ready
(
function
(
g
)
{
gk
.
ready
(
function
()
{
ready_called
=
true
;
})
.
setState
(
init_state
)
...
...
test/renderjs_test.js
View file @
84bcf0e9
...
...
@@ -4868,7 +4868,8 @@
// Check that declare gadget returns the gadget
var
gadget
=
new
RenderJSGadget
(),
acquire_called
=
false
,
url
=
"
./embedded.html
"
;
url
=
"
./embedded.html
"
,
new_gadget
;
gadget
.
__aq_parent
=
function
(
method_name
,
argument_list
)
{
acquire_called
=
true
;
...
...
@@ -4889,9 +4890,11 @@
stop
();
gadget
.
declareGadget
(
url
,
{
sandbox
:
'
iframe
'
,
element
:
document
.
getElementById
(
'
qunit-fixture
'
)
element
:
document
.
getElementById
(
'
qunit-fixture
'
),
scope
:
'
foobar
'
})
.
then
(
function
(
new_gadget
)
{
.
then
(
function
(
sub_gadget
)
{
new_gadget
=
sub_gadget
;
return
new
RSVP
.
Queue
()
// Method returns an RSVP.Queue
...
...
@@ -4901,12 +4904,14 @@
result
instanceof
RSVP
.
Queue
,
"
iframe method should return Queue
"
);
return
result
;
})
/*
// Check that ready function are called
.push(function () {
return new_gadget.wasReadyCalled();
})
*/
.
push
(
function
(
result
)
{
equal
(
result
,
true
);
})
...
...
@@ -5776,7 +5781,7 @@
fixture
.
innerHTML
=
"
<iframe id=renderjsIframe src='./not_declared_gadget.html'></iframe>
"
;
stop
();
return
RSVP
.
delay
(
9
00
)
return
RSVP
.
delay
(
15
00
)
.
then
(
function
()
{
var
iframe
=
document
.
getElementById
(
'
renderjsIframe
'
),
acquisition_div
=
iframe
.
contentWindow
.
...
...
@@ -5820,8 +5825,6 @@
return
;
}
iframe_text
=
iframe_body
.
textContent
;
/*global console*/
// console.log(iframe_text);
if
(
iframe_text
.
indexOf
(
'
Page changed
'
)
!==
-
1
)
{
// Final page
ok
(
true
,
iframe_text
);
...
...
@@ -5873,6 +5876,9 @@
resolve
(
evt
.
target
.
result
);
});
})
.
then
(
function
()
{
return
RSVP
.
delay
(
1100
);
})
.
then
(
function
()
{
var
iframe_body
=
iframe
.
contentWindow
.
document
.
body
,
iframe_text
=
iframe_body
.
textContent
;
...
...
@@ -5946,7 +5952,7 @@
// if no event is fired within 500ms, just resolve and fail later
window
.
setTimeout
(
function
()
{
reject
(
"
Timeout, RenderJS is not Ready
"
);
},
5
00
);
},
30
00
);
iframe
.
contentWindow
.
rJS
.
manualBootstrap
();
});
})
...
...
test/trigger_rjsready_event_on_ready_gadget.js
View file @
84bcf0e9
...
...
@@ -6,9 +6,6 @@
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
return
gadget
.
getElement
()
.
push
(
function
(
element
)
{
element
.
dispatchEvent
(
new
Event
(
"
rjsready
"
));
});
return
gadget
.
element
.
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