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

Unified Diff: content/test/test_navigation_handle.h

Issue 1269813002: Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Rebase Created 5 years, 3 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: content/test/test_navigation_handle.h
diff --git a/content/test/test_navigation_handle.h b/content/test/test_navigation_handle.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f45842543f3c8034de268ea985b0fcd48d44bfa
--- /dev/null
+++ b/content/test/test_navigation_handle.h
@@ -0,0 +1,50 @@
+// Copyright 2015 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 CONTENT_TEST_TEST_NAVIGATION_HANDLE_H_
+#define CONTENT_TEST_TEST_NAVIGATION_HANDLE_H_
+
+#include <string>
+
+#include "content/browser/frame_host/navigation_handle_impl.h"
+#include "content/public/test/navigation_handle_tester.h"
+
+namespace content {
+
+// A test version of the NavigationHandle that can be used to simulate various
+// navigation call sby embedders of content/.
Charlie Reis 2015/09/16 00:09:25 nit: calls by
clamy 2015/09/16 01:03:22 Done.
+class TestNavigationHandle : public NavigationHandleImpl,
Charlie Reis 2015/09/16 00:09:25 I'm probably missing something here, but why do we
clamy 2015/09/16 01:03:22 Well the goal here is to have embedders of content
Charlie Reis 2015/09/16 17:39:27 [+nick] I see that you're mostly using the TestFo
nasko 2015/09/16 20:33:39 I'd second that a simpler way of testing is going
+ public NavigationHandleTester {
+ public:
+ ~TestNavigationHandle() override;
+
+ static TestNavigationHandle* Create(const GURL& url,
+ const GURL& validated_url,
+ const bool is_main_frame,
+ NavigatorDelegate* delegate);
+
+ // NavigationHandlerTester implementation.
+ NavigationThrottle::ThrottleCheckResult SimulateWillStartRequest(
+ bool is_post,
+ const Referrer& sanitized_referrer,
+ bool has_user_gesture,
+ ui::PageTransition transition,
+ bool is_external_protocol) override;
+ NavigationThrottle::ThrottleCheckResult SimulateWillRedirectRequest(
+ const GURL& new_url,
+ const GURL& new_validated_url,
+ bool new_method_is_post,
+ const GURL& new_referrer_url,
+ bool new_is_external_protocol) override;
+
+ private:
+ TestNavigationHandle(const GURL& url,
+ const GURL& validated_url,
+ const bool is_main_frame,
+ NavigatorDelegate* delegate);
+};
+
+} // namespace content
+
+#endif // CONTENT_TEST_TEST_NAVIGATION_HANDLE_H_

Powered by Google App Engine
This is Rietveld 408576698