diff options
author | limasdf <limasdf@gmail.com> | 2015-12-19 04:04:49 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-19 12:06:04 +0000 |
commit | 21d67e679792a286c581f20ea8e4848b9c34061e (patch) | |
tree | dc6783b7a0229c79e3a8514293fc874eb0fa4789 /extensions/browser/value_store | |
parent | 49f72db8dbff60fb22dfddf09dddeffe54f674db (diff) | |
download | chromium_src-21d67e679792a286c581f20ea8e4848b9c34061e.zip chromium_src-21d67e679792a286c581f20ea8e4848b9c34061e.tar.gz chromium_src-21d67e679792a286c581f20ea8e4848b9c34061e.tar.bz2 |
Use rvalue reference instead of extensions::DictionaryBuilder::pass()
C++ 11 enables rvalue reference with std::move() so that removing DictionaryBuilder::Pass().
BUG=563649
TBR=thakis@chromium.org
Review URL: https://codereview.chromium.org/1532193003
Cr-Commit-Position: refs/heads/master@{#366280}
Diffstat (limited to 'extensions/browser/value_store')
-rw-r--r-- | extensions/browser/value_store/value_store_change_unittest.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/extensions/browser/value_store/value_store_change_unittest.cc b/extensions/browser/value_store/value_store_change_unittest.cc index 9da1f64..123385b 100644 --- a/extensions/browser/value_store/value_store_change_unittest.cc +++ b/extensions/browser/value_store/value_store_change_unittest.cc @@ -57,13 +57,13 @@ TEST(ValueStoreChangeTest, NonNullValues) { TEST(ValueStoreChangeTest, ToJson) { // Create a mildly complicated structure that has dots in it. - scoped_ptr<base::DictionaryValue> value = DictionaryBuilder() - .Set("key", "value") - .Set("key.with.dots", "value.with.dots") - .Set("tricked", DictionaryBuilder() - .Set("you", "nodots")) - .Set("tricked.you", "with.dots") - .Build(); + scoped_ptr<base::DictionaryValue> value = + DictionaryBuilder() + .Set("key", "value") + .Set("key.with.dots", "value.with.dots") + .Set("tricked", std::move(DictionaryBuilder().Set("you", "nodots"))) + .Set("tricked.you", "with.dots") + .Build(); ValueStoreChangeList change_list; change_list.push_back( @@ -79,14 +79,15 @@ TEST(ValueStoreChangeTest, ToJson) { DictionaryBuilder v2(*value); DictionaryBuilder v3(*value); DictionaryBuilder v4(*value); - scoped_ptr<base::DictionaryValue> expected_from_json = DictionaryBuilder() - .Set("key", DictionaryBuilder() - .Set("oldValue", v1) - .Set("newValue", v2)) - .Set("key.with.dots", DictionaryBuilder() - .Set("oldValue", v3) - .Set("newValue", v4)) - .Build(); + scoped_ptr<base::DictionaryValue> expected_from_json = + DictionaryBuilder() + .Set("key", std::move(DictionaryBuilder() + .Set("oldValue", std::move(v1)) + .Set("newValue", std::move(v2)))) + .Set("key.with.dots", std::move(DictionaryBuilder() + .Set("oldValue", std::move(v3)) + .Set("newValue", std::move(v4)))) + .Build(); EXPECT_TRUE(from_json->Equals(expected_from_json.get())); } |