This document describes types and concepts used across JavaScript and Python parts of this test framework. Please refer to the JSDoc in common.sub.js or docstrings in Python scripts (if any).
test_expansion_schema in spec.src.json, except for expansion, delivery_type, delivery_value, and source_context_list. Their values are strings specified in test_expansion_schema.source_context_listsubresource_policy_deliveriesspec.src.json): JSON objectdictPolicyDeliveryspec.src.json): JSON objectutil.PolicyDelivery@typedef PolicyDelivery in common.sub.js)SourceContextSubresource requests can be possibly sent from various kinds of fetch client's environment settings objects. For example:
<iframe>s, orWorkerGlobalScopes.A SourceContext object specifies one environment settings object, and an Array of SourceContext specifies a possibly nested context, from the outer-most to inner-most environment settings objects.
Note: The top-level document is processed and trimmed by the generator, and is not included in the sourceContextList field of Scenario in the generated output.
For example, [{sourceContextType: "srcdoc"}, {sourceContextType: "worker-classic"}] means that a subresource request is to be sent from a classic dedicated worker created from <iframe srcdoc> inside the top-level HTML Document.
Note: A SourceContext (or an array of SourceContext) is set based on the fetch client's settings object that is used for the subresource fetch, NOT on the module map settings object nor on the inner-most settings object that appears in the test. For example, the sourceContextList field of Scenario is [] (indicating the top-level Window):
new Worker('worker.js'). There is WorkerGlobalScope created from worker.js, but it isn‘t the fetch client’s settings object used for fetching worker.js itself.new Worker('top.js', {type: 'module'}) where top.js has import 'worker.js'. Again, the fetch client's settings object used for worker.js is the top-level Window, not WorkerGlobalScope created by top.js.sourceContextType: A string specifying the kind of the source context to be used. Valid values are the keys of sourceContextMap in common.sub.js, or "top" indicating the top-level Document ("top" is valid/used only in the generator).
policyDeliveries: A list of PolicyDelivery applied to the source context.
spec.src.json): JSON objectutil.SourceContext@typedef SourceContext in common.sub.js)