naiveproxy/net/cookies/canonical_cookie_test_helpers.h

26 lines
702 B
C
Raw Normal View History

2018-08-15 01:19:20 +03:00
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_COOKIES_CANONICAL_COOKIE_TEST_HELPERS_H_
#define NET_COOKIES_CANONICAL_COOKIE_TEST_HELPERS_H_
#include <string>
#include "net/cookies/canonical_cookie.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace net {
MATCHER_P(MatchesCookieLine, cookie_line, "") {
std::string argument_line = CanonicalCookie::BuildCookieLine(arg);
if (argument_line == cookie_line)
return true;
*result_listener << argument_line;
return false;
}
} // namespace net
#endif // NET_COOKIES_CANONICAL_COOKIE_TEST_HELPERS_H_