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

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

Issue 2590093002: MD History: Move queryState to be managed by history-router (Closed)
Patch Set: Rebase Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/md_history/history_list_test.js
diff --git a/chrome/test/data/webui/md_history/history_list_test.js b/chrome/test/data/webui/md_history/history_list_test.js
index 39873325c4047b55d449a0c594826551a77183c7..e914174b3bc213117df520a0c2d94ece3a0605ea 100644
--- a/chrome/test/data/webui/md_history/history_list_test.js
+++ b/chrome/test/data/webui/md_history/history_list_test.js
@@ -440,12 +440,17 @@ suite('<history-list>', function() {
});
});
- test('delete dialog closed on url change', function() {
+ test('delete dialog closed on back navigation', function(done) {
+ // Ensure that state changes are always mirrored to the URL.
+ app.$$('history-router').$$('iron-location').dwellTime = 0;
app.queryState_.queryingDisabled = false;
- var listContainer = app.$.history;
+ // Navigate from chrome://history/ to chrome://history/?q=something else.
+ app.set('queryState_.searchTerm', 'something else');
app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
app.historyResult(createHistoryInfo(), ADDITIONAL_RESULTS);
- return PolymerTest.flushTasks().then(function() {
+
+ var listContainer = app.$.history;
+ PolymerTest.flushTasks().then(function() {
items = Polymer.dom(element.root).querySelectorAll('history-item');
MockInteractions.tap(items[2].$.checkbox);
@@ -456,9 +461,15 @@ suite('<history-list>', function() {
}).then(function() {
// Confirmation dialog should appear.
assertTrue(listContainer.$.dialog.getIfExists().open);
+ // Navigate back to chrome://history.
+ window.history.back();
- app.set('queryState_.searchTerm', 'something else');
- assertFalse(listContainer.$.dialog.getIfExists().open);
+ listenOnce(window, 'popstate', function() {
+ PolymerTest.flushTasks().then(function() {
+ assertFalse(listContainer.$.dialog.getIfExists().open);
+ done();
+ });
+ });
});
});
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698