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 9fad540 commit cefe48d
Show file tree
Hide file tree
Showing 5 changed files with 367 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2760,6 +2760,26 @@ stopPropagation
)
;
}
onKeyDown
:
event
=
>
{
/
/
stop
the
header
keydown
event
event
.
stopPropagation
(
)
;
}
}
span
(
Expand Down
45 changes: 43 additions & 2 deletions devtools/client/netmonitor/test/browser_net_complex-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,15 +1230,56 @@ toggle
"
)
;
clickElement
/
/
Use
keyboard
to
uncheck
the
toggle
so
we
test
Bug
1917296
rawDataToggle
.
focus
(
)
;
EventUtils
.
synthesizeKey
(
"
VK_SPACE
"
{
}
rawDataToggle
monitor
.
ownerGlobal
)
;
await
waitForContent
;
ok
(
!
rawDataToggle
.
checked
"
Raw
toggle
is
unchecked
"
)
;
}
async
function
Expand Down
144 changes: 144 additions & 0 deletions devtools/client/netmonitor/test/browser_net_headers_sorted.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,4 +1075,148 @@ sorted
"
)
;
/
/
Use
keyboard
to
uncheck
the
toggle
so
we
test
Bug
1917296
for
(
const
rawToggleInput
of
document
.
querySelectorAll
(
"
.
devtools
-
checkbox
-
toggle
"
)
)
{
ok
(
rawToggleInput
.
checked
"
Toggle
is
checked
"
)
;
rawToggleInput
.
focus
(
)
;
EventUtils
.
synthesizeKey
(
"
VK_SPACE
"
{
}
rawToggleInput
.
ownerGlobal
)
;
}
/
/
Wait
till
raw
headers
are
not
available
anymore
.
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
"
)
;
}
}
80 changes: 80 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 @@ -481,6 +481,86 @@ testResponseTab
(
)
;
/
/
Uncheck
the
toggle
with
the
keyboard
so
we
test
Bug
1917296
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
Loading

0 comments on commit cefe48d

Please sign in to comment.