blob: b64e96bb1413b4e7f09cf773ead6b0fc2416461f [file]
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script src="../../../resources/js-test.js"></script>
<script src="../../../resources/ui-helper.js"></script>
</head>
<body>
<select id="select">
<option>1</option>
</select>
</body>
<script>
jsTestIsAsync = true;
addEventListener("load", async () => {
description("This test verifies that updating a &lt;select&gt; element's menu while it is visible does not result in a hang.");
await UIHelper.activateElement(select);
items = await UIHelper.selectMenuItems();
shouldBeEqualToNumber("items.length", 1);
for (let i = 1; i <= 1000; i++) {
let option = document.createElement("option");
option.text = i + 1;
select.appendChild(option);
}
await UIHelper.delayFor(200);
items = await UIHelper.selectMenuItems();
shouldBeEqualToNumber("items.length", 1001);
await UIHelper.selectFormAccessoryPickerRow(1);
await UIHelper.waitForContextMenuToHide();
finishJSTest();
});
</script>
</html>