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

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: tsergeant@ review / test fix 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
« no previous file with comments | « chrome/browser/resources/md_downloads/vulcanized.html ('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_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..5729be5c6e439a0f82e93192dc1fc0e81bdd9206 100644
--- a/chrome/test/data/webui/md_downloads/toolbar_tests.js
+++ b/chrome/test/data/webui/md_downloads/toolbar_tests.js
@@ -7,7 +7,21 @@ suite('toolbar tests', function() {
var toolbar;
setup(function() {
+ /**
+ * @constructor
+ * @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 +32,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);
+ });
});
« no previous file with comments | « chrome/browser/resources/md_downloads/vulcanized.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698