Tools/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
bool LayoutTestController::cppVariantToBool(const CppVariant& value)
{
    if (value.isBool())
        return value.toBoolean();
    if (value.isInt32())
        return value.toInt32();
    if (value.isString()) {
        string valueString = value.toString();
        if (valueString == "true" || valueString == "1")
            return true;
        if (valueString == "false" || valueString == "0")
            return false;
    }
    logErrorToConsole("Invalid value. Expected boolean value.");
    return false;
}
// Need these conversions because the format of the value for booleans
// may vary - for example, on mac "1" and "0" are used for boolean.
Need these conversions because the format of the value for booleans
may vary - for example, on mac "1" and "0" are used for boolean.
Need these conversions because the format of the value for booleans may vary - for example on mac " 1 " and " 0 " are used for boolean .
bool LayoutTestController::cppVariantToBool(const CppVariant& value)
{
    if (value.isBool())
        return value.toBoolean();
    if (value.isInt32())
        return value.toInt32();
    if (value.isString()) {
        string valueString = value.toString();
        if (valueString == "true" || valueString == "1")
            return true;
        if (valueString == "false" || valueString == "0")
            return false;
    }
    logErrorToConsole("Invalid value. Expected boolean value.");
    return false;
}
bool LayoutTestController :: cppVariantToBool ( const CppVariant & value ) { if ( value . isBool ( ) ) return value . toBoolean ( ) ; if ( value . isInt32 ( ) ) return value . toInt32 ( ) ; if ( value . isString ( ) ) { string valueString = value . toString ( ) ; if ( valueString == " " || valueString == " " ) return true ; if ( valueString == " " || valueString == " " ) return false ; } logErrorToConsole ( " " ) ; return false ; }
Need these conversions because the format of the value for booleans
may vary - for example, on mac "1" and "0" are used for boolean.
Need these conversions because the format of the value for booleans may vary - for example on mac " 1 " and " 0 " are used for boolean .