summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/client-hints/resources/expect-no-client-hints-headers.html
blob: 07eb0568d423498752a6caafecce06d14575a13c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<body>
<script>

// This test checks if browser attaches the viewport-width client hint in the
// HTTP request headers.

// resources/echo-client-hints-received.py sets the response headers depending on the set
// of client hints it receives in the request headers.

fetch("../resources/echo-client-hints-received.py").then(r => {
  if(r.status == 200 &&
     !r.headers.has("viewport-width-received") &&
     !r.headers.has("viewport-width-received")) {
    window.top.opener.postMessage('PASS', '*');
  } else {
    window.top.opener.postMessage('FAIL', '*');
  }
});

</script>
</body>
</html>