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

Side by Side Diff: chrome/test/data/webui/load_time_data_browsertest.js

Issue 2917003003: [MD Bookmarks] Support elision of bookmark names in the bookmark toast. (Closed)
Patch Set: Created 3 years, 6 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
(Empty)
1 // Copyright 2016 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 * @constructor
7 * @extends testing.Test
8 */
9 function LoadTimeDataTest() {}
10
11 LoadTimeDataTest.prototype = {
12 __proto__: testing.Test.prototype,
13
14 /** @override */
15 browsePreload: 'chrome://resources/html/load_time_data.html',
16 };
17
18 TEST_F('LoadTimeDataTest', 'getStringPieces', function() {
19 assertDeepEquals(
20 [{value: 'paper', arg: null}],
21 loadTimeData.getSubstitutedStringPieces('paper'));
22
23 assertDeepEquals(
24 [
25 {value: 'i think ', arg: null},
26 {value: 'paper mario', arg: '$1'},
27 {value: ' is a good game', arg: null},
28 ],
29 loadTimeData.getSubstitutedStringPieces(
30 'i think $1 is a good game', 'paper mario'));
31
32 assertDeepEquals(
33 [
34 {value: 'paper mario', arg: '$1'},
35 {value: ' costs $', arg: null},
36 {value: '60', arg: '$2'},
37 ],
38 loadTimeData.getSubstitutedStringPieces(
39 '$1 costs $$$2', 'paper mario', '60'));
40
41 assertDeepEquals(
42 [
43 {value: '$$', arg: null},
44 {value: '1', arg: '$1'},
45 {value: '2', arg: '$2'},
46 {value: '1', arg: '$1'},
47 {value: '$', arg: null},
48 {value: '2', arg: '$2'},
49 {value: '$', arg: null},
50 {value: '1', arg: '$1'},
51 {value: '$', arg: null},
52 ],
53 loadTimeData.getSubstitutedStringPieces(
54 '$$$$$1$2$1$$$2$$$1$$', '1', '2'));
55
56 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698