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

Unified Diff: chrome/test/data/webui/md_downloads/toolbar_tests.js

Issue 2284463002: MD Downloads: fix search spinner when terms are the same (Closed)
Patch Set: +tests Created 4 years, 4 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_downloads/toolbar_tests.js
diff --git a/chrome/test/data/webui/md_downloads/toolbar_tests.js b/chrome/test/data/webui/md_downloads/toolbar_tests.js
index a051efe3c395976240955f13600f78d66e153413..b747f8a29cd22c7e6a502c66fd2e20a4cbccf9b4 100644
--- a/chrome/test/data/webui/md_downloads/toolbar_tests.js
+++ b/chrome/test/data/webui/md_downloads/toolbar_tests.js
@@ -7,7 +7,18 @@ suite('toolbar tests', function() {
var toolbar;
setup(function() {
+ /** @extends {downloads.ActionService} */
+ function TestActionService() {
+ downloads.ActionService.call(this);
+ }
+
+ TestActionService.prototype = {
+ __proto__: downloads.ActionService.prototype,
+ loadMore: function() { /* Prevent chrome.send(). */ },
+ };
+
toolbar = document.createElement('downloads-toolbar');
+ downloads.ActionService.instance_ = new TestActionService;
document.body.appendChild(toolbar);
});
@@ -18,4 +29,15 @@ suite('toolbar tests', function() {
window.dispatchEvent(new CustomEvent('resize'));
assertFalse(toolbar.$.more.opened);
});
+
+ test('search starts spinner', function() {
+ toolbar.$.toolbar.fire('search-changed', 'a');
+ assertTrue(toolbar.spinnerActive);
+
+ // Pretend the manager got results and set this to false.
+ toolbar.spinnerActive = false;
+
+ toolbar.$.toolbar.fire('search-changed', 'a '); // Same term plus a space.
+ assertFalse(toolbar.spinnerActive);
+ });
});

Powered by Google App Engine
This is Rietveld 408576698