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

Unified Diff: base/values_unittest.cc

Issue 820673004: json_schema_compiler: Use std::vector<char> for binary values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplify_json_schema
Patch Set: Fix merge error. Created 5 years, 11 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
« no previous file with comments | « base/values.cc ('k') | chrome/browser/chromeos/extensions/wallpaper_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values_unittest.cc
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index 296880ac6c8db56bddac8e1c77d2c55787812adc..b66730b55e9cb40e03bc0165c92d5f32c8e1484a 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -127,6 +127,12 @@ TEST(ValuesTest, BinaryValue) {
ASSERT_NE(stack_buffer, binary->GetBuffer());
ASSERT_EQ(42U, binary->GetSize());
ASSERT_EQ(0, memcmp(stack_buffer, binary->GetBuffer(), binary->GetSize()));
+
+ // Test overloaded GetAsBinary.
+ Value* narrow_value = binary.get();
+ const BinaryValue* narrow_binary = NULL;
+ ASSERT_TRUE(narrow_value->GetAsBinary(&narrow_binary));
+ EXPECT_EQ(binary.get(), narrow_binary);
}
TEST(ValuesTest, StringValue) {
« no previous file with comments | « base/values.cc ('k') | chrome/browser/chromeos/extensions/wallpaper_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698