Revision 5e8eef740f9a79e5626fa41ef67a4b6284a6490b authored by Kouhei Ueno on 06 October 2017, 06:35:33 UTC, committed by Chromium WPT Sync on 06 October 2017, 06:35:33 UTC
Dynamic imports rely on url, nonce, and parser state to be attributed correctly.
This CL updates ScheduledAction to plumb down the info as spec-ed via ScriptSourceCode.

Test: LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-propagate-nonce-setTimeout.html
Bug: 711706
Change-Id: Iabb21f72d9cdafce502aa131773268ba20dd1648
1 parent 531cc81
Raw File
port-blocking.https.window.js
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
// META: script=resources/utils.js
'use strict';

// Tests that requests to bad ports are blocked.
// https://fetch.spec.whatwg.org/#port-blocking

// This is not a comprehensive test of blocked ports - it is just intended to
// check that blocking is enabled.

backgroundFetchTest((t, bgFetch) => {
  return bgFetch.fetch(uniqueTag(), 'https://example.com');
}, 'fetch to default https port should register ok');

backgroundFetchTest((t, bgFetch) => {
  return bgFetch.fetch(uniqueTag(), 'http://127.0.0.1');
}, 'fetch to default http port should register ok');

backgroundFetchTest((t, bgFetch) => {
  return bgFetch.fetch(uniqueTag(), 'https://example.com:443');
}, 'fetch to port 443 should register ok');

backgroundFetchTest((t, bgFetch) => {
  return bgFetch.fetch(uniqueTag(), 'https://example.com:80');
}, 'fetch to port 80 should register ok, even over https');

backgroundFetchTest((t, bgFetch) => {
  return bgFetch.fetch(uniqueTag(), 'https://example.com:8080');
}, 'fetch to non-default non-bad port (8080) should register ok');

backgroundFetchTest((t, bgFetch) => {
  return promise_rejects(
      t, new TypeError(),
      bgFetch.fetch(uniqueTag(), 'https://example.com:587'));
}, 'fetch to bad port (SMTP) should reject');
back to top