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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc

Issue 2001243002: Change POST-exclusion to idempotent-inclusion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing unneeded header, streamlining method Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc
index 03d183585af9d7df84ad341d0c6436e5e6801118..38b3e98644faec6c1d995021a3943753179f37b5 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc
@@ -18,20 +18,21 @@
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/histogram_tester.h"
#include "base/test/mock_entropy_provider.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.h"
#include "net/base/completion_callback.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_flags.h"
#include "net/base/network_change_notifier.h"
#include "net/base/network_delegate.h"
#include "net/base/proxy_delegate.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_transaction_test_util.h"
#include "net/proxy/proxy_server.h"
#include "net/proxy/proxy_service.h"
@@ -336,23 +337,21 @@ TEST_F(DataReductionProxyProtocolTest, TestIdempotency) {
{ "PUT", true },
{ "DELETE", true },
{ "TRACE", true },
{ "POST", false },
{ "CONNECT", false },
};
for (size_t i = 0; i < arraysize(tests); ++i) {
std::unique_ptr<net::URLRequest> request(context.CreateRequest(
GURL("http://www.google.com/"), net::DEFAULT_PRIORITY, NULL));
request->set_method(tests[i].method);
- EXPECT_EQ(
- tests[i].expected_result,
- DataReductionProxyBypassProtocol::IsRequestIdempotent(request.get()));
+ EXPECT_EQ(tests[i].expected_result, IsMethodIdempotent(request->method()));
}
}
// After each test, the proxy retry info will contain zero, one, or two of the
// data reduction proxies depending on whether no bypass was indicated by the
// initial response, a single proxy bypass was indicated, or a double bypass
// was indicated. In both the single and double bypass cases, if the request
// was idempotent, it will be retried over a direct connection.
TEST_F(DataReductionProxyProtocolTest, BypassLogic) {
const struct {

Powered by Google App Engine
This is Rietveld 408576698