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

Side by Side Diff: chrome/test/data/extensions/api_test/font_settings/test.js

Issue 9576001: Add getFontList() to Font Settings Extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/api/experimental.fonts.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Font settings API test 5 // Font settings API test
6 // Run with browser_tests --gtest_filter=ExtensionApiTest.FontSettings 6 // Run with browser_tests --gtest_filter=ExtensionApiTest.FontSettings
7 7
8 var fs = chrome.experimental.fontSettings; 8 var fs = chrome.experimental.fontSettings;
9 9
10 function expect(expected, message) { 10 function expect(expected, message) {
(...skipping 27 matching lines...) Expand all
38 }, chrome.test.callbackPass()); 38 }, chrome.test.callbackPass());
39 }, 39 },
40 40
41 function getGlobalFontName() { 41 function getGlobalFontName() {
42 var expected = 'Arial'; 42 var expected = 'Arial';
43 var message = 43 var message =
44 'Setting for global sansserif font should be ' + expected; 44 'Setting for global sansserif font should be ' + expected;
45 fs.getFontName({ 45 fs.getFontName({
46 genericFamily: 'sansserif' 46 genericFamily: 'sansserif'
47 }, expect({fontName: expected}, message)); 47 }, expect({fontName: expected}, message));
48 },
49
50 function getFontList() {
51 var message = 'getFontList should return an array of objects with ' +
52 'fontName and localizedName properties.';
53 fs.getFontList(chrome.test.callbackPass(function(value) {
54 chrome.test.assertTrue(value.length > 0,
55 "Font list is not expected to be empty.");
56 chrome.test.assertEq('string', typeof(value[0].fontName), message);
57 chrome.test.assertEq('string', typeof(value[0].localizedName), message);
58 }));
48 } 59 }
49 ]); 60 ]);
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/experimental.fonts.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698