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

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

Issue 10142011: Add character encoding to Font Settings Extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments 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 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 pixelSize: pixelSize, 123 pixelSize: pixelSize,
124 levelOfControl: 'controlled_by_this_extension' 124 levelOfControl: 'controlled_by_this_extension'
125 }); 125 });
126 }); 126 });
127 127
128 fs.setMinimumFontSize({ 128 fs.setMinimumFontSize({
129 pixelSize: pixelSize 129 pixelSize: pixelSize
130 }, chrome.test.callbackPass()); 130 }, chrome.test.callbackPass());
131 }, 131 },
132 132
133 function setDefaultCharacterSet() {
134 var charset = 'GBK';
135 chrome.test.listenOnce(fs.onDefaultCharacterSetChanged, function(details) {
136 chrome.test.assertEq(details, {
137 charset: charset,
138 levelOfControl: 'controlled_by_this_extension'
139 });
140 });
141
142 fs.setDefaultCharacterSet({
143 charset: charset
144 }, chrome.test.callbackPass());
145 },
146
133 function getDefaultFontSize() { 147 function getDefaultFontSize() {
134 var expected = 22; 148 var expected = 22;
135 var message = 'Setting for default font size should be ' + expected; 149 var message = 'Setting for default font size should be ' + expected;
136 fs.getDefaultFontSize({}, expect({pixelSize: expected}, message)); 150 fs.getDefaultFontSize({}, expect({pixelSize: expected}, message));
137 }, 151 },
138 152
139 function getDefaultFontSizeOmitDetails() { 153 function getDefaultFontSizeOmitDetails() {
140 var expected = 22; 154 var expected = 22;
141 var message = 'Setting for default font size should be ' + expected; 155 var message = 'Setting for default font size should be ' + expected;
142 fs.getDefaultFontSize(expect({pixelSize: expected}, message)); 156 fs.getDefaultFontSize(expect({pixelSize: expected}, message));
143 }, 157 },
144 158
145 function getDefaultFixedFontSize() { 159 function getDefaultFixedFontSize() {
146 var expected = 42; 160 var expected = 42;
147 var message = 'Setting for default fixed font size should be ' + expected; 161 var message = 'Setting for default fixed font size should be ' + expected;
148 fs.getDefaultFixedFontSize({}, expect({pixelSize: expected}, message)); 162 fs.getDefaultFixedFontSize({}, expect({pixelSize: expected}, message));
149 }, 163 },
150 164
151 function getMinimumFontSize() { 165 function getMinimumFontSize() {
152 var expected = 7; 166 var expected = 7;
153 var message = 'Setting for minimum font size should be ' + expected; 167 var message = 'Setting for minimum font size should be ' + expected;
154 fs.getMinimumFontSize({}, expect({pixelSize: expected}, message)); 168 fs.getMinimumFontSize({}, expect({pixelSize: expected}, message));
155 } 169 },
170
171 function getDefaultCharacterSet() {
172 var expected = 'GBK';
173 var message = 'Setting for default character set should be ' + expected;
174 fs.getDefaultCharacterSet(expect({charset: expected}, message));
175 },
156 ]); 176 ]);
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