Skip to content

Commit

Permalink
Bug 1550197 [wpt PR 16330] - HTML: ensure BarProps are visible for no…
Browse files Browse the repository at this point in the history
…opener/noreferrer, a=testonly

Automatic update from web-platform-tests
HTML: ensure BarProps are visible for noopener/noreferrer

For whatwg/html#3297.

--

wpt-commits: ce675f004d08b1dfd7f4bbf3dbb422229addedac
wpt-pr: 16330

UltraBlame original commit: 5e1ab479dde3882aa3d4661a4f3336df60d8dec8
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent 02437dc commit 8d80e02
Show file tree
Hide file tree
Showing 2 changed files with 346 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
const
barProps
=
[
"
locationbar
"
"
menubar
"
"
personalbar
"
"
scrollbars
"
"
statusbar
"
"
toolbar
"
]
;
test
(
(
)
=
>
{
for
(
const
prop
of
barProps
)
{
assert_true
(
window
[
prop
]
.
visible
)
;
}
}
"
All
bars
visible
"
)
;
[
"
noopener
"
"
noreferrer
"
]
.
forEach
(
openerStyle
=
>
{
async_test
(
t
=
>
{
const
channelName
=
"
5454
"
+
openerStyle
+
"
34324
"
;
const
channel
=
new
BroadcastChannel
(
channelName
)
;
window
.
open
(
"
support
/
BarProp
-
target
.
html
?
"
+
channelName
"
"
openerStyle
)
;
channel
.
onmessage
=
t
.
step_func_done
(
e
=
>
{
/
/
Send
message
first
so
if
asserts
throw
the
popup
is
still
closed
channel
.
postMessage
(
null
)
;
for
(
const
prop
of
barProps
)
{
assert_true
(
e
.
data
[
prop
]
)
;
}
}
)
;
}
window
.
open
(
)
with
{
openerStyle
}
should
have
all
bars
visible
)
;
}
)
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<
!
DOCTYPE
html
>
<
script
>
const
barProps
=
[
"
locationbar
"
"
menubar
"
"
personalbar
"
"
scrollbars
"
"
statusbar
"
"
toolbar
"
]
;
const
barPropsObj
=
{
}
;
const
channelName
=
location
.
search
.
substr
(
1
)
;
const
channel
=
new
BroadcastChannel
(
channelName
)
;
for
(
const
prop
of
barProps
)
{
barPropsObj
[
prop
]
=
window
[
prop
]
.
visible
;
}
channel
.
postMessage
(
barPropsObj
)
;
/
/
Because
messages
are
not
delivered
synchronously
and
because
closing
a
/
/
browsing
context
prompts
the
eventual
clearing
of
all
task
sources
this
/
/
document
should
not
be
closed
until
the
opener
document
has
confirmed
/
/
receipt
.
channel
.
onmessage
=
(
)
=
>
{
window
.
close
(
)
}
;
<
/
script
>

0 comments on commit 8d80e02

Please sign in to comment.