chromium/third_party/blink/web_tests/fast/forms/select/menulist-disabled-selected-option.html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description('Check that a select control does not produce a form value if the selected option element is disabled.');

var parent = document.createElement('div');
document.body.appendChild(parent);
parent.innerHTML = '<form action="">'
    + '<input type=hidden name="submitted" value="true">'
    + '<select name="select">'
    + '<option disabled>Disabled</option>'
    + '<option>Enabled</option>'
    + '</select>'
    + '</form>';

if (window.testRunner)
    testRunner.waitUntilDone();
var query = window.location.search;
if (query.indexOf('submitted=true') == -1) {
    var select = document.getElementsByTagName('select')[0];
    select.selectedIndex = 0;
    document.forms[0].submit();
} else {
    shouldBe('query.indexOf("select=Disabled")', '-1');
    shouldBe('query.indexOf("select=Enabled")', '-1');
    if (window.testRunner)
        testRunner.notifyDone();
}
</script>
</body>
</html>