blob: 5091b6403cfe3a04d08602229bdaae909b3edbed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
async function referrer_test(expected, uid) {
const bc = new PrerenderChannel('prerender-channel', uid);
const gotMessage = new Promise(resolve => {
bc.addEventListener('message', e => {
resolve(e.data);
}, {once: true});
});
// Start prerendering a page that will echo its referrer.
startPrerendering(`resources/echo-referrer.py?uid=${uid}`);
const result = await gotMessage;
assert_equals(result.referrer, expected, 'referrer');
}
|