| 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_item_test', function() { | 5 cr.define('md_history.history_item_test', function() { |
| 6 function registerTests() { | 6 function registerTests() { |
| 7 suite('history-item', function() { | 7 suite('history-item', function() { |
| 8 var element; | 8 var element; |
| 9 var TEST_HISTORY_RESULTS; | 9 var TEST_HISTORY_RESULTS; |
| 10 var SEARCH_HISTORY_RESULTS; | 10 var SEARCH_HISTORY_RESULTS; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 assertFalse(items[2].hasTimeGap); | 56 assertFalse(items[2].hasTimeGap); |
| 57 }); | 57 }); |
| 58 }); | 58 }); |
| 59 | 59 |
| 60 test('separator insertion after deletion', function() { | 60 test('separator insertion after deletion', function() { |
| 61 element.addNewResults(TEST_HISTORY_RESULTS); | 61 element.addNewResults(TEST_HISTORY_RESULTS); |
| 62 return flush().then(function() { | 62 return flush().then(function() { |
| 63 var items = | 63 var items = |
| 64 Polymer.dom(element.root).querySelectorAll('history-item'); | 64 Polymer.dom(element.root).querySelectorAll('history-item'); |
| 65 | 65 |
| 66 element.removeDeletedHistory_([element.historyData_[3]]); | 66 element.removeItemsByPath(['historyData_.3']); |
| 67 assertEquals(5, element.historyData_.length); | 67 assertEquals(5, element.historyData_.length); |
| 68 | 68 |
| 69 // Checks that a new time gap separator has been inserted. | 69 // Checks that a new time gap separator has been inserted. |
| 70 assertTrue(items[2].hasTimeGap); | 70 assertTrue(items[2].hasTimeGap); |
| 71 | 71 |
| 72 element.removeDeletedHistory_([element.historyData_[3]]); | 72 element.removeItemsByPath(['historyData_.3']); |
| 73 | 73 |
| 74 // Checks time gap separator is removed. | 74 // Checks time gap separator is removed. |
| 75 assertFalse(items[2].hasTimeGap); | 75 assertFalse(items[2].hasTimeGap); |
| 76 }); | 76 }); |
| 77 }); | 77 }); |
| 78 | 78 |
| 79 test('remove bookmarks', function() { | 79 test('remove bookmarks', function() { |
| 80 element.addNewResults(TEST_HISTORY_RESULTS); | 80 element.addNewResults(TEST_HISTORY_RESULTS); |
| 81 return flush().then(function() { | 81 return flush().then(function() { |
| 82 element.set('historyData_.1.starred', true); | 82 element.set('historyData_.1.starred', true); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 teardown(function() { | 114 teardown(function() { |
| 115 element.historyData_ = []; | 115 element.historyData_ = []; |
| 116 element.searchedTerm = ''; | 116 element.searchedTerm = ''; |
| 117 }); | 117 }); |
| 118 }); | 118 }); |
| 119 } | 119 } |
| 120 return { | 120 return { |
| 121 registerTests: registerTests | 121 registerTests: registerTests |
| 122 }; | 122 }; |
| 123 }); | 123 }); |
| OLD | NEW |