This repository has been archived by the owner on Mar 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing relay frame bug where multiple frames sometimes caused infinit…
…e loop when searching for relay. * Add test case to ensure the problem happens on IE.
- Loading branch information
Shane Tomlinson
committed
Jan 5, 2012
1 parent
7bdafd5
commit 2899317
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="/winchan.js"></script> | ||
<script> | ||
// Delay the load so that there is time to add the extra iframe in the parent. | ||
setTimeout(function() { | ||
WinChan.onOpen(function(origin, args, cb) { | ||
cb(args); | ||
}); | ||
}, 1000); | ||
</script> | ||
</head> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
$(document).ready(function(){ | ||
asyncTest("multiple frames in parent, stresses relay frame - takes ~1 second.", function() { | ||
var iframe, | ||
argString = "This is a string we'll send into and back from the dialog: " + | ||
(new Date()).toString(); | ||
|
||
setTimeout(function() { | ||
// We are adding the iframe AFTER the winchan is open. The child frame | ||
// does not respond until 1 second after load. | ||
iframe = document.createElement("iframe"); | ||
iframe.setAttribute("src", "javascript:0;"); | ||
// Give the extra frame a name that comes after the name of the WinChan | ||
// relay frame in the alphabet so that the relay frame is not the last | ||
// frame in window.opener.frames. | ||
iframe.setAttribute("id", "zzzz"); | ||
document.body.appendChild(iframe); | ||
}, 500); | ||
|
||
WinChan.open({ | ||
url: "cases/multiple-frame/child.html", | ||
relay_url: "/relay.html", | ||
window_features: "width=700,height=375", | ||
params: argString | ||
}, function(err, resp) { | ||
equal(resp, argString); | ||
iframe.parentNode.removeChild(iframe); | ||
start(); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters