Bug 1528949 [wpt PR 15460] - HTML: window.focus() sans browsing context, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Wed, 06 Mar 2019 12:35:01 +0000
changeset 522553 d3eedffa9545cd523e3632aac00c7336c056cbc6
parent 522552 9b7b2b7524d935e5a26ccd7a433146598a4eeb2e
child 522554 063b443f99cd6346bfaf3ac5f93f0c7019a27550
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1528949, 15460
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528949 [wpt PR 15460] - HTML: window.focus() sans browsing context, a=testonly Automatic update from web-platform-tests HTML: window.focus() sans browsing context For https://github.com/whatwg/html/pull/4377. -- wpt-commits: 84a44957233c13fb21f5d97b06db1d89076fb144 wpt-pr: 15460
testing/web-platform/tests/html/browsers/the-window-object/focus.window.js
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/the-window-object/focus.window.js
@@ -0,0 +1,15 @@
+async_test(t => {
+  const input = document.body.appendChild(document.createElement("input"));
+  input.onfocus = t.step_func(() => {
+    const frame = document.body.appendChild(document.createElement("iframe")),
+          frameW = frame.contentWindow;
+    frameW.onfocus = t.unreached_func();
+    frame.remove();
+    frameW.focus();
+    t.step_timeout(() => {
+      assert_equals(document.activeElement, input);
+      t.done();
+    }, 100);
+  });
+  input.focus();
+});