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 } |
11 | 11 |
12 var initialize_ExtensionsTest = function() | 12 var initialize_ExtensionsTest = function() |
13 { | 13 { |
| 14 WebInspector.extensionServer._registerHandler("evaluateForTestInFrontEnd", onEva
luate); |
14 | 15 |
15 WebInspector.extensionServer._overridePlatformExtensionAPIForTest = function(ext
ensionInfo, inspectedTabId, themeName) | 16 WebInspector.extensionServer._extensionAPITestHook = function(extensionServerCli
ent, coreAPI) |
16 { | 17 { |
17 WebInspector.extensionServer._registerHandler("evaluateForTestInFrontEnd", o
nEvaluate); | 18 window.webInspector = coreAPI; |
18 | 19 window._extensionServerForTests = extensionServerClient; |
19 function platformExtensionAPI(coreAPI) | 20 coreAPI.panels.themeName = "themeNameForTest"; |
20 { | |
21 window.webInspector = coreAPI; | |
22 window._extensionServerForTests = extensionServer; | |
23 coreAPI.panels.themeName = "themeNameForTest"; | |
24 } | |
25 return platformExtensionAPI.toString(); | |
26 } | 21 } |
27 | 22 |
28 InspectorTest._replyToExtension = function(requestId, port) | 23 InspectorTest._replyToExtension = function(requestId, port) |
29 { | 24 { |
30 WebInspector.extensionServer._dispatchCallback(requestId, port); | 25 WebInspector.extensionServer._dispatchCallback(requestId, port); |
31 } | 26 } |
32 | 27 |
33 function onEvaluate(message, port) | 28 function onEvaluate(message, port) |
34 { | 29 { |
35 function reply(param) | 30 function reply(param) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 66 |
72 function extension_showPanel(panelId, callback) | 67 function extension_showPanel(panelId, callback) |
73 { | 68 { |
74 evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) +
"')).then(function() { reply(); });", callback); | 69 evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) +
"')).then(function() { reply(); });", callback); |
75 } | 70 } |
76 | 71 |
77 var test = function() | 72 var test = function() |
78 { | 73 { |
79 InspectorTest.runExtensionTests(); | 74 InspectorTest.runExtensionTests(); |
80 } | 75 } |
OLD | NEW |