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

Unified Diff: chrome/test/chromedriver/element_util.cc

Issue 377683002: Fixes for re-enabling more MSVC level 4 warnings: chrome/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/element_util.cc
diff --git a/chrome/test/chromedriver/element_util.cc b/chrome/test/chromedriver/element_util.cc
index 9b15fa511844d3d4a8723e232257641a27ba2809..274449f7b2c992a3229ef9c405498519af986ced 100644
--- a/chrome/test/chromedriver/element_util.cc
+++ b/chrome/test/chromedriver/element_util.cc
@@ -27,7 +27,8 @@ bool ParseFromValue(base::Value* value, WebPoint* point) {
base::DictionaryValue* dict_value;
if (!value->GetAsDictionary(&dict_value))
return false;
- double x, y;
+ double x = 0;
+ double y = 0;
if (!dict_value->GetDouble("x", &x) ||
!dict_value->GetDouble("y", &y))
return false;
@@ -40,7 +41,8 @@ bool ParseFromValue(base::Value* value, WebSize* size) {
base::DictionaryValue* dict_value;
if (!value->GetAsDictionary(&dict_value))
return false;
- double width, height;
+ double width = 0;
+ double height = 0;
if (!dict_value->GetDouble("width", &width) ||
!dict_value->GetDouble("height", &height))
return false;
@@ -53,7 +55,10 @@ bool ParseFromValue(base::Value* value, WebRect* rect) {
base::DictionaryValue* dict_value;
if (!value->GetAsDictionary(&dict_value))
return false;
- double x, y, width, height;
+ double x = 0;
+ double y = 0;
+ double width = 0;
+ double height = 0;
if (!dict_value->GetDouble("left", &x) ||
!dict_value->GetDouble("top", &y) ||
!dict_value->GetDouble("width", &width) ||
@@ -100,7 +105,7 @@ Status VerifyElementClickable(
if (status.IsError())
return status;
base::DictionaryValue* dict;
- bool is_clickable;
+ bool is_clickable = false;
if (!result->GetAsDictionary(&dict) ||
!dict->GetBoolean("clickable", &is_clickable)) {
return Status(kUnknownError,

Powered by Google App Engine
This is Rietveld 408576698