| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/base_paths.h" | 6 #include "base/base_paths.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 scoped_ptr<base::Value> prefs_value = base::JSONReader::Read(prefs_str); | 184 scoped_ptr<base::Value> prefs_value = base::JSONReader::Read(prefs_str); |
| 185 const base::DictionaryValue* prefs_dict = NULL; | 185 const base::DictionaryValue* prefs_dict = NULL; |
| 186 ASSERT_TRUE(prefs_value->GetAsDictionary(&prefs_dict)); | 186 ASSERT_TRUE(prefs_value->GetAsDictionary(&prefs_dict)); |
| 187 AssertEQ(*prefs_dict, "myPrefsKey", "ok"); | 187 AssertEQ(*prefs_dict, "myPrefsKey", "ok"); |
| 188 AssertEQ(*prefs_dict, "pref.sub", "1"); | 188 AssertEQ(*prefs_dict, "pref.sub", "1"); |
| 189 | 189 |
| 190 base::FilePath local_state_file = | 190 base::FilePath local_state_file = |
| 191 temp_dir.path().Append(chrome::kLocalStateFilename); | 191 temp_dir.path().Append(chrome::kLocalStateFilename); |
| 192 std::string local_state_str; | 192 std::string local_state_str; |
| 193 ASSERT_TRUE(base::ReadFileToString(local_state_file, &local_state_str)); | 193 ASSERT_TRUE(base::ReadFileToString(local_state_file, &local_state_str)); |
| 194 scoped_ptr<base::Value> local_state_value( | 194 scoped_ptr<base::Value> local_state_value = |
| 195 base::JSONReader::DeprecatedRead(local_state_str)); | 195 base::JSONReader::Read(local_state_str); |
| 196 const base::DictionaryValue* local_state_dict = NULL; | 196 const base::DictionaryValue* local_state_dict = NULL; |
| 197 ASSERT_TRUE(local_state_value->GetAsDictionary(&local_state_dict)); | 197 ASSERT_TRUE(local_state_value->GetAsDictionary(&local_state_dict)); |
| 198 AssertEQ(*local_state_dict, "myLocalKey", "ok"); | 198 AssertEQ(*local_state_dict, "myLocalKey", "ok"); |
| 199 AssertEQ(*local_state_dict, "local.state.sub", "2"); | 199 AssertEQ(*local_state_dict, "local.state.sub", "2"); |
| 200 } | 200 } |
| OLD | NEW |