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

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

Issue 2374573002: DevTools: remove extra indirections from how extension API is built (Closed)
Patch Set: pass null instead of -1 when tab is not defined Created 4 years, 2 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/Source/devtools/front_end/extensions/ExtensionAPI.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 }
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
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 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698