jhoneycutt@apple.com | 6feb30b | 2010-01-29 21:55:58 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
ap@apple.com | fcade89 | 2017-05-19 23:37:59 +0000 | [diff] [blame] | 3 | <script src="../../resources/js-test.js"></script> |
jhoneycutt@apple.com | 6feb30b | 2010-01-29 21:55:58 +0000 | [diff] [blame] | 4 | </head> |
| 5 | |
| 6 | <body id="body"> |
| 7 | |
| 8 | <input id="avnElement"> |
| 9 | <input id="avnElement2"> |
| 10 | |
| 11 | <p>This tests that posting a notification for a deleted element does |
| 12 | not cause a crash.</p> |
| 13 | |
| 14 | <p id="notDRT">This test should only be run inside of DumpRenderTree.</p> |
| 15 | |
| 16 | <p id="console"></p> |
| 17 | |
| 18 | <script> |
| 19 | function notificationReceived(event) |
| 20 | { |
| 21 | if (event != "value change event") |
| 22 | return; |
| 23 | |
| 24 | debug("PASS: Didn't crash."); |
ap@apple.com | fcade89 | 2017-05-19 23:37:59 +0000 | [diff] [blame] | 25 | finishJSTest(); |
jhoneycutt@apple.com | 6feb30b | 2010-01-29 21:55:58 +0000 | [diff] [blame] | 26 | } |
rniwa@webkit.org | 3526ecc3 | 2012-06-12 20:37:15 +0000 | [diff] [blame] | 27 | if (window.testRunner && window.accessibilityController) { |
jhoneycutt@apple.com | 6feb30b | 2010-01-29 21:55:58 +0000 | [diff] [blame] | 28 | document.getElementById("notDRT").style.visibility = "hidden"; |
| 29 | |
ap@apple.com | fcade89 | 2017-05-19 23:37:59 +0000 | [diff] [blame] | 30 | jsTestIsAsync = true; |
jhoneycutt@apple.com | 6feb30b | 2010-01-29 21:55:58 +0000 | [diff] [blame] | 31 | |
| 32 | var element = document.getElementById("avnElement"); |
| 33 | element.focus(); |
| 34 | |
| 35 | element.setAttribute("aria-valuenow", 2); |
| 36 | document.getElementById("body").removeChild(element); |
| 37 | |
| 38 | var element2 = document.getElementById("avnElement2"); |
| 39 | element2.focus(); |
| 40 | |
| 41 | accessibilityController.focusedElement.addNotificationListener(notificationReceived); |
| 42 | |
| 43 | element2.setAttribute("aria-valuenow", 2); |
| 44 | } |
| 45 | </script> |
| 46 | </body> |
| 47 | </html> |