@@ -42,6 +42,42 @@ test("cross-domain embed is loading", async ({ page }) => {
42
42
await expect ( res ) . toContainText ( "Want to help" ) ;
43
43
} ) ;
44
44
45
+ test ( "same-domain iframe embed is loading" , async ( { page } ) => {
46
+ await page . goto ( "http://localhost:9990/iframe-test.html" ) ;
47
+
48
+ const res = page
49
+ . locator ( "replay-web-page" )
50
+ . frameLocator ( "iframe" )
51
+ . locator ( "replay-app-main wr-item wr-coll-replay" )
52
+ . frameLocator ( "iframe" )
53
+ . locator ( "body" ) ;
54
+
55
+ await expect ( res ) . toContainText ( "Outside iframe" ) ;
56
+
57
+ const inside = res . frameLocator ( "iframe" ) . locator ( "body" ) ;
58
+
59
+ await expect ( inside ) . toContainText ( "Inside iframe" ) ;
60
+
61
+ } ) ;
62
+
63
+ test ( "cross-domain iframe embed is loading" , async ( { page } ) => {
64
+ await page . goto ( "http://localhost:8020/iframe-test-cross.html" ) ;
65
+
66
+ const res = page
67
+ . locator ( "replay-web-page" )
68
+ . frameLocator ( "iframe" )
69
+ . locator ( "replay-app-main wr-item wr-coll-replay" )
70
+ . frameLocator ( "iframe" )
71
+ . locator ( "body" ) ;
72
+
73
+ await expect ( res ) . toContainText ( "Outside iframe" ) ;
74
+
75
+ const inside = res . frameLocator ( "iframe" ) . locator ( "body" ) ;
76
+
77
+ await expect ( inside ) . toContainText ( "Inside iframe" ) ;
78
+
79
+ } ) ;
80
+
45
81
test ( "sandbox + cross-domain embed is loading" , async ( { page } ) => {
46
82
await page . goto ( "http://localhost:8030/" ) ;
47
83
@@ -73,7 +109,7 @@ test("require subdomain iframe", async ({ page }) => {
73
109
) ;
74
110
} ) ;
75
111
76
- test ( "csp blocking in place" , async ( { page } ) => {
112
+ test ( "csp blocking in place" , async ( { page } , workerInfo ) => {
77
113
await page . goto ( "http://localhost:9990/embed.html" ) ;
78
114
79
115
const frame = page
@@ -114,6 +150,8 @@ test("csp blocking in place", async ({ page }) => {
114
150
115
151
// (5-6) blocked by csp policy, even though local
116
152
block += await blocked ( iframe . contentWindow , "http://localhost:9990/sw.js" ) ;
153
+
154
+ // not blocked in FF
117
155
block += await blocked (
118
156
iframe . contentWindow ,
119
157
"http://localhost:9990/static/wombat.js" ,
@@ -122,5 +160,19 @@ test("csp blocking in place", async ({ page }) => {
122
160
return block ;
123
161
} ) ;
124
162
125
- expect ( didNotFetch ) . toBe ( 6 ) ;
163
+ const name = workerInfo . project . name ;
164
+
165
+ switch ( name ) {
166
+ case "chrome" :
167
+ expect ( didNotFetch ) . toBe ( 6 ) ;
168
+ break ;
169
+
170
+ case "firefox" :
171
+ expect ( didNotFetch ) . toBe ( 5 ) ;
172
+ break ;
173
+
174
+ case "webkit" :
175
+ expect ( didNotFetch ) . toBe ( 4 ) ;
176
+ break ;
177
+ }
126
178
} ) ;
0 commit comments