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_ |