<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<script src="../../../resources/testdriver.js"></script>
<script src="../../../resources/testdriver-vendor.js"></script>
<script src="../resources/picker-common.js"></script>
<style>
#menu {
-webkit-appearance: none;
width: 100px;
}
</style>
<select id="menu">
<option>o1</option>
<option>o2</option>
</select>
<script>
function openPickerErrorCallback() {
testFailed('picker didn\'t open')
finishJSTest();
}
function checkPopupWidth() {
shouldBe('internals.pagePopupWindow.innerWidth', '150');
finishJSTest();
}
var menu = document.getElementById('menu');
openPickerDeprecatedJsTest(menu, function() {
shouldBe('internals.pagePopupWindow.innerWidth', '100');
internals.pagePopupWindow.addEventListener("resize", checkPopupWidth, false);
setTimeout(function() {
testFailed('Popup wasn\'t resized.');
finishJSTest();
}, 3000);
menu.style.width = "150px";
menu.offsetTop;
}, openPickerErrorCallback);
</script>