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

Unified Diff: webkit/tools/test_shell/layout_test_controller.cc

Issue 5209004: Loosen the checks for numbers in layout test controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/layout_test_controller.cc
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index 32baaa87fcf6da526434d2085a0f1443c28eaf4c..8816e85de6ef50a576efb6609443cd7cf2290fea 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -1148,7 +1148,7 @@ void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& args,
bool LayoutTestController::CppVariantToBool(const CppVariant& value) {
if (value.isBool())
return value.ToBoolean();
- else if (value.isInt32())
+ else if (value.isNumber())
return 0 != value.ToInt32();
else if (value.isString()) {
std::string valueString = value.ToString();
@@ -1162,7 +1162,7 @@ bool LayoutTestController::CppVariantToBool(const CppVariant& value) {
}
int32 LayoutTestController::CppVariantToInt32(const CppVariant& value) {
- if (value.isInt32())
+ if (value.isNumber())
return value.ToInt32();
else if (value.isString()) {
int number;
@@ -1315,7 +1315,7 @@ void LayoutTestController::clearAllDatabases(
void LayoutTestController::setDatabaseQuota(
const CppArgumentList& args, CppVariant* result) {
result->SetNull();
- if ((args.size() >= 1) && args[0].isInt32())
+ if ((args.size() >= 1) && args[0].isNumber())
SimpleDatabaseSystem::GetInstance()->SetDatabaseQuota(args[0].ToInt32());
}
@@ -1425,7 +1425,7 @@ void LayoutTestController::setTimelineProfilingEnabled(
void LayoutTestController::evaluateInWebInspector(const CppArgumentList& args,
CppVariant* result) {
result->SetNull();
- if (args.size() < 2 || !args[0].isInt32() || !args[1].isString())
+ if (args.size() < 2 || !args[0].isNumber() || !args[1].isString())
return;
shell_->dev_tools_agent()->evaluateInWebInspector(args[0].ToInt32(),
args[1].ToString());
@@ -1506,8 +1506,7 @@ void LayoutTestController::setMockGeolocationPosition(
void LayoutTestController::setMockGeolocationError(const CppArgumentList& args,
CppVariant* result) {
- if (args.size() < 2 ||
- !args[0].isInt32() || !args[1].isString())
+ if (args.size() < 2 || !args[0].isNumber() || !args[1].isString())
return;
WebGeolocationServiceMock::setMockGeolocationError(
args[0].ToInt32(), WebString::fromUTF8(args[1].ToString()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698