diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp')
-rw-r--r-- | WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp index 85b2dce..a55070e 100644 --- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp @@ -150,7 +150,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation); bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError); bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition); - bindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult); + bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult); bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled); bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale); bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy); @@ -1174,7 +1174,7 @@ bool LayoutTestController::cppVariantToBool(const CppVariant& value) { if (value.isBool()) return value.toBoolean(); - if (value.isInt32()) + if (value.isNumber()) return value.toInt32(); if (value.isString()) { string valueString = value.toString(); @@ -1189,7 +1189,7 @@ bool LayoutTestController::cppVariantToBool(const CppVariant& value) int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value) { - if (value.isInt32()) + if (value.isNumber()) return value.toInt32(); if (value.isString()) { string stringSource = value.toString(); @@ -1342,7 +1342,7 @@ void LayoutTestController::clearAllDatabases(const CppArgumentList& arguments, C void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); - if ((arguments.size() >= 1) && arguments[0].isInt32()) + if ((arguments.size() >= 1) && arguments[0].isNumber()) webkit_support::SetDatabaseQuota(arguments[0].toInt32()); } @@ -1444,7 +1444,7 @@ void LayoutTestController::setTimelineProfilingEnabled(const CppArgumentList& ar void LayoutTestController::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); - if (arguments.size() < 2 || !arguments[0].isInt32() || !arguments[1].isString()) + if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) return; m_shell->drtDevToolsAgent()->evaluateInWebInspector(arguments[0].toInt32(), arguments[1].toString()); } @@ -1492,7 +1492,7 @@ void LayoutTestController::setEditingBehavior(const CppArgumentList& arguments, m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorUnix; m_shell->applyPreferences(); } else - logErrorToConsole("Passed invalid editing behavior. Should be 'mac' or 'win'."); + logErrorToConsole("Passed invalid editing behavior. Should be 'mac', 'win', or 'unix'."); } void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result) @@ -1527,7 +1527,7 @@ void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arg void LayoutTestController::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); - if (arguments.size() < 2 || !arguments[0].isInt32() || !arguments[1].isString()) + if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) return; WebGeolocationServiceMock::setMockGeolocationError(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); } @@ -1537,13 +1537,13 @@ void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVaria result->setNull(); } -void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) +void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); - if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isString()) + if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumber() || !arguments[2].isString()) return; - m_shell->webViewHost()->speechInputControllerMock()->setMockRecognitionResult(cppVariantToWebString(arguments[0]), cppVariantToWebString(arguments[1])); + m_shell->webViewHost()->speechInputControllerMock()->addMockRecognitionResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble(), cppVariantToWebString(arguments[2])); } void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result) |