forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsec-ch-ua.https.html
More file actions
41 lines (40 loc) · 1.21 KB
/
sec-ch-ua.https.html
File metadata and controls
41 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<head>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
var minor = "";
promise_test(t => {
return new Promise((resolve, reject) => {
var w;
window.onmessage = e => {
try {
assert_not_equals(e.data.header, "", "The `Sec-CH-UA` header is delivered.");
minor = e.data.header;
} catch (ex) {
reject(ex);
}
w.close();
resolve();
};
w = window.open("./resources/sec-ch-ua.py");
});
}, "Open HTTPS window prior to opt-in: `Sec-CH-UA` header with minor version.")
promise_test(t => {
return new Promise((resolve, reject) => {
var w;
window.onmessage = e => {
try {
assert_not_equals(e.data.header, "", "The `Sec-CH-UA` header is delivered.");
assert_not_equals(e.data.header, minor, "The `Sec-CH-UA` header is different after the opt-in than before.");
} catch (ex) {
reject(ex);
}
w.close();
resolve();
};
w = window.open("./resources/sec-ch-ua.py");
});
}, "Open HTTPS window post-opt-in: `Sec-CH-UA` header with minor version.")
</script>
</head>