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

Side by Side Diff: chrome/browser/resources/md_downloads/action_service_unittest.gtestjs

Issue 1557323003: Revert of MD Downloads: add a JS unit test for search term splitting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-dl-data
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * @param {!Array<string>} list
7 * @return {string}
8 */
9 function str(list) {
10 return JSON.stringify(list);
11 }
12
13 /**
14 * @extends {testing.Test}
15 * @constructor
16 */
17 function ActionServiceUnitTest() {}
18
19 ActionServiceUnitTest.prototype = {
20 __proto__: testing.Test.prototype,
21
22 /** @override */
23 extraLibraries: [
24 '../../../../ui/webui/resources/js/cr.js',
25 'action_service.js',
26 ],
27 };
28
29 TEST_F('ActionServiceUnitTest', 'splitTerms', function() {
30 var ActionService = downloads.ActionService;
31 assertEquals(str([]), str(ActionService.splitTerms('')));
32 assertEquals(str([]), str(ActionService.splitTerms(' ')));
33 assertEquals(str(['a']), str(ActionService.splitTerms('a')));
34 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')));
37 assertEquals(str(['a', 'b b', 'c']),
38 str(ActionService.splitTerms('a "b b" c')));
39 });
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698