Permalink
Browse files

More test help for yeti and yuitest driver

  • Loading branch information...
1 parent f24daf6 commit 4c156029b4749604d2865f31db1061d4eeed7e90 @davglass davglass committed Sep 24, 2012
Showing with 45 additions and 33 deletions.
  1. +15 −11 src/yui/tests/unit/coverage.html
  2. +15 −11 src/yui/tests/unit/index-static.html
  3. +15 −11 src/yui/tests/unit/lang.html
@@ -120,18 +120,22 @@
//This is a YUITest hack to rename this test for reporting
Y.Test.Runner.setName('YUI: Coverage');
- var timer,
- check = function() {
- var f = document.getElementById('xframe');
- if (f && f.contentWindow && f.contentWindow._xframeLoaded) {
- clearInterval(timer);
- Y.Test.Runner.run();
- return true;
- }
- return false;
- };
+ if (window && window.$yetify) {
+ var timer,
+ check = function() {
+ var f = document.getElementById('xframe');
+ if (f && f.contentWindow && f.contentWindow._xframeLoaded) {
+ clearInterval(timer);
+ Y.Test.Runner.run();
+ return true;
+ }
+ return false;
+ };
- timer = setInterval(check, 100);
+ timer = setInterval(check, 100);
+ } else {
+ Y.Test.Runner.run();
+ }
});
</script>
@@ -117,18 +117,22 @@
new Y.Test.Console().render('#log');
Y.Test.Runner.setName(TestName);
- var timer,
- check = function() {
- var f = document.getElementById('xframe');
- if (f && f.contentWindow && f.contentWindow._xframeLoaded) {
- clearInterval(timer);
- Y.Test.Runner.run();
- return true;
- }
- return false;
- };
+ if (window && window.$yetify) {
+ var timer,
+ check = function() {
+ var f = document.getElementById('xframe');
+ if (f && f.contentWindow && f.contentWindow._xframeLoaded) {
+ clearInterval(timer);
+ Y.Test.Runner.run();
+ return true;
+ }
+ return false;
+ };
- timer = setInterval(check, 100);
+ timer = setInterval(check, 100);
+ } else {
+ Y.Test.Runner.run();
+ }
});
</script>
@@ -23,18 +23,22 @@
}).use('lang-test', 'test-console', function (Y) {
new Y.Test.Console().render('#log');
- var timer,
- check = function() {
- var f = document.getElementById('xframe');
- if (f && f.contentWindow && f.contentWindow._xframeLoaded) {
- clearInterval(timer);
- Y.Test.Runner.run();
- return true;
- }
- return false;
- };
+ if (window && window.$yetify) {
+ var timer,
+ check = function() {
+ var f = document.getElementById('xframe');
+ if (f && f.contentWindow && f.contentWindow._xframeLoaded) {
+ clearInterval(timer);
+ Y.Test.Runner.run();
+ return true;
+ }
+ return false;
+ };
- timer = setInterval(check, 100);
+ timer = setInterval(check, 100);
+ } else {
+ Y.Test.Runner.run();
+ }
});
</script>

0 comments on commit 4c15602

Please sign in to comment.