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

Unified Diff: chrome/browser/resources/md_downloads/action_service_unittest.gtestjs

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
Index: chrome/browser/resources/md_downloads/action_service_unittest.gtestjs
diff --git a/chrome/browser/resources/md_downloads/action_service_unittest.gtestjs b/chrome/browser/resources/md_downloads/action_service_unittest.gtestjs
index 9f850352f75ac9b204fad8f69be043897aefc448..d7670bd870ea4bd36fbd74f66f6ff430e086dd5d 100644
--- a/chrome/browser/resources/md_downloads/action_service_unittest.gtestjs
+++ b/chrome/browser/resources/md_downloads/action_service_unittest.gtestjs
@@ -37,3 +37,23 @@ TEST_F('ActionServiceUnitTest', 'splitTerms', function() {
assertEquals(str(['a', 'b b', 'c']),
str(ActionService.splitTerms('a "b b" c')));
});
+
+TEST_F('ActionServiceUnitTest', 'searchWithSimilarTerms', function() {
+ /**
+ * @extends {downloads.ActionService}
+ * @constructor
+ */
+ function TestActionService() {
+ downloads.ActionService.call(this);
+ }
+
+ TestActionService.prototype = {
+ __proto__: downloads.ActionService.prototype,
+ loadMore: function() { /* No chrome.send() for you! */ },
+ };
+
+ var actionService = new TestActionService();
+
+ assertTrue(actionService.search('a'));
+ assertFalse(actionService.search('a ')); // Same term + space should no-op.
+});
« no previous file with comments | « chrome/browser/resources/md_downloads/action_service.js ('k') | chrome/browser/resources/md_downloads/crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698