summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/select-popup/popup-menu-open-partially-visible.html
blob: 6521a1c5a0ed32df5055d9d1622e99320ec13b54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="../resources/picker-common.js"></script>
</head>
<body>
<select id="menu" style="position: absolute;">
  <option>o1</option>
  <option>o2</option>
</select>
<script>
var menu = document.getElementById('menu');
var picker;

function openPickerErrorCallback() {
  testFailed('picker didn\'t open')
  finishJSTest();
}
openPicker(menu, testPartiallyVisible, openPickerErrorCallback);

function testPartiallyVisible() {
  picker = window.internals.pagePopupWindow.global.picker;

  function onUpdate() {
    setTimeout(function() {
      shouldBeFalse('window.internals.pagePopupWindow.isWindowHidden()');
      picker.removeListener('didUpdate', onUpdate);
      finishJSTest();
    });
  }
  picker.on('didUpdate', onUpdate);
  menu.style.top = '-1px';
}
</script>
</body>
</html>