Commit 0a62e225 authored by Oleg's avatar Oleg

Focus on the body before running focus test

(cherry picked from commit b2f27632)
Conflicts:
	test/unit/event.js
parent f519539d
...@@ -2567,12 +2567,12 @@ test( "make sure events cloned correctly", 18, function() { ...@@ -2567,12 +2567,12 @@ test( "make sure events cloned correctly", 18, function() {
clone.find("#check1").trigger("change"); // 0 events should fire clone.find("#check1").trigger("change"); // 0 events should fire
}); });
// This test fails in some browsers if document does not have focus test( "Check order of focusin/focusout events", 2, function() {
if ( !document.hasFocus || document.hasFocus && document.hasFocus() ) {
test( "Check order of focusin/focusout events", 2, function() {
var focus, blur, var focus, blur,
input = jQuery( "#name" ); input = jQuery( "#name" );
document.body.focus();
input.on( "focus", function() { input.on( "focus", function() {
focus = true; focus = true;
...@@ -2594,8 +2594,7 @@ if ( !document.hasFocus || document.hasFocus && document.hasFocus() ) { ...@@ -2594,8 +2594,7 @@ if ( !document.hasFocus || document.hasFocus && document.hasFocus() ) {
// cleanup // cleanup
input.off(); input.off();
}); });
}
test( "String.prototype.namespace does not cause trigger() to throw (#13360)", function() { test( "String.prototype.namespace does not cause trigger() to throw (#13360)", function() {
expect( 1 ); expect( 1 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment