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

Unified Diff: content/test/test_navigation_url_loader.cc

Issue 730553002: PlzNavigate: Refactor unit test helper functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the test utils class Created 6 years, 1 month 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
« no previous file with comments | « content/test/test_navigation_url_loader.h ('k') | content/test/test_navigation_url_loader_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_navigation_url_loader.cc
diff --git a/content/test/test_navigation_url_loader.cc b/content/test/test_navigation_url_loader.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b95ea89fbc824619fc3f1686e53019c2c91698ab
--- /dev/null
+++ b/content/test/test_navigation_url_loader.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2014 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.
+
+#include "content/test/test_navigation_url_loader.h"
+
+#include "content/browser/loader/navigation_url_loader_delegate.h"
+#include "content/public/browser/stream_handle.h"
+
+namespace content {
+
+TestNavigationURLLoader::TestNavigationURLLoader(
+ const CommonNavigationParams& common_params,
+ scoped_ptr<NavigationRequestInfo> request_info,
+ NavigationURLLoaderDelegate* delegate)
+ : common_params_(common_params),
+ request_info_(request_info.Pass()),
+ delegate_(delegate),
+ redirect_count_(0) {
+}
+
+void TestNavigationURLLoader::FollowRedirect() {
+ redirect_count_++;
+}
+
+void TestNavigationURLLoader::CallOnRequestRedirected(
+ const net::RedirectInfo& redirect_info,
+ const scoped_refptr<ResourceResponse>& response) {
+ delegate_->OnRequestRedirected(redirect_info, response);
+}
+
+void TestNavigationURLLoader::CallOnResponseStarted(
+ const scoped_refptr<ResourceResponse>& response,
+ scoped_ptr<StreamHandle> body) {
+ delegate_->OnResponseStarted(response, body.Pass());
+}
+
+TestNavigationURLLoader::~TestNavigationURLLoader() {}
+
+} // namespace content
« no previous file with comments | « content/test/test_navigation_url_loader.h ('k') | content/test/test_navigation_url_loader_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698