Skip to content
Snippets Groups Projects
Commit dbae839c authored by Zach Carter's avatar Zach Carter
Browse files

Merge pull request #2363 from mozilla/issue_2282_opera_focus

Fix the Opera unit test flakiness when checking for element focus.
parents 99eb5bf3 f5e8da9c
No related branches found
No related tags found
No related merge requests found
......@@ -308,7 +308,7 @@ BrowserID.TestHelpers = (function() {
testElementFocused: function(selector, msg) {
var focusedEl = $(":focus");
if (focusedEl.is(selector)) {
if ($(selector).is(":focus")) {
ok(true, msg || selector + " is focused");
}
else {
......@@ -317,7 +317,7 @@ BrowserID.TestHelpers = (function() {
// check to see if it is possible to focus. If it is possible, this is
// a failure. If it is not possible, print a message and continue.
// Remove the element when complete.
var input = $("<input type='text' />").appendTo("body").focus();
var input = $("<input type='radio' />").appendTo("body").focus();
if (input.is(":focus")) {
ok(false, msg || selector + " is focused");
// refocus the original input element.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment