| Index: chrome/test/data/webui/md_history/history_item_test.js
|
| diff --git a/chrome/test/data/webui/md_history/history_card_test.js b/chrome/test/data/webui/md_history/history_item_test.js
|
| similarity index 46%
|
| rename from chrome/test/data/webui/md_history/history_card_test.js
|
| rename to chrome/test/data/webui/md_history/history_item_test.js
|
| index 25c5fa4a01159fcd97058215f08e070f88882d82..d3cd2316362fe653e51d357b1fc4b22690b870d8 100644
|
| --- a/chrome/test/data/webui/md_history/history_card_test.js
|
| +++ b/chrome/test/data/webui/md_history/history_item_test.js
|
| @@ -2,24 +2,44 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -cr.define('md_history.history_card_test', function() {
|
| +cr.define('md_history.history_item_test', function() {
|
| + var TEST_HISTORY_RESULTS = [
|
| + {"time": "1000000000"},
|
| + {"time": "10000000"},
|
| + {"time": "900000"},
|
| + {"time": "899999"}
|
| + ];
|
| +
|
| function registerTests() {
|
| - suite('history-card', function() {
|
| + suite('history-item', function() {
|
| + var element;
|
| +
|
| + suiteSetup(function() {
|
| + element = $('history-list');
|
| + });
|
| +
|
| test('basic separator insertion', function(done) {
|
| - var element = document.createElement('history-card');
|
| - element.historyItems = [
|
| - {"time": "1000000000"},
|
| - {"time": "10000000"},
|
| - {"time": "900000"}
|
| - ];
|
| + element.addNewResults(TEST_HISTORY_RESULTS);
|
| +
|
| flush(function() {
|
| // Check that the correct number of time gaps are inserted.
|
| var spacers =
|
| Polymer.dom(element.root).querySelectorAll('#time-gap-separator');
|
| assertEquals(2, spacers.length);
|
| +
|
| + var items =
|
| + Polymer.dom(element.root).querySelectorAll('history-item');
|
| + assertTrue(items[0].hasTimeGap);
|
| + assertTrue(items[1].hasTimeGap);
|
| + assertFalse(items[2].hasTimeGap);
|
| +
|
| done();
|
| });
|
| });
|
| +
|
| + teardown(function() {
|
| + element.historyData = [];
|
| + });
|
| });
|
| }
|
| return {
|
|
|