| 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 | 14 |
| 15 WebInspector.extensionServer._overridePlatformExtensionAPIForTest = function(ext
ensionInfo) | 15 WebInspector.extensionServer._overridePlatformExtensionAPIForTest = function(ext
ensionInfo, inspectedTabId) |
| 16 { | 16 { |
| 17 WebInspector.extensionServer._registerHandler("evaluateForTestInFrontEnd", o
nEvaluate); | 17 WebInspector.extensionServer._registerHandler("evaluateForTestInFrontEnd", o
nEvaluate); |
| 18 | 18 |
| 19 function platformExtensionAPI(coreAPI) | 19 function platformExtensionAPI(coreAPI) |
| 20 { | 20 { |
| 21 window.webInspector = coreAPI; | 21 window.webInspector = coreAPI; |
| 22 window._extensionServerForTests = extensionServer; | 22 window._extensionServerForTests = extensionServer; |
| 23 } | 23 } |
| 24 return platformExtensionAPI.toString(); | 24 return platformExtensionAPI.toString(); |
| 25 } | 25 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 InspectorTest.runExtensionTests = function() | 54 InspectorTest.runExtensionTests = function() |
| 55 { | 55 { |
| 56 RuntimeAgent.evaluate("location.href", "console", false, function(error, res
ult) { | 56 RuntimeAgent.evaluate("location.href", "console", false, function(error, res
ult) { |
| 57 if (error) | 57 if (error) |
| 58 return; | 58 return; |
| 59 var pageURL = result.value; | 59 var pageURL = result.value; |
| 60 var extensionURL = (/^https?:/.test(pageURL) ? | 60 var extensionURL = (/^https?:/.test(pageURL) ? |
| 61 pageURL.replace(/^(https?:\/\/[^/]*\/).*$/,"$1") : | 61 pageURL.replace(/^(https?:\/\/[^/]*\/).*$/,"$1") : |
| 62 pageURL.replace(/\/inspector\/extensions\/[^/]*$/, "/http/tests")) + | 62 pageURL.replace(/\/inspector\/extensions\/[^/]*$/, "/http/tests")) + |
| 63 "/inspector/resources/extension-main.html"; | 63 "/inspector/resources/extension-main.html"; |
| 64 WebInspector.addExtensions([{ startPage: extensionURL, name: "test exten
sion", exposeWebInspectorNamespace: true }]); | 64 InspectorFrontendAPI.addExtensions([{ startPage: extensionURL, name: "te
st extension", exposeWebInspectorNamespace: true }]); |
| 65 WebInspector.extensionServer.initializeExtensions(); | 65 WebInspector.extensionServer.initializeExtensions(); |
| 66 }); | 66 }); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } | 69 } |
| 70 | 70 |
| 71 function extension_showPanel(panelId, callback) | 71 function extension_showPanel(panelId, callback) |
| 72 { | 72 { |
| 73 evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) +
"')).then(function() { reply(); });", callback); | 73 evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) +
"')).then(function() { reply(); });", callback); |
| 74 } | 74 } |
| 75 | 75 |
| 76 var test = function() | 76 var test = function() |
| 77 { | 77 { |
| 78 InspectorTest.runExtensionTests(); | 78 InspectorTest.runExtensionTests(); |
| 79 } | 79 } |
| OLD | NEW |