https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e1321f59e821319d86425ee9027458ff9db35b05 authored by Jaewon Choi on 22 October 2018, 16:31:16 UTC
Add SameObject attribute to navigator xr with wpt
Tip revision: e1321f5
TrustedTypePolicyFactory-createPolicy-exposedTests.tentative.html
<!DOCTYPE html>
<script src="/resources/testharness.js" ></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/helper.sub.js"></script>
<body>
<script>
  //Not exposed policy test
  test(t => {
    let policy = window.TrustedTypes.createPolicy('SomeName', { createHTML: s => s } );
    assert_equals(window.TrustedTypes.getExposedPolicy('SomeName'), null);
  }, "Null is returned when policy is not exposed");

  //Non-existent policy test
  test(t => {
    let policy = window.TrustedTypes.createPolicy('SomeOtherName', { createHTML: s => s } );
    assert_equals(window.TrustedTypes.getExposedPolicy('JustAName'), null);
  }, "Null is returned when policy is non-existent");

  //Exposed policy test
  test(t => {
    let policy = window.TrustedTypes.createPolicy('EvenSomeOtherName', { createHTML: s => s }, true );
    assert_equals(window.TrustedTypes.getExposedPolicy('EvenSomeOtherName'), policy);
  }, "Policy is returned when exposed == true");
</script>
back to top