Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: chrome/test/data/webui/md_history/history_item_test.js

Issue 1641543002: MD History: Refactored design for displaying history information (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@second_patch
Patch Set: removed dodgy fix for end of history query: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698