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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../resources-test.js"></script>
5 <script src="../console-test.js"></script>
6 <script src="../indexeddb/indexeddb-test.js"></script>
7 <script> // window.debugTest=true;
dgozman 2017/04/11 17:27:29 remove debugTest
eostroukhov 2017/04/11 21:45:57 Done.
8
9 function test()
10 {
11 var mainFrameId = InspectorTest.resourceTreeModel.mainFrame.id;
12
13 function dump(node, prefix)
14 {
15 for (var child of node.children()) {
16 InspectorTest.addResult(prefix + child.listItemElement.textContent);
17 dump(child, prefix + ' ');
18 }
19 }
20
21 function createDatabase() {
22 return new Promise(resolve => InspectorTest.createDatabase(mainFrameId, 'Database1', resolve));
23 }
24
25 function waitABit() {
dgozman 2017/04/11 17:27:28 Why this?
eostroukhov 2017/04/11 21:45:57 Removed
26 return new Promise(resolve => setTimeout(resolve, 500));
27 }
28
29 function waitForDatabase() {
30 var model = InspectorTest.mainTarget.model(Resources.IndexedDBModel);
31 return new Promise(resolve => {
32 var event = model.addEventListener(Resources.IndexedDBModel.Events.D atabaseAdded, () => {
33 Common.EventTarget.removeEventListeners([event]);
34 resolve();
35 });
36 model.refreshDatabaseNames();
37 })
38 }
39
40 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.
41 return new Promise(resolve => {
42 var callbackl_id = 'createWebSQLDatabase_callback';
43 InspectorTest.evaluateInPage('openDatabase("test-resource-view-websq l-db", "1.0", "", 1024 * 1024, dispatchCallback.bind(this, "' + callbackl_id + ' "))');
44 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.
45 if (msg.messageText === callbackl_id)
46 resolve();
47 }, false);
48 });
49 }
50
51 function fireFrameNavigated() {
52 var rtm = InspectorTest.mainTarget.model(SDK.ResourceTreeModel);
dgozman 2017/04/11 17:27:28 InspectorTest.resourceTreeModel
eostroukhov 2017/04/11 21:45:57 Done.
53 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.
54 }
55
56 function dumpCurrentState(label) {
57 var view = UI.panels.resources;
58 InspectorTest.addResult(label);
59 dump(view._sidebar._sidebarTree.rootElement(), '');
60 InspectorTest.addResult('Visible view is a query view: ' + (view.visible View instanceof Resources.DatabaseQueryView));
61 }
62
63 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.
64 try{
65 await createDatabase();
66 await waitForDatabase();
67 await createWebSQLDatabase();
68
69 UI.viewManager.showView('resources');
70 UI.panels.resources._sidebar.databasesListTreeElement.firstChild().s elect(false, true);
71 dumpCurrentState('Initial state:');
72 fireFrameNavigated();
73 dumpCurrentState('After navigation:');
74 } 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
75 console.error(e);
76 }
77 }
78
79 doTests().then(() => InspectorTest.completeTest(), reason => {
80 console.log(reason);
81 InspectorTest.completeTest();
82 });
83 }
84 </script>
85 </head>
86 <body onload="runTest()">
87 <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.
88 </body>
89 </html>
OLDNEW
« 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