aboutsummaryrefslogtreecommitdiffstats
path: root/tools/node_modules/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainerController.html
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainerController.html')
-rw-r--r--tools/node_modules/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainerController.html77
1 files changed, 77 insertions, 0 deletions
diff --git a/tools/node_modules/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainerController.html b/tools/node_modules/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainerController.html
new file mode 100644
index 0000000..3130d76
--- /dev/null
+++ b/tools/node_modules/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainerController.html
@@ -0,0 +1,77 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>JsUnit Test Container Controller</title>
+ <script language="javascript" type="text/javascript">
+ var containerReady = false;
+
+ function init() {
+ containerReady = true;
+ }
+
+ function isPageLoaded() {
+ if (!containerReady)
+ return false;
+
+ var isTestPageLoaded = false;
+
+ try {
+ // attempt to access the var isTestPageLoaded in the testFrame
+ if (typeof(top.testManager.containerTestFrame.isTestPageLoaded) != 'undefined') {
+ isTestPageLoaded = top.testManager.containerTestFrame.isTestPageLoaded;
+ }
+
+ // ok, if the above did not throw an exception, then the
+ // variable is defined. If the onload has not fired in the
+ // testFrame then isTestPageLoaded is still false. Otherwise
+ // the testFrame has set it to true
+ }
+ catch (e) {
+ // an error occured while attempting to access the isTestPageLoaded
+ // in the testFrame, therefore the testFrame has not loaded yet
+ isTestPageLoaded = false;
+ }
+ return isTestPageLoaded;
+ }
+
+ function isContainerReady() {
+ return containerReady;
+ }
+
+ function setNotReady() {
+ try {
+ // attempt to set the isTestPageLoaded variable
+ // in the test frame to false.
+ top.testManager.containerTestFrame.isTestPageLoaded = false;
+ }
+ catch (e) {
+ // testFrame.isTestPageLoaded not available... ignore
+ }
+ }
+ function setTestPage(testPageURI) {
+ setNotReady();
+ top.jsUnitParseParms(testPageURI);
+ testPageURI = appendCacheBusterParameterTo(testPageURI);
+ try {
+ top.testManager.containerTestFrame.location.href = testPageURI;
+ } catch (e) {
+ }
+ }
+
+ function appendCacheBusterParameterTo(testPageURI) {
+ if (testPageURI.indexOf("?") == -1)
+ testPageURI += "?";
+ else
+ testPageURI += "&";
+ testPageURI += "cacheBuster=";
+ testPageURI += new Date().getTime();
+ return testPageURI;
+ }
+ </script>
+</head>
+
+<body onload="init()">
+Test Container Controller
+</body>
+</html> \ No newline at end of file