summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/document-policy/reporting/lossy-images-max-bpp-reporting-tentative.html
blob: b6876f4880f4b985cde0e6871f95b03adb0ebde4 (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
25
26
27
<!DOCTYPE html>
<html>
  <head>
    <script src='/resources/testharness.js'></script>
    <script src='/resources/testharnessreport.js'></script>
  </head>
  <body>
    <img src="./unoptimized-image.jpg">
    <script>
var check_report_format = (reports, observer) => {
  let report = reports[0];
  assert_equals(report.type, "document-policy-violation");
  assert_equals(report.url, document.location.href);
  assert_equals(report.body.featureId, "lossy-images-max-bpp");
  assert_equals(report.body.disposition, "enforce");
  assert_equals(report.body.sourceFile, document.getElementsByTagName('img')[0].src);
  assert_equals(report.body.lineNumber, null);
  assert_equals(report.body.columnNumber, null);
};

async_test(t => {
  new ReportingObserver(t.step_func_done(check_report_format),
                        {types: ['document-policy-violation'], buffered: true}).observe();
}, "unoptimized-images Report Format");
    </script>
  </body>
</html>