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

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

Issue 2570253002: [MD History] Fix toolbar dates in grouped mode. (Closed)
Patch Set: Created 4 years 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_grouped_list_test.js
diff --git a/chrome/test/data/webui/md_history/history_grouped_list_test.js b/chrome/test/data/webui/md_history/history_grouped_list_test.js
index 35e69e428090908fbbdc92342b5dc5a1c70cdef7..9e3ea6b5c376b994c2ca62e27e950500226909ee 100644
--- a/chrome/test/data/webui/md_history/history_grouped_list_test.js
+++ b/chrome/test/data/webui/md_history/history_grouped_list_test.js
@@ -80,8 +80,6 @@ cr.define('md_history.history_grouped_list_test', function() {
test('items grouped by domain', function() {
app.set('queryState_.range', HistoryRange.WEEK);
var info = createHistoryInfo();
- info.queryStartTime = 'Yesterday';
- info.queryEndTime = 'Now';
app.historyResult(info, SIMPLE_RESULTS);
return PolymerTest.flushTasks().then(function() {
var data = groupedList.groupedHistoryData_;
@@ -93,13 +91,29 @@ cr.define('md_history.history_grouped_list_test', function() {
assertEquals(2, data[0].domains[0].visits.length);
assertEquals(1, data[0].domains[1].visits.length);
assertEquals(1, data[0].domains[2].visits.length);
-
- // Ensure the toolbar displays the correct begin and end time.
- assertEquals('Yesterday', toolbar.queryStartTime);
- assertEquals('Now', toolbar.queryEndTime);
});
});
+ test('toolbar dates appear in grouped mode', function() {
+ app.set('queryState_.range', HistoryRange.MONTH);
tsergeant 2016/12/15 06:31:37 This test is a bit confusing to read. The most rel
calamity 2016/12/15 06:57:00 How about this?
+ var info = createHistoryInfo();
tsergeant 2016/12/15 06:31:37 Also, should the new info fields appear in createH
calamity 2016/12/15 06:57:00 Hmm. So, the way this test is set up actually impl
+ info.queryStartMonth = 'Dec 2016';
+ info.queryStartTimeShort = 'Yesterday';
+ info.queryEndTimeShort = 'Now';
+ app.historyResult(info, SIMPLE_RESULTS);
+ assertEquals(
+ 'Dec 2016', toolbar.$$('#grouped-date').textContent.trim());
+ app.set('queryState_.range', HistoryRange.WEEK);
+ info = createHistoryInfo();
+ info.queryStartMonth = 'Dec 2016';
+ info.queryStartTimeShort = 'Yesterday';
+ info.queryEndTimeShort = 'Now';
+ app.historyResult(info, SIMPLE_RESULTS);
+ assertEquals(
+ loadTimeData.getStringF('historyInterval', 'Yesterday', 'Now'),
+ toolbar.$$('#grouped-date').textContent.trim());
+ });
+
test('items grouped by day in week view', function() {
app.set('queryState_.range', HistoryRange.WEEK);
app.historyResult(createHistoryInfo(), PER_DAY_RESULTS);

Powered by Google App Engine
This is Rietveld 408576698