Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/resources/resources-panel-on-navigation.html

Issue 2801723003: [DevTools] Do not reset storage tree items (Closed)
Patch Set: [DevTools] Do not reset storage tree items Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/resources/resources-panel-on-navigation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..76629b21da2e7728103409797489f4fb04bee0e8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/resources/resources-panel-on-navigation.html
@@ -0,0 +1,89 @@
+<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> // window.debugTest=true;
dgozman 2017/04/11 17:27:29 remove debugTest
eostroukhov 2017/04/11 21:45:57 Done.
+
+function test()
+{
+ var mainFrameId = InspectorTest.resourceTreeModel.mainFrame.id;
+
+ function dump(node, prefix)
+ {
+ for (var child of node.children()) {
+ InspectorTest.addResult(prefix + child.listItemElement.textContent);
+ dump(child, prefix + ' ');
+ }
+ }
+
+ function createDatabase() {
+ return new Promise(resolve => InspectorTest.createDatabase(mainFrameId, 'Database1', resolve));
+ }
+
+ function waitABit() {
dgozman 2017/04/11 17:27:28 Why this?
eostroukhov 2017/04/11 21:45:57 Removed
+ return new Promise(resolve => setTimeout(resolve, 500));
+ }
+
+ function waitForDatabase() {
+ var model = InspectorTest.mainTarget.model(Resources.IndexedDBModel);
+ return new Promise(resolve => {
+ var event = model.addEventListener(Resources.IndexedDBModel.Events.DatabaseAdded, () => {
+ Common.EventTarget.removeEventListeners([event]);
+ resolve();
+ });
+ model.refreshDatabaseNames();
+ })
+ }
+
+ function createWebSQLDatabase() {
dgozman 2017/04/11 17:27:29 Let's move a helper in resources-test.js.
eostroukhov 2017/04/11 21:45:57 Done.
+ return new Promise(resolve => {
+ var callbackl_id = 'createWebSQLDatabase_callback';
+ InspectorTest.evaluateInPage('openDatabase("test-resource-view-websql-db", "1.0", "", 1024 * 1024, dispatchCallback.bind(this, "' + callbackl_id + '"))');
+ InspectorTest.addConsoleSniffer(msg => {
dgozman 2017/04/11 17:27:28 Instead of sniffing for console, take a look into
eostroukhov 2017/04/11 21:45:57 Done.
+ if (msg.messageText === callbackl_id)
+ resolve();
+ }, false);
+ });
+ }
+
+ function fireFrameNavigated() {
+ var rtm = InspectorTest.mainTarget.model(SDK.ResourceTreeModel);
dgozman 2017/04/11 17:27:28 InspectorTest.resourceTreeModel
eostroukhov 2017/04/11 21:45:57 Done.
+ rtm.dispatchEventToListeners(SDK.ResourceTreeModel.Events.FrameNavigated, rtm.mainFrame);
dgozman 2017/04/11 17:27:28 Faking an event is usually a bad practice. Instead
eostroukhov 2017/04/11 21:45:57 Done.
+ }
+
+ 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));
+ }
+
+ async function doTests() {
dgozman 2017/04/11 17:27:29 You can inline this function into test() directly.
eostroukhov 2017/04/11 21:45:57 Done.
+ try{
+ await createDatabase();
+ await waitForDatabase();
+ await createWebSQLDatabase();
+
+ UI.viewManager.showView('resources');
+ UI.panels.resources._sidebar.databasesListTreeElement.firstChild().select(false, true);
+ dumpCurrentState('Initial state:');
+ fireFrameNavigated();
+ dumpCurrentState('After navigation:');
+ } catch (e) {
dgozman 2017/04/11 17:27:28 inspector-test does this for you.
eostroukhov 2017/04/11 21:45:57 Done. (on a separate note - I don't see inspector
+ console.error(e);
+ }
+ }
+
+ doTests().then(() => InspectorTest.completeTest(), reason => {
+ console.log(reason);
+ InspectorTest.completeTest();
+ });
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests Application Panel behavious on main frame navigation.</p>
dgozman 2017/04/11 17:27:29 typo: behaviour
eostroukhov 2017/04/11 21:45:57 Done.
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/resources/resources-panel-on-navigation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698