Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef BASE_TEST_VALUES_TEST_UTIL_H_ | 5 #ifndef BASE_TEST_VALUES_TEST_UTIL_H_ |
| 6 #define BASE_TEST_VALUES_TEST_UTIL_H_ | 6 #define BASE_TEST_VALUES_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 const std::string& key); | 31 const std::string& key); |
| 32 | 32 |
| 33 void ExpectDictListValue(const ListValue& expected_value, | 33 void ExpectDictListValue(const ListValue& expected_value, |
| 34 const DictionaryValue& value, | 34 const DictionaryValue& value, |
| 35 const std::string& key); | 35 const std::string& key); |
| 36 | 36 |
| 37 void ExpectDictStringValue(const std::string& expected_value, | 37 void ExpectDictStringValue(const std::string& expected_value, |
| 38 const DictionaryValue& value, | 38 const DictionaryValue& value, |
| 39 const std::string& key); | 39 const std::string& key); |
| 40 | 40 |
| 41 // Takes ownership of |actual|. | 41 void ExpectStringValue(const std::string& expected_str, |
| 42 void ExpectStringValue(const std::string& expected_str, Value* actual); | 42 std::unique_ptr<Value> actual); |
|
brettw
2017/05/19 20:31:02
It seems weird to me that such a function would ta
jdoerrie
2017/05/22 08:15:59
Good point, I changed it now.
Shorter callsites
| |
| 43 | 43 |
| 44 namespace test { | 44 namespace test { |
| 45 | 45 |
| 46 // Parses |json| as JSON, allowing trailing commas, and returns the | 46 // Parses |json| as JSON, allowing trailing commas, and returns the |
| 47 // resulting value. If the json fails to parse, causes an EXPECT | 47 // resulting value. If the json fails to parse, causes an EXPECT |
| 48 // failure and returns the Null Value (but never a NULL pointer). | 48 // failure and returns the Null Value (but never a NULL pointer). |
| 49 std::unique_ptr<Value> ParseJson(base::StringPiece json); | 49 std::unique_ptr<Value> ParseJson(base::StringPiece json); |
| 50 | 50 |
| 51 } // namespace test | 51 } // namespace test |
| 52 } // namespace base | 52 } // namespace base |
| 53 | 53 |
| 54 #endif // BASE_TEST_VALUES_TEST_UTIL_H_ | 54 #endif // BASE_TEST_VALUES_TEST_UTIL_H_ |
| OLD | NEW |