summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/select/popup-closes-on-blur.html
blob: 1e788ed1189d98cd5cc9a4033163d28d774647d8 (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
38
39
40
<html>
    <head>
        <title></title>
        <script src="../../../resources/js-test.js"></script>
    </head>
    <body>
        <p id="description"></p>
        <div id="console"></div>
        <select name="switcher" id="switcher">
            <option value="one">One</option>
            <option value="two">Two</option>
        </select>
        <input id="text"></input>

        <script>
            function test()
            {
                if (!window.testRunner || !window.internals)
                    return;

                testRunner.dumpAsText();

                description('Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=113220">http://bugs.webkit.org/show_bug.cgi?id=113220</a>: ensures select popup closes when focus changes</i>.');

                popup = document.getElementById("switcher");
                popup.focus();

                eventSender.keyDown(" ", null);

                shouldBeTrue("internals.isSelectPopupVisible(popup)");

                var text = document.getElementById("text");
                text.focus();

                shouldBeFalse("internals.isSelectPopupVisible(popup)");
            }
            test();
        </script>
    </body>
</html>