| Index: chrome/test/data/webui/md_history/history_item_test.js
|
| diff --git a/chrome/test/data/webui/md_history/history_item_test.js b/chrome/test/data/webui/md_history/history_item_test.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dace59d695fc80e9d1c8d3ca0ec49784c735f3ae
|
| --- /dev/null
|
| +++ b/chrome/test/data/webui/md_history/history_item_test.js
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// 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_item_test', function() {
|
| + var TEST_HISTORY_RESULTS = [
|
| + {"time": "1000000000"},
|
| + {"time": "10000000"},
|
| + {"time": "900000"},
|
| + {"time": "899999"}
|
| + ];
|
| +
|
| + function registerTests() {
|
| + suite('history-item', function() {
|
| + var element;
|
| +
|
| + suiteSetup(function() {
|
| + element = $('history-list');
|
| + });
|
| +
|
| + test('basic separator insertion', function() {
|
| + 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);
|
| + });
|
| + });
|
| +
|
| + teardown(function() {
|
| + element.historyDataByDay_ = [];
|
| + });
|
| + });
|
| + }
|
| + return {
|
| + registerTests: registerTests
|
| + };
|
| +});
|
|
|