OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('md_history.history_list_test', function() { | 5 cr.define('md_history.history_list_test', function() { |
6 function registerTests() { | 6 function registerTests() { |
7 suite('history-list', function() { | 7 suite('history-list', function() { |
8 var app; | 8 var app; |
9 var element; | 9 var element; |
10 var toolbar; | 10 var toolbar; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 | 241 |
242 MockInteractions.tap(app.$.toolbar.$$('#delete-button')); | 242 MockInteractions.tap(app.$.toolbar.$$('#delete-button')); |
243 | 243 |
244 // Confirmation dialog should appear. | 244 // Confirmation dialog should appear. |
245 assertTrue(listContainer.$.dialog.opened); | 245 assertTrue(listContainer.$.dialog.opened); |
246 | 246 |
247 MockInteractions.tap(listContainer.$$('.action-button')); | 247 MockInteractions.tap(listContainer.$$('.action-button')); |
248 }); | 248 }); |
249 }); | 249 }); |
250 | 250 |
251 test('delete dialog closed on url change', function() { | |
252 app.queryState_.queryingDisabled = false; | |
253 var listContainer = app.$.history; | |
254 app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS); | |
255 app.historyResult(createHistoryInfo(), ADDITIONAL_RESULTS); | |
256 return flush().then(function() { | |
257 items = Polymer.dom(element.root).querySelectorAll('history-item'); | |
258 | |
259 MockInteractions.tap(items[2].$.checkbox); | |
260 MockInteractions.tap(app.$.toolbar.$$('#delete-button')); | |
261 | |
262 // Confirmation dialog should appear. | |
263 assertTrue(listContainer.$.dialog.opened); | |
264 | |
265 app.set('queryState_.searchTerm', 'something else'); | |
266 assertFalse(listContainer.$.dialog.opened); | |
267 }); | |
268 }); | |
269 | |
251 teardown(function() { | 270 teardown(function() { |
252 element.historyData_ = []; | 271 element.historyData_ = []; |
253 registerMessageCallback('removeVisits', this, undefined); | 272 registerMessageCallback('removeVisits', this, undefined); |
254 registerMessageCallback('queryHistory', this, undefined); | 273 registerMessageCallback('queryHistory', this, function() {}); |
tsergeant
2016/07/28 07:20:45
Why is this necessary? Should we be doing this eve
calamity
2016/08/01 02:46:11
The added test fails with cannot read property 'ap
| |
255 app.queryState_.queryingDisabled = true; | 274 app.queryState_.queryingDisabled = true; |
256 app.set('queryState_.searchTerm', ''); | 275 app.set('queryState_.searchTerm', ''); |
257 return flush(); | 276 return flush(); |
258 }); | 277 }); |
259 }); | 278 }); |
260 } | 279 } |
261 return { | 280 return { |
262 registerTests: registerTests | 281 registerTests: registerTests |
263 }; | 282 }; |
264 }); | 283 }); |
OLD | NEW |