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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/extensions-test.js

Issue 2899163002: DevTools: Promisify Runtime domain (Closed)
Patch Set: addressing comments Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 function extensionFunctions() 1 function extensionFunctions()
2 { 2 {
3 var functions = ""; 3 var functions = "";
4 4
5 for (symbol in window) { 5 for (symbol in window) {
6 if (/^extension_/.exec(symbol) && typeof window[symbol] === "function") 6 if (/^extension_/.exec(symbol) && typeof window[symbol] === "function")
7 functions += window[symbol].toString(); 7 functions += window[symbol].toString();
8 } 8 }
9 return functions; 9 return functions;
10 } 10 }
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 } 41 }
42 42
43 InspectorTest.showPanel = function(panelId) 43 InspectorTest.showPanel = function(panelId)
44 { 44 {
45 if (panelId === "extension") 45 if (panelId === "extension")
46 panelId = UI.inspectorView._tabbedPane._tabs[UI.inspectorView._tabbedPan e._tabs.length - 1].id; 46 panelId = UI.inspectorView._tabbedPane._tabs[UI.inspectorView._tabbedPan e._tabs.length - 1].id;
47 return UI.inspectorView.showPanel(panelId); 47 return UI.inspectorView.showPanel(panelId);
48 } 48 }
49 49
50 InspectorTest.runExtensionTests = function() 50 InspectorTest.runExtensionTests = async function()
51 { 51 {
52 InspectorTest.RuntimeAgent.evaluate("location.href", "console", false, funct ion(error, result) { 52 var result = await InspectorTest.RuntimeAgent.evaluate("location.href", "con sole", false);
53 if (error) 53 if (!result)
54 return; 54 return;
55 var pageURL = result.value; 55 var pageURL = result.value;
56 var extensionURL = (/^https?:/.test(pageURL) ? 56 var extensionURL = (/^https?:/.test(pageURL) ?
57 pageURL.replace(/^(https?:\/\/[^/]*\/).*$/,"$1") : 57 pageURL.replace(/^(https?:\/\/[^/]*\/).*$/,"$1") :
58 pageURL.replace(/\/inspector\/extensions\/[^/]*$/, "/http/tests")) + 58 pageURL.replace(/\/inspector\/extensions\/[^/]*$/, "/http/tests")) +
59 "/inspector/resources/extension-main.html"; 59 "/inspector/resources/extension-main.html";
60 InspectorFrontendAPI.addExtensions([{ startPage: extensionURL, name: "te st extension", exposeWebInspectorNamespace: true }]); 60 InspectorFrontendAPI.addExtensions([{ startPage: extensionURL, name: "test e xtension", exposeWebInspectorNamespace: true }]);
61 Extensions.extensionServer.initializeExtensions(); 61 Extensions.extensionServer.initializeExtensions();
62 });
63 } 62 }
64 63
65 } 64 }
66 65
67 function extension_showPanel(panelId, callback) 66 function extension_showPanel(panelId, callback)
68 { 67 {
69 evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) + "')).then(function() { reply(); });", callback); 68 evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) + "')).then(function() { reply(); });", callback);
70 } 69 }
71 70
72 var test = function() 71 var test = function()
73 { 72 {
74 Common.moduleSetting("shortcutPanelSwitch").set(true); 73 Common.moduleSetting("shortcutPanelSwitch").set(true);
75 InspectorTest.runExtensionTests(); 74 InspectorTest.runExtensionTests();
76 } 75 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698