OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |