chromium/third_party/blink/web_tests/plugins/focus-change-1-no-change.html


<!DOCTYPE html>
<title>Test no change of focus inside plugin onfocus and onblur events</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>

<input id="input1" type="text" onfocus="i1Focus()" onblur="i1Blur()">
<input id="input2" type="text" onfocus="i2Focus()" onblur="i2Blur()">
<embed id="plugin" type="application/x-webkit-test-webplugin" onfocus="pFocus()" onblur="pBlur()"></embed>

<script>
let events = [];
function i1Focus() { events.push('i1focus'); }
function i1Blur() { events.push('i1blur'); }
function i2Focus() { events.push('i2focus'); }
function i2Blur() { events.push('i2blur'); }
function pFocus() { events.push('pfocus'); }
function pBlur() { events.push('pblur'); }

async_test(t => {
  function finish() {
    assert_array_equals(events, ["i1focus","i1blur","pfocus","pblur","i2focus"]);
    t.done();
  }
  document.getElementById('input1').focus();
  document.getElementById('plugin').focus();
  document.getElementById('input2').focus();

  t.step_timeout(finish, 0);
},"Test plugin focus behavior");
</script>