Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / inspector / injected-script-for-origin.html
blobbf4566226114d2e45c4e2b3d478a9ae26f33a36c
1 <html>
2 <head>
3 <script src="inspector-test.js"></script>
5 <script>
6 function test()
8 var messages = [];
9 function onMessage(event)
11 messages.push(event.data);
12 if (messages.length === 2) {
13 top.removeEventListener("message", onMessage, false);
14 messages.sort();
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");
25 iframe.src = url;
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");
31 </script>
32 </head>
33 <body onload="runTest()">
34 <p>
35 Tests that different scripts are injected inso subframes of inspector window depending on the origin
36 </p>
37 </body>
38 </html>