Skip to content

Commit

Permalink
Bug 1917296 - [devtools] Stop propagation of Raw toggle keydown event…
Browse files Browse the repository at this point in the history
… in Netmonitor Headers panel. r=bomsy,devtools-reviewers.

Assertions are added for all the "Raw" toggle we have in the Request detail panel.

Differential Revision: https://phabricator.services.mozilla.com/D222401

UltraBlame original commit: f9a724824507d2cdfea1156407fc8edf3963d941
  • Loading branch information
marco-c committed Sep 20, 2024
1 parent 43870e3 commit 6fa1886
Show file tree
Hide file tree
Showing 5 changed files with 297 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2401,6 +2401,19 @@ stopPropagation
)
;
}
onKeyDown
:
event
=
>
{
event
.
stopPropagation
(
)
;
}
}
span
(
Expand Down
32 changes: 30 additions & 2 deletions devtools/client/netmonitor/test/browser_net_complex-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -1115,15 +1115,43 @@ toggle
"
)
;
clickElement
rawDataToggle
.
focus
(
)
;
EventUtils
.
synthesizeKey
(
"
VK_SPACE
"
{
}
rawDataToggle
monitor
.
ownerGlobal
)
;
await
waitForContent
;
ok
(
!
rawDataToggle
.
checked
"
Raw
toggle
is
unchecked
"
)
;
}
async
function
Expand Down
120 changes: 120 additions & 0 deletions devtools/client/netmonitor/test/browser_net_headers_sorted.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,4 +911,124 @@ sorted
"
)
;
for
(
const
rawToggleInput
of
document
.
querySelectorAll
(
"
.
devtools
-
checkbox
-
toggle
"
)
)
{
ok
(
rawToggleInput
.
checked
"
Toggle
is
checked
"
)
;
rawToggleInput
.
focus
(
)
;
EventUtils
.
synthesizeKey
(
"
VK_SPACE
"
{
}
rawToggleInput
.
ownerGlobal
)
;
}
await
waitUntil
(
(
)
=
>
!
document
.
querySelector
(
"
textarea
.
raw
-
headers
"
)
)
;
ok
(
true
"
Raw
headers
are
hidden
"
)
;
for
(
const
rawToggleInput
of
document
.
querySelectorAll
(
"
.
devtools
-
checkbox
-
toggle
"
)
)
{
ok
(
!
rawToggleInput
.
checked
"
Toggle
is
unchecked
"
)
;
}
}
67 changes: 67 additions & 0 deletions devtools/client/netmonitor/test/browser_net_json_text_mime.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,73 @@ testResponseTab
(
)
;
ok
(
rawResponseToggle
.
checked
"
Raw
toggle
is
checked
"
)
;
wait
=
waitForDOM
(
document
"
#
response
-
panel
.
data
-
header
"
)
;
rawResponseToggle
.
focus
(
)
;
EventUtils
.
synthesizeKey
(
"
VK_SPACE
"
{
}
rawResponseToggle
.
ownerGlobal
)
;
await
wait
;
ok
(
!
rawResponseToggle
.
checked
"
Raw
toggle
is
unchecked
"
)
;
await
teardown
(
Expand Down
67 changes: 67 additions & 0 deletions devtools/client/netmonitor/test/browser_net_ws-json-payload.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,73 @@ correctly
"
)
;
ok
(
rawDataToggle
.
checked
"
Raw
toggle
is
checked
"
)
;
wait
=
waitForDOM
(
document
"
#
messages
-
view
.
data
-
label
"
)
;
rawDataToggle
.
focus
(
)
;
EventUtils
.
synthesizeKey
(
"
VK_SPACE
"
{
}
rawDataToggle
.
ownerGlobal
)
;
await
wait
;
ok
(
!
rawDataToggle
.
checked
"
Raw
toggle
is
unchecked
"
)
;
await
SpecialPowers
.
Expand Down

0 comments on commit 6fa1886

Please sign in to comment.