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
support.js
// For ignoring exception names (just for testing)
/*
_real_assert_throws = assert_throws;
function assert_throws(d, func, desc) {
    try {
        func();
    } catch(e) {
        return true;
    }
    assert_unreached("Didn't throw!");
}
*/

function dirname(path) {
    return path.replace(/\/[^\/]*$/, '/')
}

/* This subdomain should point to this same location */
var SUBDOMAIN = 'www1'
var SUBDOMAIN2 = 'www2'
var PORT = {{ports[http][1]}}
//XXX HTTPS
var PORTS = {{ports[https][0]}}

/* Changes http://example.com/abc/def/cool.htm to http://www1.example.com/abc/def/ */
var CROSSDOMAIN     = dirname(location.href)
                        .replace('://', '://' + SUBDOMAIN + '.')
var REMOTE_HOST     = SUBDOMAIN + '.' + location.host
var REMOTE_PROTOCOL = location.protocol
var REMOTE_ORIGIN   = REMOTE_PROTOCOL + '//' + REMOTE_HOST
back to top