[Pkg-javascript-commits] [sockjs-client] 240/434: Don't start test onload, we want to test onload as well!
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:16 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository sockjs-client.
commit 142e9661e992084dc1cfce62ff043745fa2d5767
Author: Marek Majkowski <majek04 at gmail.com>
Date: Thu Dec 1 14:25:05 2011 +0000
Don't start test onload, we want to test onload as well!
---
tests/html/iframe.html | 14 ++++++--------
tests/html/src/domtests.coffee | 20 ++++++++++++++------
2 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/tests/html/iframe.html b/tests/html/iframe.html
index 86dfb0f..bdea20b 100644
--- a/tests/html/iframe.html
+++ b/tests/html/iframe.html
@@ -8,16 +8,14 @@
</script>
<script src="/lib/sockjs.js"></script>
</head>
-<body onload="onload();">
+<body>
<h2>Don't panic!</h2>
<p>This is a SockJS hidden iframe. It's used for cross domain magic.</p>
<script>
- onload = function() {
- c = parent._sockjs_global;
- window_id = document.location.hash.slice(1);
- hook = c(window_id);
- hook.callback = function(code) {eval(code);};
- hook.open();
- }
+ c = parent._sockjs_global;
+ window_id = document.location.hash.slice(1);
+ hook = c(window_id);
+ hook.callback = function(code) {eval(code);};
+ hook.open();
</script>
</body>
diff --git a/tests/html/src/domtests.coffee b/tests/html/src/domtests.coffee
index fee21ce..f6f542c 100644
--- a/tests/html/src/domtests.coffee
+++ b/tests/html/src/domtests.coffee
@@ -3,7 +3,7 @@ module('Dom')
u = SockJS.getUtils()
newIframe = ->
- # Must do:
+ # Requires to put:
# document.domain = document.domain
# in HEAD, for IE7
hook = u.createHook()
@@ -14,15 +14,17 @@ newIframe = ->
onunload_test_factory = (code) ->
return ->
- expect(2)
+ expect(3)
hook = newIframe()
hook.open = ->
ok(true, 'open hook called by an iframe')
hook.callback(code)
+ hook.load = ->
+ ok(true, 'onload hook called by an iframe')
f = -> hook.iobj.cleanup()
setTimeout(f, 1)
- hook.done = ->
- ok(true, 'done hook called by an iframe')
+ hook.unload = ->
+ ok(true, 'onunload hook called by an iframe')
hook.del()
start()
@@ -32,8 +34,11 @@ if navigator.userAgent.indexOf('Konqueror') isnt -1
else
asyncTest('onunload', onunload_test_factory("""
var u = SockJS.getUtils();
+ u.attachEvent('load', function(){
+ hook.load();
+ });
u.attachEvent('unload', function(){
- hook.done();
+ hook.unload();
});
"""))
@@ -43,8 +48,11 @@ if navigator.userAgent.indexOf('Konqueror') isnt -1 or $.browser.opera
else
asyncTest('onbeforeunload', onunload_test_factory("""
var u = SockJS.getUtils();
+ u.attachEvent('load', function(){
+ hook.load();
+ });
u.attachEvent('beforeunload', function(){
- hook.done();
+ hook.unload();
});
"""))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list