| Index: third_party/WebKit/LayoutTests/http/tests/inspector/resources/resources-panel-on-navigation.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/resources/resources-panel-on-navigation.html b/third_party/WebKit/LayoutTests/http/tests/inspector/resources/resources-panel-on-navigation.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..01bcd6af71a27dbe25e4c94a6cacb4de0f295095
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resources/resources-panel-on-navigation.html
|
| @@ -0,0 +1,58 @@
|
| +<html>
|
| +<head>
|
| +<script src="../inspector-test.js"></script>
|
| +<script src="../resources-test.js"></script>
|
| +<script src="../console-test.js"></script>
|
| +<script src="../indexeddb/indexeddb-test.js"></script>
|
| +<script>
|
| +
|
| +async function test()
|
| +{
|
| +
|
| + function createIndexedDB(callback) {
|
| + var mainFrameId = InspectorTest.resourceTreeModel.mainFrame.id;
|
| + var model = InspectorTest.mainTarget.model(Resources.IndexedDBModel);
|
| + InspectorTest.createDatabase(mainFrameId, 'Database1', () => {
|
| + var event = model.addEventListener(Resources.IndexedDBModel.Events.DatabaseAdded, () => {
|
| + Common.EventTarget.removeEventListeners([event]);
|
| + callback();
|
| + });
|
| + model.refreshDatabaseNames();
|
| + });
|
| + }
|
| +
|
| + function dump(node, prefix)
|
| + {
|
| + for (var child of node.children()) {
|
| + InspectorTest.addResult(prefix + child.listItemElement.textContent);
|
| + dump(child, prefix + ' ');
|
| + }
|
| + }
|
| +
|
| + function dumpCurrentState(label) {
|
| + var view = UI.panels.resources;
|
| + InspectorTest.addResult(label);
|
| + dump(view._sidebar._sidebarTree.rootElement(), '');
|
| + InspectorTest.addResult('Visible view is a query view: ' + (view.visibleView instanceof Resources.DatabaseQueryView));
|
| + }
|
| +
|
| + function fireFrameNavigated() {
|
| + var rtm = InspectorTest.resourceTreeModel;
|
| + rtm.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, rtm.mainFrame);
|
| + }
|
| +
|
| + await new Promise(createIndexedDB);
|
| + await InspectorTest.createWebSQLDatabase('database-for-test');
|
| + UI.viewManager.showView('resources');
|
| + UI.panels.resources._sidebar.databasesListTreeElement.firstChild().select(false, true);
|
| + dumpCurrentState('Initial state:');
|
| + await InspectorTest.navigatePromise('http://127.0.0.1:8000/inspector/resources/resources-panel-on-navigation.html');
|
| + dumpCurrentState('After navigation:');
|
| + InspectorTest.completeTest();
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onload="runTest()">
|
| +<p>Tests Application Panel response to a main frame navigation.</p>
|
| +</body>
|
| +</html>
|
|
|