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

Unified Diff: components/proxy_config/proxy_config_dictionary_unittest.cc

Issue 2785883003: Use unique_ptr<DictionaryValue> in ProxyConfigDictionary (Closed)
Patch Set: one constructor Created 3 years, 9 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: components/proxy_config/proxy_config_dictionary_unittest.cc
diff --git a/components/proxy_config/proxy_config_dictionary_unittest.cc b/components/proxy_config/proxy_config_dictionary_unittest.cc
index 33f5364c14b7160005d3a2c7711033473a920f1c..e7047223aac85e6bf9fba3c8789ff0f357aace29 100644
--- a/components/proxy_config/proxy_config_dictionary_unittest.cc
+++ b/components/proxy_config/proxy_config_dictionary_unittest.cc
@@ -6,6 +6,7 @@
#include <memory>
#include <string>
+#include <utility>
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -18,9 +19,9 @@ struct ProxyConfigHolder {
};
TEST(ProxyConfigDictionaryTest, CreateDirect) {
- std::unique_ptr<base::DictionaryValue> dict_value(
- ProxyConfigDictionary::CreateDirect());
- ProxyConfigDictionary dict(dict_value.get());
+ std::unique_ptr<base::DictionaryValue> dict_value =
+ ProxyConfigDictionary::CreateDirect();
+ ProxyConfigDictionary dict(std::move(dict_value));
ProxyConfigHolder h;
ASSERT_TRUE(dict.GetMode(&h.mode));
@@ -31,9 +32,9 @@ TEST(ProxyConfigDictionaryTest, CreateDirect) {
}
TEST(ProxyConfigDictionaryTest, CreateAutoDetect) {
- std::unique_ptr<base::DictionaryValue> dict_value(
- ProxyConfigDictionary::CreateAutoDetect());
- ProxyConfigDictionary dict(dict_value.get());
+ std::unique_ptr<base::DictionaryValue> dict_value =
+ ProxyConfigDictionary::CreateAutoDetect();
+ ProxyConfigDictionary dict(std::move(dict_value));
ProxyConfigHolder h;
ASSERT_TRUE(dict.GetMode(&h.mode));
@@ -44,9 +45,9 @@ TEST(ProxyConfigDictionaryTest, CreateAutoDetect) {
}
TEST(ProxyConfigDictionaryTest, CreatePacScript) {
- std::unique_ptr<base::DictionaryValue> dict_value(
- ProxyConfigDictionary::CreatePacScript("pac", false));
- ProxyConfigDictionary dict(dict_value.get());
+ std::unique_ptr<base::DictionaryValue> dict_value =
+ ProxyConfigDictionary::CreatePacScript("pac", false);
+ ProxyConfigDictionary dict(std::move(dict_value));
ProxyConfigHolder h;
ASSERT_TRUE(dict.GetMode(&h.mode));
@@ -58,10 +59,9 @@ TEST(ProxyConfigDictionaryTest, CreatePacScript) {
}
TEST(ProxyConfigDictionaryTest, CreateFixedServers) {
- std::unique_ptr<base::DictionaryValue> dict_value(
- ProxyConfigDictionary::CreateFixedServers("http://1.2.3.4",
- "http://foo"));
- ProxyConfigDictionary dict(dict_value.get());
+ std::unique_ptr<base::DictionaryValue> dict_value =
+ ProxyConfigDictionary::CreateFixedServers("http://1.2.3.4", "http://foo");
+ ProxyConfigDictionary dict(std::move(dict_value));
ProxyConfigHolder h;
ASSERT_TRUE(dict.GetMode(&h.mode));
@@ -74,9 +74,9 @@ TEST(ProxyConfigDictionaryTest, CreateFixedServers) {
}
TEST(ProxyConfigDictionaryTest, CreateSystem) {
- std::unique_ptr<base::DictionaryValue> dict_value(
- ProxyConfigDictionary::CreateSystem());
- ProxyConfigDictionary dict(dict_value.get());
+ std::unique_ptr<base::DictionaryValue> dict_value =
+ ProxyConfigDictionary::CreateSystem();
+ ProxyConfigDictionary dict(std::move(dict_value));
ProxyConfigHolder h;
ASSERT_TRUE(dict.GetMode(&h.mode));
« chromeos/network/onc/onc_utils.cc ('K') | « components/proxy_config/proxy_config_dictionary.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698