Chromium Code Reviews| Index: chrome/test/data/webui/md_history/history_list_test.js |
| diff --git a/chrome/test/data/webui/md_history/history_list_test.js b/chrome/test/data/webui/md_history/history_list_test.js |
| index 82f96314086fff1c004933310474523d307e66ce..867bd277f7525d17ce237f39b27da08ed586290e 100644 |
| --- a/chrome/test/data/webui/md_history/history_list_test.js |
| +++ b/chrome/test/data/webui/md_history/history_list_test.js |
| @@ -13,7 +13,7 @@ cr.define('md_history.history_list_test', function() { |
| suiteSetup(function() { |
| app = $('history-app'); |
| - element = app.$['history-list']; |
| + element = app.$['history'].$['history-list']; |
| toolbar = app.$['toolbar']; |
| TEST_HISTORY_RESULTS = [ |
| @@ -99,7 +99,6 @@ cr.define('md_history.history_list_test', function() { |
| app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS); |
| app.historyResult(createHistoryInfo(), ADDITIONAL_RESULTS); |
| return flush().then(function() { |
| - items = Polymer.dom(element.root).querySelectorAll('history-item'); |
| element.removeDeletedHistory_([ |
| element.historyData_[2], element.historyData_[5], |
| @@ -164,7 +163,7 @@ cr.define('md_history.history_list_test', function() { |
| }); |
| test('more from this site sends and sets correct data', function(done) { |
| - app.queryingDisabled_ = false; |
| + app.queryState_.queryingDisabled = false; |
| registerMessageCallback('queryHistory', this, function (info) { |
| assertEquals('example.com', info[0]); |
| flush().then(function() { |
| @@ -196,6 +195,37 @@ cr.define('md_history.history_list_test', function() { |
| }); |
| }); |
| + test('delete items end to end', function(done) { |
| + app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS); |
| + app.historyResult(createHistoryInfo(), ADDITIONAL_RESULTS); |
| + flush().then(function() { |
| + items = Polymer.dom(element.root).querySelectorAll('history-item'); |
| + |
| + MockInteractions.tap(items[2].$.checkbox); |
| + MockInteractions.tap(items[5].$.checkbox); |
| + MockInteractions.tap(items[7].$.checkbox); |
| + |
| + registerMessageCallback('removeVisits', this, function() { |
| + flush().then(function() { |
|
tsergeant
2016/06/23 06:35:26
Is this extra flush necessary? I wouldn't expect t
calamity
2016/06/24 05:39:47
This is here to cause get a new event loop before
|
| + deleteComplete(); |
| + }).then(function() { |
| + assertEquals(element.historyData_.length, 5); |
| + assertEquals(element.historyData_[0].dateRelativeDay, |
| + '2016-03-15'); |
| + assertEquals(element.historyData_[2].dateRelativeDay, |
| + '2016-03-13'); |
| + assertEquals(element.historyData_[4].dateRelativeDay, |
| + '2016-03-11'); |
| + done(); |
| + }); |
| + }) |
|
tsergeant
2016/06/23 06:35:25
Nit: ;
calamity
2016/06/24 05:39:47
Done.
|
| + |
| + MockInteractions.tap(app.$.toolbar.$$('#delete-button')); |
| + |
| + return flush(); |
|
tsergeant
2016/06/23 06:35:26
Wouldn't be surprised if you could get rid of this
calamity
2016/06/24 05:39:47
Done.
|
| + }); |
| + }); |
| + |
| teardown(function() { |
| element.historyData_ = []; |
| element.searchedTerm = ''; |