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

Unified Diff: chrome/test/data/webui/md_bookmarks/router_test.js

Issue 2960143002: MD Bookmarks: Remove '/?id=1' from URL when displaying Bookmarks Bar (Closed)
Patch Set: Tweak logic to remove extra dispatch, add tests Created 3 years, 5 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_bookmarks/router_test.js
diff --git a/chrome/test/data/webui/md_bookmarks/router_test.js b/chrome/test/data/webui/md_bookmarks/router_test.js
index f118c12ca61f2ea5753782fba6ca9bb807397152..979de0d3be06b6d6658cad207df3c32387f03a8d 100644
--- a/chrome/test/data/webui/md_bookmarks/router_test.js
+++ b/chrome/test/data/webui/md_bookmarks/router_test.js
@@ -62,6 +62,25 @@ suite('<bookmarks-router>', function() {
assertEquals('chrome://bookmarks/?q=bloop', window.location.href);
});
});
+
+ test('bookmarks bar selected with empty route', function() {
+ navigateTo('/?id=2');
+ navigateTo('/');
+ assertEquals('select-folder', store.lastAction.name);
+ assertEquals('1', store.lastAction.id);
+ });
+
+ test('selecting bookmarks bar clears route', function() {
+ store.data.selectedFolder = '2';
+ store.notifyObservers();
+
+ return Promise.resolve().then(function() {
+ store.data.selectedFolder = '1';
+ store.notifyObservers();
+ }).then(function() {
+ assertEquals('chrome://bookmarks/', window.location.href);
calamity 2017/07/05 04:04:39 Assert above this that the route was ?id=2 at some
tsergeant 2017/07/05 07:37:36 Done, by moving this extra check up into the test
+ });
+ });
});
suite('URL preload', function() {
@@ -120,7 +139,7 @@ suite('URL preload', function() {
var state = bookmarks.Store.getInstance().data;
assertEquals('1', state.selectedFolder);
return Promise.resolve().then(function() {
- assertEquals('chrome://bookmarks/?id=1', window.location.href);
+ assertEquals('chrome://bookmarks/', window.location.href);
});
});
});
« chrome/browser/ui/chrome_pages.cc ('K') | « chrome/browser/ui/webui/bookmarks_ui_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698