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)
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._pageLoadedCallback = InspectorTest.safeWrap(callback);
......
function initialize_LayerTreeTests()
{
// FIXME: remove once out of experimental.
runtime.registerModule("layers");
InspectorTest.registerModule("layers");
var extensions = runtime.extensions(WebInspector.Panel).forEach(function(extension) {
if (extension.module().name() === "layers")
WebInspector.inspectorView.addPanel(new WebInspector.RuntimeExtensionPanelDescriptor(extension));
......
......@@ -5,8 +5,7 @@
function test()
{
runtime.registerModule("documentation");
runtime.loadModule("documentation");
InspectorTest.registerModule("documentation", true);
var testCases = [
"{{A|B={{C|D=blablabla}}}}",
"{{CS|Init=black|Values={{CSS Property Value\n|Data Type=color\n|Description=[[css/color|CSS color value]]}}\n}}",
......
......@@ -5,8 +5,7 @@
function test()
{
runtime.registerModule("documentation");
runtime.loadModule("documentation");
InspectorTest.registerModule("documentation", true);
var testCases = [
"max",
"insertBefore",
......
......@@ -132,13 +132,13 @@ Runtime.prototype = {
registerModules: function(configuration)
{
for (var i = 0; i < configuration.length; ++i)
this.registerModule(configuration[i]);
this._registerModule(configuration[i]);
},
/**
* @param {string} moduleName
*/
registerModule: function(moduleName)
_registerModule: function(moduleName)
{
if (!this._descriptorsMap[moduleName]) {
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