| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <time.h> | 5 #include <time.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 741 |
| 742 cm->GetCookiesWithInfo(url_google, options, &cookie_line, &cookie_infos); | 742 cm->GetCookiesWithInfo(url_google, options, &cookie_line, &cookie_infos); |
| 743 | 743 |
| 744 EXPECT_EQ("A=B; C=D", cookie_line); | 744 EXPECT_EQ("A=B; C=D", cookie_line); |
| 745 | 745 |
| 746 EXPECT_EQ(2U, cookie_infos.size()); | 746 EXPECT_EQ(2U, cookie_infos.size()); |
| 747 | 747 |
| 748 EXPECT_EQ("A", cookie_infos[0].name); | 748 EXPECT_EQ("A", cookie_infos[0].name); |
| 749 EXPECT_EQ("", cookie_infos[0].mac_key); | 749 EXPECT_EQ("", cookie_infos[0].mac_key); |
| 750 EXPECT_EQ("", cookie_infos[0].mac_algorithm); | 750 EXPECT_EQ("", cookie_infos[0].mac_algorithm); |
| 751 EXPECT_EQ(url_google.spec(), cookie_infos[0].source); | |
| 752 | 751 |
| 753 EXPECT_EQ("C", cookie_infos[1].name); | 752 EXPECT_EQ("C", cookie_infos[1].name); |
| 754 EXPECT_EQ("390jfn0awf3", cookie_infos[1].mac_key); | 753 EXPECT_EQ("390jfn0awf3", cookie_infos[1].mac_key); |
| 755 EXPECT_EQ("hmac-sha-1", cookie_infos[1].mac_algorithm); | 754 EXPECT_EQ("hmac-sha-1", cookie_infos[1].mac_algorithm); |
| 756 EXPECT_EQ(url_google.spec(), cookie_infos[1].source); | |
| 757 } | 755 } |
| 758 | 756 |
| 759 namespace { | 757 namespace { |
| 760 | 758 |
| 761 struct CookieDateParsingCase { | 759 struct CookieDateParsingCase { |
| 762 const char* str; | 760 const char* str; |
| 763 const bool valid; | 761 const bool valid; |
| 764 const time_t epoch; | 762 const time_t epoch; |
| 765 }; | 763 }; |
| 766 | 764 |
| (...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2317 | 2315 |
| 2318 // kValidCookieLine creates a session cookie. | 2316 // kValidCookieLine creates a session cookie. |
| 2319 GURL url_google(kUrlGoogle); | 2317 GURL url_google(kUrlGoogle); |
| 2320 ASSERT_TRUE(cm->SetCookie(url_google, kValidCookieLine)); | 2318 ASSERT_TRUE(cm->SetCookie(url_google, kValidCookieLine)); |
| 2321 expired_histogram->SnapshotSample(&histogram_set_1); | 2319 expired_histogram->SnapshotSample(&histogram_set_1); |
| 2322 EXPECT_EQ(histogram_set_2.TotalCount(), | 2320 EXPECT_EQ(histogram_set_2.TotalCount(), |
| 2323 histogram_set_1.TotalCount()); | 2321 histogram_set_1.TotalCount()); |
| 2324 } | 2322 } |
| 2325 | 2323 |
| 2326 } // namespace | 2324 } // namespace |
| OLD | NEW |