Tests that a popup is allowed with user activation from a click event.
-
-
Click anywhere in the document.
-
-
-
-
diff --git a/testing/web-platform/tests/html/user-activation/activation-trigger-keypress.html b/testing/web-platform/tests/html/user-activation/activation-trigger-keyboard-enter.html
similarity index 59%
rename from testing/web-platform/tests/html/user-activation/activation-trigger-keypress.html
rename to testing/web-platform/tests/html/user-activation/activation-trigger-keyboard-enter.html
index cf3816fd95e9b..fd51229c5dba4 100644
--- a/testing/web-platform/tests/html/user-activation/activation-trigger-keypress.html
+++ b/testing/web-platform/tests/html/user-activation/activation-trigger-keyboard-enter.html
@@ -8,8 +8,8 @@
-
Test for keypress activation trigger
-
Tests that a popup is allowed with user activation from a keypress event.
+
Test for keyboard activation trigger for ENTER key
+
Tests user activation from a ENTER keyboard event.
Press ENTER key.
@@ -19,18 +19,25 @@
Test for keypress activation trigger
const ENTER_KEY = '\uE007';
test_driver.send_keys(document.body, ENTER_KEY);
+ let keydown_event = getEvent('keydown');
+ let keypress_event = getEvent('keypress');
let keyup_event = getEvent('keyup');
- await getEvent('keypress');
+ await keydown_event;
let consumed = await consumeTransientActivation();
assert_true(consumed,
- "ENTER keypress event should result in activation");
+ "ENTER keydown event should result in activation");
+
+ await keypress_event;
+ consumed = await consumeTransientActivation();
+ assert_false(consumed,
+ "ENTER keypress should have no activation after keydown consumption");
await keyup_event;
consumed = await consumeTransientActivation();
assert_false(consumed,
- "ENTER keyup should have no activation after keypress consumption");
- }, "Activation through keyboard event");
+ "ENTER keyup should have no activation after keydown consumption");
+ }, "Activation through ENTER keyboard event");