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

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

Issue 9836036: Add getDefaultFontSize and setDefaultFontSize to Font Settings Extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing 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/docs/samples.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 function getFontList() { 50 function getFontList() {
51 var message = 'getFontList should return an array of objects with ' + 51 var message = 'getFontList should return an array of objects with ' +
52 'fontName and localizedName properties.'; 52 'fontName and localizedName properties.';
53 fs.getFontList(chrome.test.callbackPass(function(value) { 53 fs.getFontList(chrome.test.callbackPass(function(value) {
54 chrome.test.assertTrue(value.length > 0, 54 chrome.test.assertTrue(value.length > 0,
55 "Font list is not expected to be empty."); 55 "Font list is not expected to be empty.");
56 chrome.test.assertEq('string', typeof(value[0].fontName), message); 56 chrome.test.assertEq('string', typeof(value[0].fontName), message);
57 chrome.test.assertEq('string', typeof(value[0].localizedName), message); 57 chrome.test.assertEq('string', typeof(value[0].localizedName), message);
58 })); 58 }));
59 },
60
61 function setDefaultFontSize() {
62 fs.setDefaultFontSize({
63 pixelSize: 22
64 }, chrome.test.callbackPass());
65 },
66
67 function getDefaultFontSize() {
68 var expected = 22;
69 var message = 'Setting for default font size should be ' + expected;
70 fs.getDefaultFontSize({}, expect({pixelSize: expected}, message));
59 } 71 }
60 ]); 72 ]);
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698