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

Side by Side Diff: chrome/test/data/webui/md_history/test_util.js

Issue 2481693002: [MD History] Make forward/backward work in grouped mode. (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/webui/md_history/history_toolbar_test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Replace the current primary element of the test with a new element. Useful 6 * Replace the current primary element of the test with a new element. Useful
7 * as an alternative to PolymerTest.clearBody() which preserves styling. 7 * as an alternative to PolymerTest.clearBody() which preserves styling.
8 * @param {Element} element 8 * @param {Element} element
9 */ 9 */
10 function replaceBody(element) { 10 function replaceBody(element) {
11 var body = document.body; 11 var body = document.body;
12 var currentBody = 12 var app = body.querySelector('history-app');
13 body.querySelector('history-app') || body.querySelector('.test-body'); 13 // Clear the query on the app, if it exists. This clears any query in the URL.
14 if (app)
15 app.set('queryState_.searchTerm', '');
16
17 var currentBody = app || body.querySelector('.test-body');
14 body.removeChild(currentBody); 18 body.removeChild(currentBody);
15 19
16 element.classList.add('test-body'); 20 element.classList.add('test-body');
17 body.appendChild(element); 21 body.appendChild(element);
18 } 22 }
19 23
20 /** 24 /**
21 * Replace the document body with a new instance of <history-app>. 25 * Replace the document body with a new instance of <history-app>.
22 * @return {HistoryAppElement} The app which was created. 26 * @return {HistoryAppElement} The app which was created.
23 */ 27 */
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 var tabs = tabUrls.map(function(tabUrl) { 189 var tabs = tabUrls.map(function(tabUrl) {
186 return {sessionId: 456, timestamp: 0, title: tabUrl, url: tabUrl}; 190 return {sessionId: 456, timestamp: 0, title: tabUrl, url: tabUrl};
187 }); 191 });
188 192
189 return { 193 return {
190 tabs: tabs, 194 tabs: tabs,
191 sessionId: '123', 195 sessionId: '123',
192 userVisibleTimestamp: "A while ago" 196 userVisibleTimestamp: "A while ago"
193 }; 197 };
194 } 198 }
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_history/history_toolbar_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698