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

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

Issue 1880783002: MD History: Use computed functions for card borders and time gaps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 8 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
index e088063391fef1321bcf394339b2702f15dbf68a..6d6691b4bf98a621ec12ab7de881357a4d520904 100644
--- a/chrome/test/data/webui/md_history/history_item_test.js
+++ b/chrome/test/data/webui/md_history/history_item_test.js
@@ -27,22 +27,19 @@ cr.define('md_history.history_item_test', function() {
];
});
- setup(function() {
- element.addNewResults(TEST_HISTORY_RESULTS, '');
- });
-
test('basic separator insertion', function(done) {
+ element.addNewResults(TEST_HISTORY_RESULTS, '');
flush(function() {
// Check that the correct number of time gaps are inserted.
var items =
Polymer.dom(element.root).querySelectorAll('history-item');
- assertTrue(items[0].item.needsTimeGap);
- assertTrue(items[1].item.needsTimeGap);
- assertFalse(items[2].item.needsTimeGap);
- assertTrue(items[3].item.needsTimeGap);
- assertFalse(items[4].item.needsTimeGap);
- assertFalse(items[5].item.needsTimeGap);
+ assertTrue(items[0].hasTimeGap);
+ assertTrue(items[1].hasTimeGap);
+ assertFalse(items[2].hasTimeGap);
+ assertTrue(items[3].hasTimeGap);
+ assertFalse(items[4].hasTimeGap);
+ assertFalse(items[5].hasTimeGap);
done();
});
@@ -54,15 +51,16 @@ cr.define('md_history.history_item_test', function() {
var items =
Polymer.dom(element.root).querySelectorAll('history-item');
- assertTrue(items[0].item.needsTimeGap);
- assertFalse(items[1].item.needsTimeGap);
- assertFalse(items[2].item.needsTimeGap);
+ assertTrue(items[0].hasTimeGap);
+ assertFalse(items[1].hasTimeGap);
+ assertFalse(items[2].hasTimeGap);
done();
});
});
test('separator insertion after deletion', function(done) {
+ element.addNewResults(TEST_HISTORY_RESULTS, '');
flush(function() {
var items =
Polymer.dom(element.root).querySelectorAll('history-item');
@@ -74,14 +72,14 @@ cr.define('md_history.history_item_test', function() {
assertEquals(element.historyData.length, 5);
// Checks that a new time gap separator has been inserted.
- assertTrue(items[2].item.needsTimeGap);
+ assertTrue(items[2].hasTimeGap);
element.set('historyData.3.selected', true);
items[3].onCheckboxSelected_();
element.removeDeletedHistory(1);
// Checks time gap separator is removed.
- assertFalse(items[2].item.needsTimeGap);
+ assertFalse(items[2].hasTimeGap);
done();
});
});
« no previous file with comments | « chrome/browser/resources/md_history/history_list.js ('k') | chrome/test/data/webui/md_history/history_list_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698