blob: 3d06e05ff48d02f04826f45fc1d978c78a78d2c8 [file] [log] [blame]
jhoneycutt@apple.com6feb30b2010-01-29 21:55:58 +00001<html>
2<head>
ap@apple.comfcade892017-05-19 23:37:59 +00003 <script src="../../resources/js-test.js"></script>
jhoneycutt@apple.com6feb30b2010-01-29 21:55:58 +00004</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
12not 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.comfcade892017-05-19 23:37:59 +000025 finishJSTest();
jhoneycutt@apple.com6feb30b2010-01-29 21:55:58 +000026 }
rniwa@webkit.org3526ecc32012-06-12 20:37:15 +000027 if (window.testRunner && window.accessibilityController) {
jhoneycutt@apple.com6feb30b2010-01-29 21:55:58 +000028 document.getElementById("notDRT").style.visibility = "hidden";
29
ap@apple.comfcade892017-05-19 23:37:59 +000030 jsTestIsAsync = true;
jhoneycutt@apple.com6feb30b2010-01-29 21:55:58 +000031
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>