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

Side by Side Diff: net/cookies/cookie_monster_unittest.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/cookies/cookie_monster_store_test.cc ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/cookies/cookie_monster.h" 5 #include "net/cookies/cookie_monster.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return false; 91 return false;
92 } 92 }
93 93
94 bool CookieValuePredicate(const std::string& true_value, 94 bool CookieValuePredicate(const std::string& true_value,
95 const CanonicalCookie& cookie) { 95 const CanonicalCookie& cookie) {
96 return cookie.Value() == true_value; 96 return cookie.Value() == true_value;
97 } 97 }
98 98
99 struct CookieMonsterTestTraits { 99 struct CookieMonsterTestTraits {
100 static std::unique_ptr<CookieStore> Create() { 100 static std::unique_ptr<CookieStore> Create() {
101 return base::WrapUnique(new CookieMonster(nullptr, nullptr)); 101 return base::MakeUnique<CookieMonster>(nullptr, nullptr);
102 } 102 }
103 103
104 static const bool supports_http_only = true; 104 static const bool supports_http_only = true;
105 static const bool supports_non_dotted_domains = true; 105 static const bool supports_non_dotted_domains = true;
106 static const bool preserves_trailing_dots = true; 106 static const bool preserves_trailing_dots = true;
107 static const bool filters_schemes = true; 107 static const bool filters_schemes = true;
108 static const bool has_path_prefix_bug = false; 108 static const bool has_path_prefix_bug = false;
109 static const int creation_time_granularity_in_ms = 0; 109 static const int creation_time_granularity_in_ms = 0;
110 static const bool enforce_strict_secure = false; 110 static const bool enforce_strict_secure = false;
111 }; 111 };
112 112
113 struct CookieMonsterEnforcingStrictSecure { 113 struct CookieMonsterEnforcingStrictSecure {
114 static std::unique_ptr<CookieStore> Create() { 114 static std::unique_ptr<CookieStore> Create() {
115 return base::WrapUnique(new CookieMonster(nullptr, nullptr)); 115 return base::MakeUnique<CookieMonster>(nullptr, nullptr);
116 } 116 }
117 117
118 static const bool supports_http_only = true; 118 static const bool supports_http_only = true;
119 static const bool supports_non_dotted_domains = true; 119 static const bool supports_non_dotted_domains = true;
120 static const bool preserves_trailing_dots = true; 120 static const bool preserves_trailing_dots = true;
121 static const bool filters_schemes = true; 121 static const bool filters_schemes = true;
122 static const bool has_path_prefix_bug = false; 122 static const bool has_path_prefix_bug = false;
123 static const int creation_time_granularity_in_ms = 0; 123 static const int creation_time_granularity_in_ms = 0;
124 static const bool enforce_strict_secure = true; 124 static const bool enforce_strict_secure = true;
125 }; 125 };
(...skipping 3366 matching lines...) Expand 10 before | Expand all | Expand 10 after
3492 monster()->AddCallbackForCookie( 3492 monster()->AddCallbackForCookie(
3493 test_url_, "abc", 3493 test_url_, "abc",
3494 base::Bind(&RecordCookieChanges, &cookies1, nullptr))); 3494 base::Bind(&RecordCookieChanges, &cookies1, nullptr)));
3495 SetCookie(monster(), test_url_, "abc=def"); 3495 SetCookie(monster(), test_url_, "abc=def");
3496 base::RunLoop().RunUntilIdle(); 3496 base::RunLoop().RunUntilIdle();
3497 EXPECT_EQ(1U, cookies0.size()); 3497 EXPECT_EQ(1U, cookies0.size());
3498 EXPECT_EQ(1U, cookies0.size()); 3498 EXPECT_EQ(1U, cookies0.size());
3499 } 3499 }
3500 3500
3501 } // namespace net 3501 } // namespace net
OLDNEW
« no previous file with comments | « net/cookies/cookie_monster_store_test.cc ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698