OLD | NEW |
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 Loading... |
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 ]); |
OLD | NEW |