blob: cab5fb18fe111cf3491a8a24625b54852a5f7035 [file] [log] [blame]
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">
<html>
<head>
<title> Test XSLT </title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
// The page is expected to have 'oversized-images' threshold
// set to 2.0 in report only mode, i.e. images with
// actual_size / display_size ratio > 2.0 should generate
// violation reports.
async_test(t => {
new ReportingObserver(t.step_func_done((reports, _) => {
assert_equals(reports.length, 1);
const report = reports[0];
assert_equals(report.type, 'document-policy-violation');
assert_equals(report.body.featureId, 'oversized-images');
assert_equals(report.body.disposition, 'report');
}), {types: ['document-policy-violation']}).observe();
});
</script>
</head>
<body bgcolor="#ffffff">
<img src="resources/green-256x256.jpg" width="100"></img>
</body>
</html>
</xsl:template>
</xsl:stylesheet>