| Index: content/public/test/navigation_handle_tester.cc
|
| diff --git a/content/public/test/navigation_handle_tester.cc b/content/public/test/navigation_handle_tester.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a2788e23eae46b69208900aa11db3534440630c7
|
| --- /dev/null
|
| +++ b/content/public/test/navigation_handle_tester.cc
|
| @@ -0,0 +1,36 @@
|
| +// 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.
|
| +
|
| +#include "content/public/test/navigation_handle_tester.h"
|
| +
|
| +#include "content/browser/frame_host/navigator.h"
|
| +#include "content/browser/web_contents/web_contents_impl.h"
|
| +#include "content/public/browser/navigation_handle.h"
|
| +#include "content/public/browser/web_contents.h"
|
| +#include "content/test/test_navigation_handle.h"
|
| +
|
| +namespace content {
|
| +
|
| +// static
|
| +NavigationHandleTester* NavigationHandleTester::For(
|
| + NavigationHandle* navigation_handle) {
|
| + return static_cast<TestNavigationHandle*>(navigation_handle);
|
| +}
|
| +
|
| +// static
|
| +NavigationHandle* NavigationHandleTester::CreateTestNavigationHandle(
|
| + const GURL& url,
|
| + const GURL& validated_url,
|
| + bool is_main_frame,
|
| + WebContents* web_contents) {
|
| + return TestNavigationHandle::Create(
|
| + url, validated_url, is_main_frame,
|
| + static_cast<WebContentsImpl*>(web_contents)
|
| + ->GetMainFrame()
|
| + ->frame_tree_node()
|
| + ->navigator()
|
| + ->GetDelegate());
|
| +}
|
| +
|
| +} // namespace content
|
|
|