3 <script src=
"inspector-test.js"></script>
9 function onMessage(event
)
11 messages
.push(event
.data
);
12 if (messages
.length
=== 2) {
13 top
.removeEventListener("message", onMessage
, false);
15 InspectorTest
.addObject(messages
);
16 InspectorTest
.completeTest();
19 top
.addEventListener("message", onMessage
, false);
20 InspectorFrontendHost
.setInjectedScriptForOrigin("http://127.0.0.1:8000", "(function() { window.foo = '127.0.0.1'; return {}})");
21 InspectorFrontendHost
.setInjectedScriptForOrigin("http://localhost:8000", "(function() { window.foo = 'localhost'; return {}})");
22 function addSubframe(url
)
24 var iframe
= document
.createElement("iframe");
26 document
.body
.appendChild(iframe
);
28 addSubframe("http://127.0.0.1:8000/inspector/resources/injected-script-for-origin-frame.html");
29 addSubframe("http://localhost:8000/inspector/resources/injected-script-for-origin-frame.html");
33 <body onload=
"runTest()">
35 Tests that different scripts are injected inso subframes of inspector window depending on the origin