autogen c version of text from js

This commit is contained in:
Christopher Chedeau
2014-04-28 13:06:00 -07:00
parent e9550a6116
commit 0708b5eb75
4 changed files with 43 additions and 18 deletions

View File

@@ -238,21 +238,21 @@ var layoutTestUtils = (function() {
reduceTest: reduceTest,
text: function(text) {
var body = iframeText.contentDocument.body;
var fn = function(width) {
var fn = function(type, width) {
// Constants for testing purposes between C/JS and other platforms
// Comment this block of code if you want to use the browser to
// generate proper sizes
if (text === 'small') {
if (width === 'grow' || width === 'shrink') {
if (type === 'grow' || type === 'shrink') {
return {width: 33, height: 18}
}
return {width: width, height: 18};
}
if (text === 'loooooooooong with space') {
if (width === 'grow') {
if (type === 'grow') {
return {width: 171, height: 18};
}
if (width === 'shrink') {
if (type === 'shrink') {
return {width: 100, height: 36};
}
return {width: width, height: width >= 171 ? 18 : 36};