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

Unified Diff: mojo/public/cpp/bindings/tests/map_unittest.cc

Issue 1397133002: Remove callers of mojo::Array<size_t> constructor in favor of ::New (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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: mojo/public/cpp/bindings/tests/map_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/map_unittest.cc b/mojo/public/cpp/bindings/tests/map_unittest.cc
index 9a1525326ada98b2fb5112bead2df90012ea7af9..c451bf65d5e758e1b6716f3f8e4d162e8b7e8d16 100644
--- a/mojo/public/cpp/bindings/tests/map_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/map_unittest.cc
@@ -85,7 +85,7 @@ TEST_F(MapTest, TestIndexOperatorMoveOnly) {
for (size_t i = 0; i < kStringIntDataSize; ++i) {
const char* key = kStringIntData[i].string_data;
- Array<int32_t> array(1);
+ auto array = Array<int32_t>::New(1);
array[0] = kStringIntData[i].int_data;
map[key] = array.Pass();
EXPECT_TRUE(map);
@@ -101,8 +101,8 @@ TEST_F(MapTest, TestIndexOperatorMoveOnly) {
}
TEST_F(MapTest, ConstructedFromArray) {
- Array<String> keys(kStringIntDataSize);
- Array<int> values(kStringIntDataSize);
+ auto keys = Array<String>::New(kStringIntDataSize);
+ auto values = Array<int>::New(kStringIntDataSize);
for (size_t i = 0; i < kStringIntDataSize; ++i) {
keys[i] = kStringIntData[i].string_data;
values[i] = kStringIntData[i].int_data;
@@ -238,7 +238,7 @@ TEST_F(MapTest, MapArrayClone) {
TEST_F(MapTest, ArrayOfMap) {
{
- Array<Map<int32_t, int8_t>> array(1);
+ auto array = Array<Map<int32_t, int8_t>>::New(1);
array[0].insert(1, 42);
size_t size = GetSerializedSize_(array);
@@ -257,8 +257,8 @@ TEST_F(MapTest, ArrayOfMap) {
}
{
- Array<Map<String, Array<bool>>> array(1);
- Array<bool> map_value(2);
+ auto array = Array<Map<String, Array<bool>>>::New(1);
+ auto map_value = Array<bool>::New(2);
map_value[0] = false;
map_value[1] = true;
array[0].insert("hello world", map_value.Pass());
« no previous file with comments | « mojo/public/cpp/bindings/tests/handle_passing_unittest.cc ('k') | mojo/public/cpp/bindings/tests/sample_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698