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

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

Issue 1648803003: MD History: Drop-down menu allows searching for history-items by domain name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_functionality
Patch Set: Address reviewer comments and small fixes. Created 4 years, 10 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_toolbar_test.js
diff --git a/chrome/test/data/webui/md_history/history_toolbar_test.js b/chrome/test/data/webui/md_history/history_toolbar_test.js
index 0d79836e2b1e5128abed1420490443f6985fb479..cd2f89b172e71807ec38dfcf954c254272bc67ef 100644
--- a/chrome/test/data/webui/md_history/history_toolbar_test.js
+++ b/chrome/test/data/webui/md_history/history_toolbar_test.js
@@ -3,23 +3,17 @@
// found in the LICENSE file.
cr.define('md_history.history_toolbar_test', function() {
- // Array of test history data.
- var TEST_HISTORY_RESULTS = [
- {
- "dateRelativeDay": "Today - Wednesday, December 9, 2015",
- "title": "Google",
- "url": "https://www.google.com"
- }
- ];
-
function registerTests() {
suite('history-toolbar', function() {
var element;
var toolbar;
+ var TEST_HISTORY_RESULTS = [];
suiteSetup(function() {
element = $('history-card-manager');
toolbar = $('toolbar');
+ TEST_HISTORY_RESULTS.push(createHistoryEntry(86400000,
+ "https://google.com"));
});
test('selecting checkbox causes toolbar to change', function(done) {
@@ -68,7 +62,7 @@ cr.define('md_history.history_toolbar_test', function() {
var index = heading.search('Found 1 search result for \'Google\'.');
assertTrue(0 <= index);
- assertEquals(title.innerHTML, '<b>Google</b>');
+ assertEquals(title.innerHTML, 'https://<b>google</b>.com');
done();
});
});
@@ -98,7 +92,21 @@ cr.define('md_history.history_toolbar_test', function() {
})
});
+ test('more from this site sends and sets correct data', function(done) {
+ registerMessageCallback('queryHistory', this, function (info) {
+ assertEquals(info[0], 'Test');
+ done();
+ });
+
+ element.menuIdentifier = {};
+ element.menuIdentifier.domain = 'Test';
+ element.onMoreFromSiteTap_();
+ assertEquals(toolbar.$$('#search-input').$$('#search-input').value,
+ 'Test');
+ });
+
teardown(function() {
+ element.searchTerm = '';
element.historyDataByDay_ = [];
toolbar.count = 0;
});

Powered by Google App Engine
This is Rietveld 408576698