Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/extensions/extensions-sidebar.html

Issue 2157713002: DevTools: introduce View: a named widget with the toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/extensions-test.js"></script> 4 <script src="../../http/tests/inspector/extensions-test.js"></script>
5 <script type="text/javascript"> 5 <script type="text/javascript">
6 6
7 function initialize_extensionsSidebarTest() 7 function initialize_extensionsSidebarTest()
8 { 8 {
9 InspectorTest.dumpSidebarContent = function(panelName, callback) 9 InspectorTest.dumpSidebarContent = function(panelName, callback)
10 { 10 {
11 var sidebar = InspectorTest._extensionSidebar(panelName); 11 var sidebar = InspectorTest._extensionSidebar(panelName);
12 InspectorTest.deprecatedRunAfterPendingDispatches(function() { 12 InspectorTest.deprecatedRunAfterPendingDispatches(function() {
13 InspectorTest.addResult(panelName + " sidebar content: " + Inspector Test.textContentWithoutStyles(sidebar.element)); 13 InspectorTest.addResult(panelName + " sidebar content: " + Inspector Test.textContentWithoutStyles(sidebar.element));
14 callback(); 14 callback();
15 }); 15 });
16 } 16 }
17 17
18 InspectorTest.expandSidebar = function(panelName, callback) 18 InspectorTest.expandSidebar = function(panelName, callback)
19 { 19 {
20 var sidebar = InspectorTest._extensionSidebar(panelName); 20 var sidebar = InspectorTest._extensionSidebar(panelName);
21 InspectorTest.deprecatedRunAfterPendingDispatches(function() { 21 InspectorTest.deprecatedRunAfterPendingDispatches(function() {
22 sidebar.expandPane(); 22 sidebar.requestReveal();
23 callback(); 23 callback();
24 }); 24 });
25 } 25 }
26 26
27 InspectorTest._extensionSidebar = function(panelName) 27 InspectorTest._extensionSidebar = function(panelName)
28 { 28 {
29 var sidebarPanes = WebInspector.extensionServer.sidebarPanes(); 29 var sidebarPanes = WebInspector.extensionServer.sidebarPanes();
30 var result; 30 var result;
31 for (var i = 0; i < sidebarPanes.length; ++i) { 31 for (var i = 0; i < sidebarPanes.length; ++i) {
32 if (sidebarPanes[i].panelName() === panelName) 32 if (sidebarPanes[i].panelName() === panelName)
33 result = sidebarPanes[i]; 33 result = sidebarPanes[i];
34 } 34 }
35 return result; 35 return result;
36 } 36 }
37 } 37 }
38 38
39 function extension_sidebarSetPage(panelName, nextTest) 39 function extension_sidebarSetPage(panelName, nextTest)
40 { 40 {
41 function onSidebarCreated(sidebar) 41 function onSidebarCreated(sidebar)
42 { 42 {
43 output("Sidebar created"); 43 output("Sidebar created");
44 dumpObject(sidebar); 44 dumpObject(sidebar);
45 function onShown(win) 45 function onShown(win)
46 { 46 {
47 output("sidebar height " + win.document.documentElement.getBoundingC lientRect().height); 47 if (panelName !== "elements")
48 output("sidebar height " + win.document.documentElement.getBound ingClientRect().height);
48 sidebar.onShown.removeListener(onShown); 49 sidebar.onShown.removeListener(onShown);
49 nextTest(); 50 nextTest();
50 } 51 }
51 sidebar.onShown.addListener(onShown); 52 sidebar.onShown.addListener(onShown);
52 var basePath = location.pathname.replace(/\/[^/]*$/, "/"); 53 var basePath = location.pathname.replace(/\/[^/]*$/, "/");
53 sidebar.setPage(basePath + "extension-sidebar.html"); 54 sidebar.setPage(basePath + "extension-sidebar.html");
54 extension_showPanel(panelName, extension_expandSidebar.bind(null, panelN ame)); 55 extension_showPanel(panelName, extension_expandSidebar.bind(null, panelN ame));
55 } 56 }
56 output("Call createSidebarPane for " + panelName); 57 output("Call createSidebarPane for " + panelName);
57 webInspector.panels[panelName].createSidebarPane("Test Sidebar", onSidebarCr eated); 58 webInspector.panels[panelName].createSidebarPane("Test Sidebar", onSidebarCr eated);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 230 }
230 webInspector.panels[panelName].createSidebarPane("Sidebar Test: replace pag e with object", onSidebarCreated); 231 webInspector.panels[panelName].createSidebarPane("Sidebar Test: replace pag e with object", onSidebarCreated);
231 } 232 }
232 233
233 </script> 234 </script>
234 </head> 235 </head>
235 <body onload="runTest()"> 236 <body onload="runTest()">
236 <p>Tests sidebars in WebInspector extensions API</p> 237 <p>Tests sidebars in WebInspector extensions API</p>
237 </body> 238 </body>
238 </html> 239 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698