Focus on the body before running focus test

(cherry picked from commit b2f27632eb)
Conflicts:
	test/unit/event.js
This commit is contained in:
Oleg 2013-09-30 20:23:21 +04:00
parent f519539d3b
commit 0a62e22579

View File

@ -2567,12 +2567,12 @@ test( "make sure events cloned correctly", 18, function() {
clone.find("#check1").trigger("change"); // 0 events should fire
});
// This test fails in some browsers if document does not have focus
if ( !document.hasFocus || document.hasFocus && document.hasFocus() ) {
test( "Check order of focusin/focusout events", 2, function() {
var focus, blur,
input = jQuery( "#name" );
document.body.focus();
input.on( "focus", function() {
focus = true;
@ -2595,7 +2595,6 @@ if ( !document.hasFocus || document.hasFocus && document.hasFocus() ) {
// cleanup
input.off();
});
}
test( "String.prototype.namespace does not cause trigger() to throw (#13360)", function() {
expect( 1 );