| OLD | NEW |
| 1 if (window.layoutTestController) { | 1 if (window.layoutTestController) { |
| 2 layoutTestController.waitUntilDone(); | 2 layoutTestController.waitUntilDone(); |
| 3 layoutTestController.dumpAsText(); | 3 layoutTestController.dumpAsText(); |
| 4 } | 4 } |
| 5 | 5 |
| 6 var consoleOutput = null; | 6 var consoleOutput = null; |
| 7 var stopTest = false; | 7 var stopTest = false; |
| 8 var focusCount = 0; | 8 var focusCount = 0; |
| 9 var blurCount = 0; | 9 var blurCount = 0; |
| 10 var focusedElem = null; | 10 var focusedElem = null; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 function test() | 43 function test() |
| 44 { | 44 { |
| 45 for (var i = 0; i < 2; ++i) | 45 for (var i = 0; i < 2; ++i) |
| 46 focusEachChild(window.frames[i].document.body); | 46 focusEachChild(window.frames[i].document.body); |
| 47 | 47 |
| 48 // focus an untested element so that blur can be dispatched on the last ifra
me tested | 48 // focus an untested element so that blur can be dispatched on the last ifra
me tested |
| 49 var homeBase = window.frames[1].document.getElementsByClassName('homebase'); | 49 var homeBase = window.frames[1].document.getElementsByClassName('homebase'); |
| 50 homeBase[0].focus(); | 50 homeBase[0].focus(); |
| 51 | 51 |
| 52 var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatche
d, and should be 329 / 329 "; | 52 var resultSummary = focusCount+" focus / "+blurCount+" blur events dispatche
d, and should be 335 / 335 "; |
| 53 resultSummary += (focusCount==blurCount) ? "<span style='color:green'>PASSED
</span><br>" : "<span style='color:red'>FAILED</span><br>"; | 53 resultSummary += (focusCount==blurCount) ? "<span style='color:green'>PASSED
</span><br>" : "<span style='color:red'>FAILED</span><br>"; |
| 54 resultSummary += "Total of "+failedTestCount+" focus test(s) failed."; | 54 resultSummary += "Total of "+failedTestCount+" focus test(s) failed."; |
| 55 if (failedTestCount) | 55 if (failedTestCount) |
| 56 resultSummary += "<br>Details:<br>"+consoleOutput.innerHTML; | 56 resultSummary += "<br>Details:<br>"+consoleOutput.innerHTML; |
| 57 else | 57 else |
| 58 resultSummary += " <span style='color:green'>PASSED</span>"; | 58 resultSummary += " <span style='color:green'>PASSED</span>"; |
| 59 | 59 |
| 60 document.write(resultSummary); | 60 document.write(resultSummary); |
| 61 document.close(); | 61 document.close(); |
| 62 | 62 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 failedTestCount++; | 119 failedTestCount++; |
| 120 printToConsole(elem.id+" FAILED - was " + (focusedElem ? "" : " not ") +
" focused but focus " + (elemThatShouldFocus ? " was " : " wasn\'t") + " expect
ed"); | 120 printToConsole(elem.id+" FAILED - was " + (focusedElem ? "" : " not ") +
" focused but focus " + (elemThatShouldFocus ? " was " : " wasn\'t") + " expect
ed"); |
| 121 if (elemThatShouldFocus && focusedElem) | 121 if (elemThatShouldFocus && focusedElem) |
| 122 printToConsole("elemThatShouldFocus is <"+elemThatShouldFocus.tagNam
e+"> "+elemThatShouldFocus.id+", focusedElem is <"+focusedElem.tagName+"> "+focu
sedElem.id); | 122 printToConsole("elemThatShouldFocus is <"+elemThatShouldFocus.tagNam
e+"> "+elemThatShouldFocus.id+", focusedElem is <"+focusedElem.tagName+"> "+focu
sedElem.id); |
| 123 if (!elemThatShouldFocus) | 123 if (!elemThatShouldFocus) |
| 124 printToConsole("elemThatShouldFocus is null, focusedElem is <"+focus
edElem.tagName+"> "+focusedElem.id); | 124 printToConsole("elemThatShouldFocus is null, focusedElem is <"+focus
edElem.tagName+"> "+focusedElem.id); |
| 125 if (!focusedElem) | 125 if (!focusedElem) |
| 126 printToConsole("elemThatShouldFocus is <"+elemThatShouldFocus.tagNam
e+"> "+elemThatShouldFocus.id+", focusedElem is null"); | 126 printToConsole("elemThatShouldFocus is <"+elemThatShouldFocus.tagNam
e+"> "+elemThatShouldFocus.id+", focusedElem is null"); |
| 127 } | 127 } |
| 128 } | 128 } |
| OLD | NEW |