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

Side by Side Diff: LayoutTests/inspector/storage-panel-dom-storage-update.html

Issue 22346003: DevTools: DOMStorage should notify the view about storage modifications instead of DOMStorageModel (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments addressed! Created 7 years, 4 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 | Source/devtools/front_end/DOMStorage.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script> 3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script> 4 <script>
5 5
6 function addItem(key, value) 6 function addItem(key, value)
7 { 7 {
8 localStorage.setItem(key, value); 8 localStorage.setItem(key, value);
9 } 9 }
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 function addItem() 86 function addItem()
87 { 87 {
88 var index = indicesToAdd.shift(); 88 var index = indicesToAdd.shift();
89 if (!index) { 89 if (!index) {
90 next(); 90 next();
91 return; 91 return;
92 } 92 }
93 InspectorTest.addResult(""); 93 InspectorTest.addResult("");
94 InspectorTest.addSniffer(view.domStorageModel, "_domStorageItemA dded", itemAdded); 94 InspectorTest.addSniffer(WebInspector.domStorageModel, "_domStor ageItemAdded", itemAdded);
95 var command = "addItem('key" + index + "', 'value" + index + "') ;"; 95 var command = "addItem('key" + index + "', 'value" + index + "') ;";
96 InspectorTest.addResult(command); 96 InspectorTest.addResult(command);
97 InspectorTest.evaluateInPage(command); 97 InspectorTest.evaluateInPage(command);
98 } 98 }
99 99
100 addItem(); 100 addItem();
101 }, 101 },
102 102
103 function removeItemTest(next) 103 function removeItemTest(next)
104 { 104 {
105 var indicesToRemove = [1, 3, 5]; 105 var indicesToRemove = [1, 3, 5];
106 106
107 function itemRemoved() 107 function itemRemoved()
108 { 108 {
109 dumpDataGrid(view._dataGrid.rootNode()); 109 dumpDataGrid(view._dataGrid.rootNode());
110 removeItem(); 110 removeItem();
111 } 111 }
112 112
113 function removeItem() 113 function removeItem()
114 { 114 {
115 var index = indicesToRemove.shift(); 115 var index = indicesToRemove.shift();
116 if (!index) { 116 if (!index) {
117 next(); 117 next();
118 return; 118 return;
119 } 119 }
120 InspectorTest.addResult(""); 120 InspectorTest.addResult("");
121 InspectorTest.addSniffer(view.domStorageModel, "_domStorageItemR emoved", itemRemoved); 121 InspectorTest.addSniffer(WebInspector.domStorageModel, "_domStor ageItemRemoved", itemRemoved);
122 var command = "removeItem('key" + index + "');"; 122 var command = "removeItem('key" + index + "');";
123 InspectorTest.addResult(command); 123 InspectorTest.addResult(command);
124 InspectorTest.evaluateInPage(command); 124 InspectorTest.evaluateInPage(command);
125 } 125 }
126 126
127 removeItem(); 127 removeItem();
128 }, 128 },
129 129
130 function updateItemTest(next) 130 function updateItemTest(next)
131 { 131 {
132 InspectorTest.addResult(""); 132 InspectorTest.addResult("");
133 InspectorTest.addSniffer(view.domStorageModel, "_domStorageItemUpdat ed", itemUpdated); 133 InspectorTest.addSniffer(WebInspector.domStorageModel, "_domStorageI temUpdated", itemUpdated);
134 var command = "updateItem('key2', 'VALUE2');"; 134 var command = "updateItem('key2', 'VALUE2');";
135 InspectorTest.addResult(command); 135 InspectorTest.addResult(command);
136 InspectorTest.evaluateInPage(command); 136 InspectorTest.evaluateInPage(command);
137 137
138 function itemUpdated() 138 function itemUpdated()
139 { 139 {
140 dumpDataGrid(view._dataGrid.rootNode()); 140 dumpDataGrid(view._dataGrid.rootNode());
141 next(); 141 next();
142 } 142 }
143 }, 143 },
144 144
145 function clearTest(next) 145 function clearTest(next)
146 { 146 {
147 function itemsCleared() 147 function itemsCleared()
148 { 148 {
149 dumpDataGrid(view._dataGrid.rootNode()); 149 dumpDataGrid(view._dataGrid.rootNode());
150 next(); 150 next();
151 } 151 }
152 152
153 InspectorTest.addResult(""); 153 InspectorTest.addResult("");
154 InspectorTest.addSniffer(view.domStorageModel, "_domStorageItemsClea red", itemsCleared); 154 InspectorTest.addSniffer(WebInspector.domStorageModel, "_domStorageI temsCleared", itemsCleared);
155 var command = "clear()"; 155 var command = "clear()";
156 InspectorTest.addResult(command); 156 InspectorTest.addResult(command);
157 InspectorTest.evaluateInPage(command); 157 InspectorTest.evaluateInPage(command);
158 } 158 }
159 ]); 159 ]);
160 } 160 }
161 </script> 161 </script>
162 </head> 162 </head>
163 163
164 <body onload="runTest()"> 164 <body onload="runTest()">
165 <p>Test that storage panel is present and that it contains correct data whenever localStorage is updated.</p> 165 <p>Test that storage panel is present and that it contains correct data whenever localStorage is updated.</p>
166 </body> 166 </body>
167 </html> 167 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/DOMStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698