diff --git a/testing/web-platform/tests/html/user-activation/activation-thru-contextmenu-event.html b/testing/web-platform/tests/html/user-activation/activation-thru-contextmenu-event.html deleted file mode 100644 index 7f84577b7f0f1..0000000000000 --- a/testing/web-platform/tests/html/user-activation/activation-thru-contextmenu-event.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - User activation with 'contextmenu' event - - - - - - - - - - - - - -

User activation with 'contextmenu' event

-

Tests that a 'contextmenu' event is treated like a user activation.

-
    -
  1. Right-click or long-press on green.
  2. -
  3. Click or tap on Done.
  4. -
-
- - - diff --git a/testing/web-platform/tests/html/user-activation/activation-trigger-click.html b/testing/web-platform/tests/html/user-activation/activation-trigger-click.html deleted file mode 100644 index abf685f9220e3..0000000000000 --- a/testing/web-platform/tests/html/user-activation/activation-trigger-click.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - -

Test for click activation trigger

-

Tests that a popup is allowed with user activation from a click event.

-
    -
  1. 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.

  1. 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"); diff --git a/testing/web-platform/tests/html/user-activation/activation-trigger-keyboard-escape.html b/testing/web-platform/tests/html/user-activation/activation-trigger-keyboard-escape.html new file mode 100644 index 0000000000000..76bdefbb19ac3 --- /dev/null +++ b/testing/web-platform/tests/html/user-activation/activation-trigger-keyboard-escape.html @@ -0,0 +1,37 @@ + + + + + + + + + + +

    Test for keyboard activation trigger for ESCAPE key

    +

    Tests missing user activation from a ESCAPE keyboard event.

    + +
      +
    1. Press ESCAPE key. +
    + + + diff --git a/testing/web-platform/tests/html/user-activation/activation-trigger-mouse-left.html b/testing/web-platform/tests/html/user-activation/activation-trigger-mouse-left.html new file mode 100644 index 0000000000000..8bde4dd2edc17 --- /dev/null +++ b/testing/web-platform/tests/html/user-activation/activation-trigger-mouse-left.html @@ -0,0 +1,41 @@ + + + + + + + + + + +

    Test for click activation trigger

    +

    Tests user activation from a mouse click.

    +
      +
    1. Click anywhere in the document. +
    + + + diff --git a/testing/web-platform/tests/html/user-activation/activation-trigger-mouse-right.html b/testing/web-platform/tests/html/user-activation/activation-trigger-mouse-right.html new file mode 100644 index 0000000000000..a4734d06a12bc --- /dev/null +++ b/testing/web-platform/tests/html/user-activation/activation-trigger-mouse-right.html @@ -0,0 +1,58 @@ + + + + + + + + + + + +

    Test for right-click activation trigger

    +

    Tests user activation from a mouse right-click.

    +
      +
    1. Right-click anywhere in the document. +
    + + +