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

Side by Side Diff: net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc

Issue 2101863004: net: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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_store.cc ('k') | net/log/net_log_util.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/extras/sqlite/sqlite_persistent_cookie_store.h" 5 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 DestroyStore(); 652 DestroyStore();
653 653
654 // Create a store that loads session cookie and test that the priority 654 // Create a store that loads session cookie and test that the priority
655 // attribute values are restored. 655 // attribute values are restored.
656 CanonicalCookieVector cookies; 656 CanonicalCookieVector cookies;
657 CreateAndLoad(false, true, &cookies); 657 CreateAndLoad(false, true, &cookies);
658 ASSERT_EQ(3U, cookies.size()); 658 ASSERT_EQ(3U, cookies.size());
659 659
660 // Put the cookies into a map, by name, for comparison below. 660 // Put the cookies into a map, by name, for comparison below.
661 std::map<std::string, CanonicalCookie*> cookie_map; 661 std::map<std::string, CanonicalCookie*> cookie_map;
662 for (const auto& cookie : cookies) 662 for (auto* cookie : cookies)
663 cookie_map[cookie->Name()] = cookie; 663 cookie_map[cookie->Name()] = cookie;
664 664
665 // Validate that each cookie has the correct SameSite. 665 // Validate that each cookie has the correct SameSite.
666 ASSERT_EQ(1u, cookie_map.count(kNoneName)); 666 ASSERT_EQ(1u, cookie_map.count(kNoneName));
667 EXPECT_EQ(CookieSameSite::NO_RESTRICTION, cookie_map[kNoneName]->SameSite()); 667 EXPECT_EQ(CookieSameSite::NO_RESTRICTION, cookie_map[kNoneName]->SameSite());
668 668
669 ASSERT_EQ(1u, cookie_map.count(kLaxName)); 669 ASSERT_EQ(1u, cookie_map.count(kLaxName));
670 EXPECT_EQ(CookieSameSite::LAX_MODE, cookie_map[kLaxName]->SameSite()); 670 EXPECT_EQ(CookieSameSite::LAX_MODE, cookie_map[kLaxName]->SameSite());
671 671
672 ASSERT_EQ(1u, cookie_map.count(kStrictName)); 672 ASSERT_EQ(1u, cookie_map.count(kStrictName));
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 EXPECT_TRUE(was_called_with_no_cookies); 825 EXPECT_TRUE(was_called_with_no_cookies);
826 826
827 // Same with trying to load a specific cookie. 827 // Same with trying to load a specific cookie.
828 was_called_with_no_cookies = false; 828 was_called_with_no_cookies = false;
829 store_->LoadCookiesForKey("foo.bar", base::Bind(WasCalledWithNoCookies, 829 store_->LoadCookiesForKey("foo.bar", base::Bind(WasCalledWithNoCookies,
830 &was_called_with_no_cookies)); 830 &was_called_with_no_cookies));
831 EXPECT_TRUE(was_called_with_no_cookies); 831 EXPECT_TRUE(was_called_with_no_cookies);
832 } 832 }
833 833
834 } // namespace net 834 } // namespace net
OLDNEW
« no previous file with comments | « net/cookies/cookie_store.cc ('k') | net/log/net_log_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698