1<!DOCTYPE html>
2<html>
3  <head>
4    %(meta)s
5    <script src="/common/security-features/resources/common.sub.js"></script>
6    <script>
7    // Receive a message from the parent and start the test.
8    function onMessageFromParent(event) {
9      // Because this window might receive messages from child iframe during
10      // tests, we first remove the listener here before staring the test.
11      window.removeEventListener('message', onMessageFromParent);
12
13      const configurationError = "%(error)s";
14      if (configurationError.length > 0) {
15        parent.postMessage({error: configurationError}, "*");
16        return;
17      }
18
19      invokeRequest(event.data.subresource,
20                    event.data.sourceContextList)
21        .then(result => parent.postMessage(result, "*"))
22        .catch(e => {
23            const message = (e.error && e.error.stack) || e.message || "Error";
24            parent.postMessage({error: message}, "*");
25          });
26    }
27    window.addEventListener('message', onMessageFromParent);
28    </script>
29  </head>
30</html>
31