summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui/ui_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/ui/ui_test.cc')
-rw-r--r--chrome/test/ui/ui_test.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 4d58e6a..e1bea1b 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -497,13 +497,11 @@ static DictionaryValue* LoadDictionaryValueFromPath(const std::wstring& path) {
return NULL;
JSONFileValueSerializer serializer(path);
- Value* root_value = NULL;
- if (serializer.Deserialize(&root_value, NULL) &&
- root_value->GetType() != Value::TYPE_DICTIONARY) {
- delete root_value;
+ scoped_ptr<Value> root_value(serializer.Deserialize(NULL));
+ if (!root_value.get() || root_value->GetType() != Value::TYPE_DICTIONARY)
return NULL;
- }
- return static_cast<DictionaryValue*>(root_value);
+
+ return static_cast<DictionaryValue*>(root_value.release());
}
DictionaryValue* UITest::GetLocalState() {