Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / sources-panel-extension-names.html
blob3a9f192a525f5c37d1abfa0628de18fe890251ce
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../../http/tests/inspector/workspace-test.js"></script>
6 <script>
7 function test()
9 var contentScriptsNavigatorView = new WebInspector.ContentScriptsNavigatorView();
10 contentScriptsNavigatorView.setWorkspace(WebInspector.workspace);
11 contentScriptsNavigatorView.show(WebInspector.inspectorView.element);
13 var mockExecutionContext = {
14 id: 1234567,
15 type: "Extenstion",
16 origin: "chrome-extension://113581321345589144",
17 name: "FibExtension"
19 var mockContentScriptURL = mockExecutionContext.origin + "/script.js";
21 InspectorTest.runTestSuite([
22 function testAddFileBeforeExecutionContext(next)
24 var contentProvider = new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Script, "");
25 WebInspector.NetworkProject.forTarget(InspectorTest.mainTarget).addFileForURL(mockContentScriptURL, contentProvider, true);
26 InspectorTest.dumpNavigatorView(contentScriptsNavigatorView, "contentScripts", " ");
27 InspectorTest.runtimeModel._executionContextCreated(mockExecutionContext);
28 InspectorTest.dumpNavigatorView(contentScriptsNavigatorView, "contentScripts", " ");
29 // cleanup after test
30 WebInspector.NetworkProject.forTarget(InspectorTest.mainTarget)._reset();
31 InspectorTest.runtimeModel._executionContextsCleared();
32 next();
35 function testAddExecutionContextBeforeFile(next)
37 InspectorTest.runtimeModel._executionContextCreated(mockExecutionContext);
38 var contentProvider = new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Script, "");
39 WebInspector.NetworkProject.forTarget(InspectorTest.mainTarget).addFileForURL(mockContentScriptURL, contentProvider, true);
40 InspectorTest.dumpNavigatorView(contentScriptsNavigatorView, "contentScripts", " ");
41 next();
43 ]);
46 </script>
47 </head>
48 <body onload="runTest()">
49 <p>The test verifies that extension names are resolved properly in navigator view.</p>
50 </body>
51 </html>