2 <body onload=
"dropFrame()">
3 This represents not an extension, but an HTML page within the test harness
4 webstore origin (www.example.com), for which the response headers have been
5 misconfigured to allow framing by the
127.0.0.1 origin.
10 var s
= location
.href
.toString();
11 if (s
.indexOf('127.0.0.1') > 0) {
12 // try to frame a copy of ourselves from the webstore origin.
13 var f
= document
.createElement('iframe');
14 f
.src
= s
.replace('127.0.0.1', 'www.example.com');
15 f
.onload
= checkFrame
;
16 f
.onerror
= checkFrame
;
17 document
.body
.appendChild(f
);
18 // There's an open issue in WK where neither onload or onerror fires
19 // when interrupted by XFO, so use a setInterval() workaround. Remove
20 // this workaround when resolved, but in the mean time, mark the test
21 // FLAKY, because there is no reason to believe the server will respond
22 // within the time frame.
23 interval_id
= setInterval("checkFrame()", 500);
27 function checkFrame() {
29 // If the frame was blocked, we instead have an about:blank frame which we
31 x
= window
.frames
[0].document
.location
.href
;
32 document
.title
= 'PASS: ' + x
;
33 clearInterval(interval_id
);
36 // Frame was not yet blocked, so we have no access.
37 if (++check_count
> 40) {
38 document
.title
= 'FAIL';
39 clearInterval(interval_id
);