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

Unified Diff: chrome/test/data/extensions/api_test/font_settings/test.js

Issue 10177003: Font Settings Extension API: Add functions to clear prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/font_settings/test.js
diff --git a/chrome/test/data/extensions/api_test/font_settings/test.js b/chrome/test/data/extensions/api_test/font_settings/test.js
index b08bef882e30ef885e682198595cbdcbc319063d..adaa5d7d756c705ff76e46682a714a6b7e051b00 100644
--- a/chrome/test/data/extensions/api_test/font_settings/test.js
+++ b/chrome/test/data/extensions/api_test/font_settings/test.js
@@ -6,6 +6,7 @@
// Run with browser_tests --gtest_filter=ExtensionApiTest.FontSettings
var fs = chrome.experimental.fontSettings;
+var CONTROLLABLE_BY_THIS_EXTENSION = 'controllable_by_this_extension';
function expect(expected, message) {
return chrome.test.callbackPass(function(value) {
@@ -173,4 +174,93 @@ chrome.test.runTests([
var message = 'Setting for default character set should be ' + expected;
fs.getDefaultCharacterSet(expect({charset: expected}, message));
},
+
+ // This test may fail on Windows if the font is not installed on the
+ // system. See crbug.com/122303
+ function clearPerScriptFont() {
+ var script = 'Hang';
+ var genericFamily = 'standard';
+ var fontName = 'Tahoma';
+
+ chrome.test.listenOnce(fs.onFontChanged, function(details) {
+ chrome.test.assertEq(details, {
+ script: script,
+ genericFamily: genericFamily,
+ fontName: fontName,
+ levelOfControl: CONTROLLABLE_BY_THIS_EXTENSION
+ });
+ });
+
+ fs.clearFont({
+ script: script,
+ genericFamily: genericFamily,
+ }, chrome.test.callbackPass());
+ },
+
+ // This test may fail on Windows if the font is not installed on the
+ // system. See crbug.com/122303
+ function clearGlobalFont() {
+ var genericFamily = 'sansserif';
+ var fontName = 'Arial';
+
+ chrome.test.listenOnce(fs.onFontChanged, function(details) {
+ chrome.test.assertEq(details, {
+ genericFamily: genericFamily,
+ fontName: fontName,
+ levelOfControl: CONTROLLABLE_BY_THIS_EXTENSION
+ });
+ });
+
+ fs.clearFont({
+ genericFamily: genericFamily,
+ }, chrome.test.callbackPass());
+ },
+
+ function clearDefaultFontSize() {
+ var pixelSize = 16;
+ chrome.test.listenOnce(fs.onDefaultFontSizeChanged, function(details) {
+ chrome.test.assertEq(details, {
+ pixelSize: pixelSize,
+ levelOfControl: CONTROLLABLE_BY_THIS_EXTENSION
+ });
+ });
+
+ fs.clearDefaultFontSize({}, chrome.test.callbackPass());
+ },
+
+ function clearDefaultFixedFontSize() {
+ var pixelSize = 14;
+ chrome.test.listenOnce(fs.onDefaultFixedFontSizeChanged, function(details) {
+ chrome.test.assertEq(details, {
+ pixelSize: pixelSize,
+ levelOfControl: CONTROLLABLE_BY_THIS_EXTENSION
+ });
+ });
+
+ fs.clearDefaultFixedFontSize({}, chrome.test.callbackPass());
+ },
+
+ function clearMinimumFontSize() {
+ var pixelSize = 8;
+ chrome.test.listenOnce(fs.onMinimumFontSizeChanged, function(details) {
+ chrome.test.assertEq(details, {
+ pixelSize: pixelSize,
+ levelOfControl: CONTROLLABLE_BY_THIS_EXTENSION
+ });
+ });
+
+ fs.clearMinimumFontSize({}, chrome.test.callbackPass());
+ },
+
+ function clearDefaultCharacterSet() {
+ var charset = 'Shift_JIS';
+ chrome.test.listenOnce(fs.onDefaultCharacterSetChanged, function(details) {
+ chrome.test.assertEq(details, {
+ charset: charset,
+ levelOfControl: CONTROLLABLE_BY_THIS_EXTENSION
+ });
+ });
+
+ fs.clearDefaultCharacterSet({}, chrome.test.callbackPass());
+ },
]);
« 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