PageRenderTime 43ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainerController.html

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
HTML | 77 lines | 68 code | 9 blank | 0 comment | 0 complexity | 7ffa95d1bb38a88dd889127e4172af64 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>JsUnit Test Container Controller</title>
  6. <script language="javascript" type="text/javascript">
  7. var containerReady = false;
  8. function init() {
  9. containerReady = true;
  10. }
  11. function isPageLoaded() {
  12. if (!containerReady)
  13. return false;
  14. var isTestPageLoaded = false;
  15. try {
  16. // attempt to access the var isTestPageLoaded in the testFrame
  17. if (typeof(top.testManager.containerTestFrame.isTestPageLoaded) != 'undefined') {
  18. isTestPageLoaded = top.testManager.containerTestFrame.isTestPageLoaded;
  19. }
  20. // ok, if the above did not throw an exception, then the
  21. // variable is defined. If the onload has not fired in the
  22. // testFrame then isTestPageLoaded is still false. Otherwise
  23. // the testFrame has set it to true
  24. }
  25. catch (e) {
  26. // an error occured while attempting to access the isTestPageLoaded
  27. // in the testFrame, therefore the testFrame has not loaded yet
  28. isTestPageLoaded = false;
  29. }
  30. return isTestPageLoaded;
  31. }
  32. function isContainerReady() {
  33. return containerReady;
  34. }
  35. function setNotReady() {
  36. try {
  37. // attempt to set the isTestPageLoaded variable
  38. // in the test frame to false.
  39. top.testManager.containerTestFrame.isTestPageLoaded = false;
  40. }
  41. catch (e) {
  42. // testFrame.isTestPageLoaded not available... ignore
  43. }
  44. }
  45. function setTestPage(testPageURI) {
  46. setNotReady();
  47. top.jsUnitParseParms(testPageURI);
  48. testPageURI = appendCacheBusterParameterTo(testPageURI);
  49. try {
  50. top.testManager.containerTestFrame.location.href = testPageURI;
  51. } catch (e) {
  52. }
  53. }
  54. function appendCacheBusterParameterTo(testPageURI) {
  55. if (testPageURI.indexOf("?") == -1)
  56. testPageURI += "?";
  57. else
  58. testPageURI += "&";
  59. testPageURI += "cacheBuster=";
  60. testPageURI += new Date().getTime();
  61. return testPageURI;
  62. }
  63. </script>
  64. </head>
  65. <body onload="init()">
  66. Test Container Controller
  67. </body>
  68. </html>