Bug 759017 - Fix test that wasn't correctly checking keyCode in the whitelist. r=jlebar
authorMounir Lamouri <mounir.lamouri@gmail.com>
Thu, 31 May 2012 16:39:35 +0200
changeset 99456 f16847bdf08665441832bafd04fcd81ca70184c9
parent 99455 a35f9c1fef546f1b6203577a7091e1dc88807827
child 99457 7bcf7ead7392057b9631fa6ee8012a53a92c6880
push idunknown
push userunknown
push dateunknown
reviewersjlebar
bugs759017
milestone15.0a1
Bug 759017 - Fix test that wasn't correctly checking keyCode in the whitelist. r=jlebar
dom/tests/mochitest/browser-frame/test_browserFrame_keyEvents.html
--- a/dom/tests/mochitest/browser-frame/test_browserFrame_keyEvents.html
+++ b/dom/tests/mochitest/browser-frame/test_browserFrame_keyEvents.html
@@ -43,17 +43,17 @@ iframe.src = browserFrameHelpers.focusPa
 document.body.appendChild(iframe);
 
 // Number of expected events at which point we will consider the test as done.
 var nbEvents = 15;
 
 function eventHandler(e) {
   ok(((e.type == 'keydown' || e.type == 'keypress' || e.type == 'keyup') &&
       !e.defaultPrevented &&
-      whitelistedEvents.indexOf(e.keyCode)),
+      (whitelistedEvents.indexOf(e.keyCode) != -1)),
       "[ " + e.type + "] Handled event should be a non prevented key event in the white list.");
 
   nbEvents--;
 
   if (nbEvents == 0) {
     browserFrameHelpers.restoreOriginalPrefs();
     SimpleTest.finish();
     return;