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

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

Issue 1480263002: Revert of MD Downloads: track downloads in C++, dispatch discrete JS updates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
(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 });
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