Chromium Code Reviews| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 function setDefaultFontSize() { | 61 function setDefaultFontSize() { |
| 62 fs.setDefaultFontSize({ | 62 fs.setDefaultFontSize({ |
| 63 pixelSize: 22 | 63 pixelSize: 22 |
| 64 }, chrome.test.callbackPass()); | 64 }, chrome.test.callbackPass()); |
| 65 }, | 65 }, |
| 66 | 66 |
| 67 function getDefaultFontSize() { | 67 function getDefaultFontSize() { |
| 68 var expected = 22; | 68 var expected = 22; |
| 69 var message = 'Setting for default font size should be ' + expected; | 69 var message = 'Setting for default font size should be ' + expected; |
| 70 fs.getDefaultFontSize({}, expect({pixelSize: expected}, message)); | 70 fs.getDefaultFontSize({}, expect({pixelSize: expected}, message)); |
| 71 }, | |
| 72 | |
| 73 function setDefaultFixedFontSize() { | |
| 74 fs.setDefaultFixedFontSize({ | |
| 75 pixelSize: 42 | |
| 76 }, chrome.test.callbackPass()); | |
| 77 }, | |
| 78 | |
| 79 function getDefaultFixedFontSize() { | |
| 80 var expected = 42; | |
| 81 var message = 'Setting for default fixed font size should be ' + expected; | |
| 82 fs.getDefaultFixedFontSize({}, expect({pixelSize: expected}, message)); | |
| 83 }, | |
| 84 | |
| 85 function setMinimumFontSize() { | |
| 86 fs.setMinimumFontSize({ | |
| 87 pixelSize: 7 | |
| 88 }, chrome.test.callbackPass()); | |
| 89 }, | |
| 90 | |
| 91 function getMinimumFontSize() { | |
| 92 var expected = 7; | |
| 93 var message = 'Setting for minimum font size should be ' + expected; | |
| 94 fs.getMinimumFontSize({}, expect({pixelSize: expected}, message)); | |
|
Matt Perry
2012/03/26 18:53:05
how about putting all the setter tests before the
falken
2012/03/27 02:26:01
Done.
| |
| 71 } | 95 } |
| 72 ]); | 96 ]); |
| OLD | NEW |