Commit 4e969585 authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

DevTools: split initial-modules-load test into per-panel tests

Chaining them all in one test does not make sense, as a module added
by one panel will show up in all dumps done after that.

Change-Id: If329f91bdf78d61338de7511e3669ede096b37e1
Reviewed-on: https://chromium-review.googlesource.com/565440
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485385}
parent b8029247
......@@ -16877,7 +16877,6 @@ crbug.com/591099 inspector/geolocation-emulation-tests.html [ Failure ]
crbug.com/591099 inspector/help/release-note-unit.html [ Crash Failure ]
crbug.com/591099 inspector/help/release-note.html [ Crash Failure ]
crbug.com/591099 inspector/import-open-inspector.html [ Failure ]
crbug.com/591099 inspector/initial-modules-load.html [ Failure ]
crbug.com/591099 inspector/input-event-warning.html [ Failure ]
crbug.com/591099 inspector/inspected-objects-not-overriden.html [ Failure ]
crbug.com/591099 inspector/inspector-backend-commands.html [ Failure ]
......@@ -16886,6 +16885,10 @@ crbug.com/591099 inspector/layers/layer-canvas-log.html [ Crash Failure ]
crbug.com/591099 inspector/layers/layer-replay-scale.html [ Crash Failure ]
crbug.com/591099 inspector/local-object-properties-section.html [ Failure ]
crbug.com/591099 inspector/local-object.html [ Failure ]
crbug.com/591099 inspector/modules-load-elements.html [ Failure ]
crbug.com/591099 inspector/modules-load-initial.html [ Failure ]
crbug.com/591099 inspector/modules-load-network.html [ Failure ]
crbug.com/591099 inspector/modules-load-source.html [ Failure ]
crbug.com/591099 inspector/network/network-cookies-pane.html [ Crash Failure ]
crbug.com/591099 inspector/network/network-domain-filter.html [ Failure ]
crbug.com/591099 inspector/network/network-filmstrip-overview-showing.html [ Failure ]
......@@ -2816,11 +2816,14 @@ Bug(none) inspector/file-system-mapping.html [ Timeout ]
Bug(none) inspector/file-system-project.html [ Failure ]
Bug(none) inspector/geolocation-emulation-tests.html [ Timeout ]
Bug(none) inspector/import-open-inspector.html [ Timeout ]
Bug(none) inspector/initial-modules-load.html [ Timeout ]
Bug(none) inspector/input-event-warning.html [ Timeout ]
Bug(none) inspector/inspected-objects-not-overriden.html [ Timeout ]
Bug(none) inspector/layers/layer-replay-scale.html [ Timeout ]
Bug(none) inspector/layers/layers-3d-view-hit-testing.html [ Timeout ]
Bug(none) inspector/modules-load-elements.html [ Timeout ]
Bug(none) inspector/modules-load-initial.html [ Timeout ]
Bug(none) inspector/modules-load-network.html [ Timeout ]
Bug(none) inspector/modules-load-source.html [ Timeout ]
Bug(none) inspector/network/network-cookies-pane.html [ Timeout ]
Bug(none) inspector/network/network-json-parser.html [ Timeout ]
Bug(none) inspector/profiler/cpu-profiler-save-load.html [ Timeout ]
......
......@@ -945,22 +945,27 @@ InspectorTest.TempFileMock.create = function(dirPath, name)
return Promise.resolve(tempFile);
}
InspectorTest.dumpLoadedModules = function(next)
InspectorTest.loadedModules = function()
{
return self.runtime._modules.filter(module => module._loadedForTest);
}
InspectorTest.dumpLoadedModules = function(relativeTo)
{
var previous = new Set(relativeTo || []);
function moduleSorter(left, right)
{
return String.naturalOrderComparator(left._descriptor.name, right._descriptor.name);
}
InspectorTest.addResult("Loaded modules:");
var modules = self.runtime._modules;
modules.sort(moduleSorter);
for (var i = 0; i < modules.length; ++i) {
if (modules[i]._loadedForTest)
InspectorTest.addResult(" " + modules[i]._descriptor.name);
var loadedModules = InspectorTest.loadedModules().sort(moduleSorter);
for (var module of loadedModules) {
if (previous.has(module))
continue;
InspectorTest.addResult(" " + module._descriptor.name);
}
if (next)
next();
return loadedModules;
}
InspectorTest.TimeoutMock = function()
......
This test validates initial set of loaded modules.
Running: testInitialLoad
Loaded modules:
bindings
common
components
console_model
dom_extension
emulation
extensions
help
host
main
mobile_throttling
network_log
persistence
platform
product_registry
protocol
sdk
services
text_utils
ui
workspace
Running: testCreateElementsPanel
Loaded modules:
bindings
color_picker
common
components
console_model
dom_extension
elements
emulation
event_listeners
extensions
help
host
inline_editor
main
mobile_throttling
network_log
object_ui
persistence
platform
product_registry
protocol
sdk
services
text_utils
ui
workspace
Running: testCreateNetworkPanel
Loaded modules:
animation
bindings
cm
color_picker
common
components
console_model
cookie_table
data_grid
diff
dom_extension
elements
emulation
event_listeners
extensions
formatter
help
host
inline_editor
main
mobile_throttling
network
network_log
network_priorities
object_ui
perf_ui
persistence
platform
product_registry
protocol
sdk
services
source_frame
text_editor
text_utils
ui
workspace
workspace_diff
Running: testShowSourcesPanel
Loaded modules:
animation
bindings
cm
color_picker
common
components
console_model
cookie_table
data_grid
diff
dom_extension
elements
emulation
event_listeners
extensions
formatter
help
host
inline_editor
main
mobile_throttling
network
network_log
network_priorities
object_ui
perf_ui
persistence
platform
product_registry
protocol
quick_open
sdk
services
snippets
source_frame
sources
text_editor
text_utils
ui
workspace
workspace_diff
Running: testOpenUISourceCode
Loaded modules:
animation
bindings
cm
color_picker
common
components
console_model
cookie_table
data_grid
diff
dom_extension
elements
emulation
event_listeners
extensions
formatter
help
host
inline_editor
main
mobile_throttling
network
network_log
network_priorities
object_ui
perf_ui
persistence
platform
product_registry
protocol
quick_open
sdk
services
snippets
source_frame
sources
text_editor
text_utils
ui
workspace
workspace_diff
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script>
function test()
{
InspectorTest.runTestSuite([
function testInitialLoad(next)
{
InspectorTest.dumpLoadedModules(next);
},
function testCreateElementsPanel(next)
{
UI.inspectorView.panel("elements").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, self.runtime.loadModulePromise("animation").then(next)));
},
function testCreateNetworkPanel(next)
{
UI.inspectorView.panel("network").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, next));
},
function testShowSourcesPanel(next)
{
UI.inspectorView.panel("sources").then(InspectorTest.dumpLoadedModules.bind(InspectorTest, next));
},
function testOpenUISourceCode(next)
{
var resource;
InspectorTest.resourceTreeModel.forAllResources(function(r) {
if (r.url.indexOf("inspector-test.js") !== -1) {
resource = r;
return true;
}
});
var uiLocation = Workspace.workspace.uiSourceCodeForURL(resource.url).uiLocation(2, 1);
Common.Revealer.reveal(uiLocation);
InspectorTest.dumpLoadedModules(next);
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>This test validates initial set of loaded modules.</p>
</body>
</html>
This test validates initial set of loaded modules for Elements panel.
Loaded modules:
color_picker
elements
event_listeners
inline_editor
object_ui
Now with animations pane
Loaded modules:
animation
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script>
async function test()
{
var initialModules = InspectorTest.loadedModules();
await UI.inspectorView.panel("elements");
var elementsModules = InspectorTest.dumpLoadedModules(initialModules);
InspectorTest.addResult("Now with animations pane");
await self.runtime.loadModulePromise("animation");
InspectorTest.dumpLoadedModules(elementsModules);
InspectorTest.completeTest();
}
</script>
</head>
<body onload="runTest()">
<p>This test validates initial set of loaded modules for Elements panel.</p>
</body>
</html>
This test validates initial set of loaded modules.
Loaded modules:
bindings
common
components
console_model
dom_extension
emulation
extensions
help
host
main
mobile_throttling
network_log
persistence
platform
product_registry
protocol
sdk
services
text_utils
ui
workspace
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script>
function test()
{
InspectorTest.dumpLoadedModules();
InspectorTest.completeTest();
}
</script>
</head>
<body onload="runTest()">
<p>This test validates initial set of loaded modules.</p>
</body>
</html>
This test validates set of loaded modules for Network panel.
Loaded modules:
cm
cookie_table
data_grid
diff
formatter
network
network_priorities
object_ui
perf_ui
source_frame
text_editor
workspace_diff
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script>
async function test()
{
var initialModules = InspectorTest.loadedModules();
await UI.inspectorView.panel("network");
InspectorTest.dumpLoadedModules(initialModules);
InspectorTest.completeTest();
}
</script>
</head>
<body onload="runTest()">
<p>This test validates set of loaded modules for Network panel.</p>
</body>
</html>
This test validates set of loaded modules for Sources panel.
Loaded modules:
cm
color_picker
diff
event_listeners
formatter
inline_editor
object_ui
quick_open
snippets
source_frame
sources
text_editor
workspace_diff
Now with source code opened
Loaded modules:
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script>
async function test()
{
var initialModules = InspectorTest.loadedModules();
await UI.inspectorView.panel("sources");
var sourcesModules = InspectorTest.dumpLoadedModules(initialModules);
var resource;
InspectorTest.resourceTreeModel.forAllResources(function(r) {
if (r.url.indexOf("inspector-test.js") !== -1) {
resource = r;
return true;
}
});
InspectorTest.addResult("Now with source code opened");
var uiLocation = Workspace.workspace.uiSourceCodeForURL(resource.url).uiLocation(2, 1);
Common.Revealer.reveal(uiLocation);
InspectorTest.dumpLoadedModules(sourcesModules);
InspectorTest.completeTest();
}
</script>
</head>
<body onload="runTest()">
<p>This test validates set of loaded modules for Sources panel.</p>
</body>
</html>
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