Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit ce8bdf5

Browse files
committed
Add a test for remote frames fix
This test only works when we start chrome in headful mode. Skipping for now, but leaving it in for posterity.
1 parent b7b5696 commit ce8bdf5

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

tests/frame_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,36 @@ func TestFrameDismissDialogBox(t *testing.T) {
7272
})
7373
}
7474
}
75+
76+
func TestFrameNoPanicWithEmbeddedIFrame(t *testing.T) {
77+
// This test only works when headless mode is false.
78+
t.SkipNow()
79+
80+
t.Parallel()
81+
82+
b := newTestBrowser(t, withFileServer())
83+
p := b.NewPage(nil)
84+
85+
var result string
86+
err := b.await(func() error {
87+
opts := b.toGojaValue(struct {
88+
WaitUntil string `js:"waitUntil"`
89+
}{
90+
WaitUntil: "load",
91+
})
92+
pageGoto := p.Goto(
93+
b.staticURL("embedded_iframe.html"),
94+
opts,
95+
)
96+
97+
b.promise(pageGoto).
98+
then(func() {
99+
result = p.TextContent("#doneDiv", nil)
100+
})
101+
102+
return nil
103+
})
104+
require.NoError(t, err)
105+
106+
assert.EqualValues(t, "Done!", result)
107+
}

tests/static/embedded_iframe.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<html>
2+
<head></head>
3+
<body>
4+
<div id='doneDiv'></div>
5+
<iframe src='https://www.youtube.com/embed/gwO7k5RTE54?wmode=opaque&amp;enablejsapi=1' onload='document.getElementById("doneDiv").innerText = "Done!"'></iframe>
6+
</body>
7+
</html>

0 commit comments

Comments
 (0)