Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef NET_COOKIES_CANONICAL_COOKIE_TEST_HELPERS_H_ |
| 6 | #define NET_COOKIES_CANONICAL_COOKIE_TEST_HELPERS_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "net/cookies/canonical_cookie.h" |
| 11 | #include "testing/gmock/include/gmock/gmock.h" |
| 12 | |
| 13 | namespace net { |
| 14 | |
| 15 | MATCHER_P(MatchesCookieLine, cookie_line, "") { |
| 16 | std::string argument_line = CanonicalCookie::BuildCookieLine(arg); |
| 17 | if (argument_line == cookie_line) |
| 18 | return true; |
| 19 | |
| 20 | *result_listener << argument_line; |
| 21 | return false; |
| 22 | } |
| 23 | |
| 24 | } // namespace net |
| 25 | |
| 26 | #endif // NET_COOKIES_CANONICAL_COOKIE_TEST_HELPERS_H_ |