4 testSuites: function( suites ) {
5 QUnit.begin(function() {
9 for ( var i = 0; i < suites.length; i++ ) {
10 QUnit.runSuite( suites[i] );
13 QUnit.done(function() {
14 this.iframe.style.display = "none";
18 runSuite: function( suite ) {
21 if ( QUnit.is( "object", suite ) ) {
26 asyncTest( suite, function() {
27 QUnit.iframe.setAttribute( "src", path );
31 initIframe: function() {
32 var body = document.body,
33 iframe = this.iframe = document.createElement( "iframe" ),
36 iframe.className = "qunit-subsuite";
37 body.appendChild( iframe );
39 function onIframeLoad() {
43 if (iframe.src === "") {
47 iframeWin.QUnit.moduleStart(function( data ) {
48 // capture module name for messages
52 iframeWin.QUnit.testStart(function( data ) {
53 // capture test name for messages
56 iframeWin.QUnit.testDone(function() {
60 iframeWin.QUnit.log(function( data ) {
64 // pass all test details through to the main page
65 var message = module + ": " + test + ": " + data.message;
67 QUnit.push( data.result, data.actual, data.expected, message );
70 iframeWin.QUnit.done(function() {
71 // start the wrapper test from the main page
75 QUnit.addEvent( iframe, "load", onIframeLoad );
77 iframeWin = iframe.contentWindow;
81 QUnit.testStart(function( data ) {
82 // update the test status to show which test suite is running
83 QUnit.id( "qunit-testresult" ).innerHTML = "Running " + data.name + "...<br> ";
86 QUnit.testDone(function() {
88 current = QUnit.id( this.config.current.id ),
89 children = current.children,
90 src = this.iframe.src;
92 // undo the auto-expansion of failed tests
93 for ( i = 0; i < children.length; i++ ) {
94 if ( children[i].nodeName === "OL" ) {
95 children[i].style.display = "none";
99 QUnit.addEvent(current, "dblclick", function( e ) {
100 var target = e && e.target ? e.target : window.event.srcElement;
101 if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) {
102 target = target.parentNode;
104 if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
105 window.location = src;
109 current.getElementsByTagName("a")[0].href = src;