| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Tests common functionality used by the Chrome Extensions Cookies API | 5 // Tests common functionality used by the Chrome Extensions Cookies API |
| 6 // implementation. | 6 // implementation. |
| 7 | 7 |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/extension_cookies_api_constants.h" | 11 #include "chrome/browser/extensions/extension_cookies_api_constants.h" |
| 11 #include "chrome/browser/extensions/extension_cookies_helpers.h" | 12 #include "chrome/browser/extensions/extension_cookies_helpers.h" |
| 12 #include "chrome/test/testing_profile.h" | 13 #include "chrome/test/testing_profile.h" |
| 14 #include "googleurl/src/gurl.h" |
| 13 | 15 |
| 14 namespace keys = extension_cookies_api_constants; | 16 namespace keys = extension_cookies_api_constants; |
| 15 | 17 |
| 16 namespace { | 18 namespace { |
| 17 | 19 |
| 18 struct DomainMatchCase { | 20 struct DomainMatchCase { |
| 19 const char* filter; | 21 const char* filter; |
| 20 const char* domain; | 22 const char* domain; |
| 21 const bool matches; | 23 const bool matches; |
| 22 }; | 24 }; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 details->SetString(keys::kDomainKey, std::string(tests[i].filter)); | 194 details->SetString(keys::kDomainKey, std::string(tests[i].filter)); |
| 193 extension_cookies_helpers::MatchFilter filter(details.get()); | 195 extension_cookies_helpers::MatchFilter filter(details.get()); |
| 194 net::CookieMonster::CanonicalCookie cookie("", "", tests[i].domain, | 196 net::CookieMonster::CanonicalCookie cookie("", "", tests[i].domain, |
| 195 "", false, false, | 197 "", false, false, |
| 196 base::Time(), | 198 base::Time(), |
| 197 base::Time(), | 199 base::Time(), |
| 198 false, base::Time()); | 200 false, base::Time()); |
| 199 EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie)); | 201 EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie)); |
| 200 } | 202 } |
| 201 } | 203 } |
| OLD | NEW |