Commit 879ed357 authored by apavlov@chromium.org's avatar apavlov@chromium.org

DevTools: Allow dynamic module registration only in tests

Runtime.prototype.registerModule() should not be available publicly,
as changes in the configuration require the devtools restart.

R=eustas, pfeldman, vsevik

Review URL: https://codereview.chromium.org/460323002

git-svn-id: svn://svn.chromium.org/blink/trunk@180063 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 76ee45e1
...@@ -240,6 +240,13 @@ InspectorTest.assertGreaterOrEqual = function(a, b, message) ...@@ -240,6 +240,13 @@ InspectorTest.assertGreaterOrEqual = function(a, b, message)
InspectorTest.addResult("FAILED: " + (message ? message + ": " : "") + a + " < " + b); InspectorTest.addResult("FAILED: " + (message ? message + ": " : "") + a + " < " + b);
} }
InspectorTest.registerModule = function(moduleName, loadImmediately)
{
runtime._registerModule(moduleName);
if (loadImmediately)
runtime.loadModule(moduleName);
}
InspectorTest.navigate = function(url, callback) InspectorTest.navigate = function(url, callback)
{ {
InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback); InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(callback);
......
function initialize_LayerTreeTests() function initialize_LayerTreeTests()
{ {
// FIXME: remove once out of experimental. // FIXME: remove once out of experimental.
runtime.registerModule("layers"); InspectorTest.registerModule("layers");
var extensions = runtime.extensions(WebInspector.Panel).forEach(function(extension) { var extensions = runtime.extensions(WebInspector.Panel).forEach(function(extension) {
if (extension.module().name() === "layers") if (extension.module().name() === "layers")
WebInspector.inspectorView.addPanel(new WebInspector.RuntimeExtensionPanelDescriptor(extension)); WebInspector.inspectorView.addPanel(new WebInspector.RuntimeExtensionPanelDescriptor(extension));
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
function test() function test()
{ {
runtime.registerModule("documentation"); InspectorTest.registerModule("documentation", true);
runtime.loadModule("documentation");
var testCases = [ var testCases = [
"{{A|B={{C|D=blablabla}}}}", "{{A|B={{C|D=blablabla}}}}",
"{{CS|Init=black|Values={{CSS Property Value\n|Data Type=color\n|Description=[[css/color|CSS color value]]}}\n}}", "{{CS|Init=black|Values={{CSS Property Value\n|Data Type=color\n|Description=[[css/color|CSS color value]]}}\n}}",
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
function test() function test()
{ {
runtime.registerModule("documentation"); InspectorTest.registerModule("documentation", true);
runtime.loadModule("documentation");
var testCases = [ var testCases = [
"max", "max",
"insertBefore", "insertBefore",
......
...@@ -132,13 +132,13 @@ Runtime.prototype = { ...@@ -132,13 +132,13 @@ Runtime.prototype = {
registerModules: function(configuration) registerModules: function(configuration)
{ {
for (var i = 0; i < configuration.length; ++i) for (var i = 0; i < configuration.length; ++i)
this.registerModule(configuration[i]); this._registerModule(configuration[i]);
}, },
/** /**
* @param {string} moduleName * @param {string} moduleName
*/ */
registerModule: function(moduleName) _registerModule: function(moduleName)
{ {
if (!this._descriptorsMap[moduleName]) { if (!this._descriptorsMap[moduleName]) {
var content = loadResource(moduleName + "/module.json"); var content = loadResource(moduleName + "/module.json");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment