| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 done(); | 59 done(); |
| 60 }); | 60 }); |
| 61 }); | 61 }); |
| 62 | 62 |
| 63 test('separator insertion after deletion', function(done) { | 63 test('separator insertion after deletion', function(done) { |
| 64 element.addNewResults(TEST_HISTORY_RESULTS); | 64 element.addNewResults(TEST_HISTORY_RESULTS); |
| 65 flush(function() { | 65 flush(function() { |
| 66 var items = | 66 var items = |
| 67 Polymer.dom(element.root).querySelectorAll('history-item'); | 67 Polymer.dom(element.root).querySelectorAll('history-item'); |
| 68 | 68 |
| 69 element.removeDeletedHistory_([element.historyData[3]]); | 69 element.removeDeletedHistory_([element.historyData_[3]]); |
| 70 assertEquals(5, element.historyData.length); | 70 assertEquals(5, element.historyData_.length); |
| 71 | 71 |
| 72 // Checks that a new time gap separator has been inserted. | 72 // Checks that a new time gap separator has been inserted. |
| 73 assertTrue(items[2].hasTimeGap); | 73 assertTrue(items[2].hasTimeGap); |
| 74 | 74 |
| 75 element.removeDeletedHistory_([element.historyData[3]]); | 75 element.removeDeletedHistory_([element.historyData_[3]]); |
| 76 | 76 |
| 77 // Checks time gap separator is removed. | 77 // Checks time gap separator is removed. |
| 78 assertFalse(items[2].hasTimeGap); | 78 assertFalse(items[2].hasTimeGap); |
| 79 done(); | 79 done(); |
| 80 }); | 80 }); |
| 81 }); | 81 }); |
| 82 | 82 |
| 83 teardown(function() { | 83 teardown(function() { |
| 84 element.historyData = []; | 84 element.historyData_ = []; |
| 85 element.searchedTerm = ''; | 85 element.searchedTerm = ''; |
| 86 }); | 86 }); |
| 87 }); | 87 }); |
| 88 } | 88 } |
| 89 return { | 89 return { |
| 90 registerTests: registerTests | 90 registerTests: registerTests |
| 91 }; | 91 }; |
| 92 }); | 92 }); |
| OLD | NEW |