diff --git a/build/runtest/test.js b/build/runtest/test.js index d793ca811..1831e2f04 100644 --- a/build/runtest/test.js +++ b/build/runtest/test.js @@ -6,7 +6,12 @@ window.location = "test/index.html"; load("dist/jquery.js","build/runtest/testrunner.js"); // Load the tests -load("src/jquery/coreTest.js","src/selector/selectorTest.js"); +load( + "src/jquery/coreTest.js", + "src/selector/selectorTest.js", + "src/event/eventTest.js", + "src/fx/fxTest.js" +); // Display the results results(); diff --git a/build/runtest/testrunner.js b/build/runtest/testrunner.js index 974410012..27822f9e3 100644 --- a/build/runtest/testrunner.js +++ b/build/runtest/testrunner.js @@ -160,4 +160,25 @@ function results(){ } function start(){} -function stop(){} \ No newline at end of file +function stop(){} + +/** + * Trigger an event on an element. + * + * @example triggerEvent( document.body, "click" ); + * + * @param DOMElement elem + * @param String type + */ +function triggerEvent( elem, type, event ) { +/* + if ( jQuery.browser.mozilla || jQuery.browser.opera ) { + event = document.createEvent("MouseEvents"); + event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, + 0, 0, 0, 0, 0, false, false, false, false, 0, null); + elem.dispatchEvent( event ); + } else if ( jQuery.browser.msie ) { + elem.fireEvent("on"+type); + } +*/ +} \ No newline at end of file diff --git a/src/event/eventTest.js b/src/event/eventTest.js index 15e66313e..312b1e565 100644 --- a/src/event/eventTest.js +++ b/src/event/eventTest.js @@ -28,22 +28,17 @@ test("bind()", function() { // events don't work with iframes, see #939 - var tmp = document.createElement('iframe'); - document.body.appendChild( tmp ); - var doc = tmp.contentWindow.document; - doc.open(); - doc.write(""); - doc.close(); + var doc = document.getElementById("iframe").contentDocument; + + doc.body.innerHTML = ""; var input = doc.getElementsByTagName("input")[0]; $(input).bind("click",function() { ok( true, "Binding to element inside iframe" ); - }); + }).click(); - triggerEvent( input, "click" ); - - document.body.removeChild( tmp ); + //triggerEvent( input, "click" ); var counter = 0; function selectOnChange(event) { diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 20aaea857..ee4438194 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -340,7 +340,7 @@ test("wrap(String|Element)", function() { ok( result.text() == defaultText, 'Check for element wrapping' ); reset(); - stop(); + //stop(); $('#check1').click(function() { var checkbox = this; ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" );