3 <script src =
"../../../resources/js-test.js"> </script>
5 <body onload=
"runTest()">
6 <input type=
"text" id=
"text"/>
9 var blurEventCounter
= 0;
10 var changeEventCounter
= 0;
13 description('Test when window out of focus, should dispatch both blur and change event');
14 var text
= document
.getElementById('text');
15 text
.addEventListener('change', function() {
18 text
.addEventListener('blur', function() {
20 shouldEvaluateTo('blurEventCounter', 1);
21 shouldEvaluateTo('changeEventCounter', 1);
25 document
.execCommand('InsertText', false, 'hello world');
26 shouldEvaluateTo('blurEventCounter', 0);
27 shouldEvaluateTo('changeEventCounter', 0);
28 window
.testRunner
.setMainFrameIsFirstResponder(true);
29 window
.testRunner
.setWindowIsKey(false);
31 if (window
.testRunner
)
32 window
.jsTestIsAsync
= true;