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

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

Issue 2068613002: [MD History] Add URL parameter for search. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@routing
Patch Set: Created 4 years, 6 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_routing_test.js
diff --git a/chrome/test/data/webui/md_history/history_routing_test.js b/chrome/test/data/webui/md_history/history_routing_test.js
index 200abede7d95d74b75a5d59d492ec4afe72b916d..31bc1211b9a9a09c962490a42daf8582f14c4382 100644
--- a/chrome/test/data/webui/md_history/history_routing_test.js
+++ b/chrome/test/data/webui/md_history/history_routing_test.js
@@ -7,11 +7,13 @@ cr.define('md_history.history_routing_test', function() {
suite('synced-tabs', function() {
var app;
var list;
+ var toolbar;
suiteSetup(function() {
app = $('history-app');
element = app.$['history-list'];
- sidebar = app.$['history-side-bar']
+ sidebar = app.$['history-side-bar'];
+ toolbar = app.$['toolbar'];
});
test('changing route changes active view', function() {
@@ -33,8 +35,41 @@ cr.define('md_history.history_routing_test', function() {
assertEquals('/', app.route.path);
});
+ test('route updates from search', function() {
+ var searchTerm = 'McCree';
+ assertEquals('/', app.route.path);
+ toolbar.setSearchTerm(searchTerm);
+ assertEquals(searchTerm, app.route.__queryParams.q);
+ });
+
+ test('search updates from route', function() {
+ var searchTerm = 'Mei';
+ assertEquals('history', app.$.content.selected);
+ app.set('route.__queryParams.q', searchTerm);
+ assertEquals(searchTerm, toolbar.searchTerm);
+ });
+
+ test('search preserved across menu items', function() {
+ var searchTerm = 'Soldier 76';
+ var menu = sidebar.$.menu;
+ assertEquals('/', app.route.path);
+ assertEquals('history', app.$.content.selected);
+ app.set('route.__queryParams.q', searchTerm);
+
+ MockInteractions.tap(menu.children[1]);
+ assertEquals('/syncedTabs', app.route.path);
+ assertEquals(searchTerm, app.route.__queryParams.q);
+ assertEquals(searchTerm, toolbar.searchTerm);
+
+ MockInteractions.tap(menu.children[0]);
+ assertEquals('/', app.route.path);
+ assertEquals(searchTerm, app.route.__queryParams.q);
+ assertEquals(searchTerm, toolbar.searchTerm);
+ });
+
teardown(function() {
app.set('route.path', '/');
+ app.set('route.__queryParams.q', null);
});
});
}

Powered by Google App Engine
This is Rietveld 408576698