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

Side by Side 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: +tests Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @param {!Array<string>} list 6 * @param {!Array<string>} list
7 * @return {string} 7 * @return {string}
8 */ 8 */
9 function str(list) { 9 function str(list) {
10 return JSON.stringify(list); 10 return JSON.stringify(list);
(...skipping 19 matching lines...) Expand all
30 var ActionService = downloads.ActionService; 30 var ActionService = downloads.ActionService;
31 assertEquals(str([]), str(ActionService.splitTerms(''))); 31 assertEquals(str([]), str(ActionService.splitTerms('')));
32 assertEquals(str([]), str(ActionService.splitTerms(' '))); 32 assertEquals(str([]), str(ActionService.splitTerms(' ')));
33 assertEquals(str(['a']), str(ActionService.splitTerms('a'))); 33 assertEquals(str(['a']), str(ActionService.splitTerms('a')));
34 assertEquals(str(['a b']), str(ActionService.splitTerms('a b'))); 34 assertEquals(str(['a b']), str(ActionService.splitTerms('a b')));
35 assertEquals(str(['a', 'b']), str(ActionService.splitTerms('a "b"'))); 35 assertEquals(str(['a', 'b']), str(ActionService.splitTerms('a "b"')));
36 assertEquals(str(['a', 'b', 'c']), str(ActionService.splitTerms('a "b" c'))); 36 assertEquals(str(['a', 'b', 'c']), str(ActionService.splitTerms('a "b" c')));
37 assertEquals(str(['a', 'b b', 'c']), 37 assertEquals(str(['a', 'b b', 'c']),
38 str(ActionService.splitTerms('a "b b" c'))); 38 str(ActionService.splitTerms('a "b b" c')));
39 }); 39 });
40
41 TEST_F('ActionServiceUnitTest', 'searchWithSimilarTerms', function() {
tsergeant 2016/08/25 23:22:22 Looks like this test is calling chrome.send unexpe
Dan Beam 2016/08/25 23:49:06 Done.
42 assertTrue(downloads.ActionService.getInstance().search('a'));
43 assertFalse(downloads.ActionService.getInstance().search('a '));
44 });
OLDNEW
« 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