https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 7b89105f042755ba3ef1c346cba087cfb758d0d6 authored by Luke Bjerring on 23 March 2018, 17:36:39 UTC
Support partial dictionaries
Tip revision: 7b89105
embed-and-object-are-not-intercepted.https.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>embed and object are not intercepted</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="resources/test-helpers.sub.js?pipe=sub"></script>
<body>
<script>
let registration;

const kScript = 'resources/embed-and-object-are-not-intercepted-worker.js';
const kScope = 'resources/';

promise_test(t => {
    return service_worker_unregister_and_register(t, kScript, kScope)
      .then(registration => {
          promise_test(() => {
              return registration.unregister();
            }, 'restore global state');

          return wait_for_state(t, registration.installing, 'activated');
        })
  }, 'initialize global state');

promise_test(t => {
    let frame;
    return with_iframe('resources/embed-is-not-intercepted-iframe.html')
      .then(f => {
          frame = f;
          t.add_cleanup(() => { frame.remove(); });
          return frame.contentWindow.test_promise;
        })
      .then(result => {
          assert_equals(result, 'request for embedded content was not intercepted');
        });
  }, 'requests for EMBED elements of embedded HTML content should not be intercepted by service workers');

promise_test(t => {
    let frame;
    return with_iframe('resources/object-is-not-intercepted-iframe.html')
      .then(f => {
          frame = f;
          t.add_cleanup(() => { frame.remove(); });
          return frame.contentWindow.test_promise;
        })
      .then(result => {
          assert_equals(result, 'request for embedded content was not intercepted');
        });
  }, 'requests for OBJECT elements of embedded HTML content should not be intercepted by service workers');

promise_test(t => {
    let frame;
    return with_iframe('resources/embed-image-is-not-intercepted-iframe.html')
      .then(f => {
          frame = f;
          t.add_cleanup(() => { frame.remove(); });
          return frame.contentWindow.test_promise;
        })
      .then(result => {
          assert_equals(result, 'request was not intercepted');
        });
  }, 'requests for EMBED elements of an image should not be intercepted by service workers');

promise_test(t => {
    let frame;
    return with_iframe('resources/object-image-is-not-intercepted-iframe.html')
      .then(f => {
          frame = f;
          t.add_cleanup(() => { frame.remove(); });
          return frame.contentWindow.test_promise;
        })
      .then(result => {
          assert_equals(result, 'request was not intercepted');
        });
  }, 'requests for OBJECT elements of an image should not be intercepted by service workers');

</script>
back to top