| Index: content/public/test/browser_side_navigation_test_utils.cc
|
| diff --git a/content/test/browser_side_navigation_test_utils.cc b/content/public/test/browser_side_navigation_test_utils.cc
|
| similarity index 76%
|
| rename from content/test/browser_side_navigation_test_utils.cc
|
| rename to content/public/test/browser_side_navigation_test_utils.cc
|
| index 0dbd60b6e25f11198eebd0ad274575609e2c80a2..ca895b54b483db73fd658df796ddcedbcc176048 100644
|
| --- a/content/test/browser_side_navigation_test_utils.cc
|
| +++ b/content/public/test/browser_side_navigation_test_utils.cc
|
| @@ -1,19 +1,23 @@
|
| -// Copyright (c) 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 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/browser_side_navigation_test_utils.h"
|
| +#include "content/public/test/browser_side_navigation_test_utils.h"
|
|
|
| #include "base/command_line.h"
|
| #include "base/guid.h"
|
| #include "base/lazy_instance.h"
|
| #include "base/macros.h"
|
| +#include "content/browser/frame_host/frame_tree_node.h"
|
| #include "content/browser/streams/stream.h"
|
| #include "content/browser/streams/stream_registry.h"
|
| +#include "content/browser/web_contents/web_contents_impl.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/stream_handle.h"
|
| +#include "content/public/common/browser_side_navigation_policy.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "content/test/test_navigation_url_loader_factory.h"
|
| +#include "content/test/test_render_frame_host.h"
|
|
|
| namespace content {
|
|
|
| @@ -71,4 +75,13 @@ void EnableBrowserSideNavigation() {
|
| switches::kEnableBrowserSideNavigation);
|
| }
|
|
|
| +void SimulateCurrentRenderFrameHostUnloading(RenderFrameHost* rfh) {
|
| + bool browser_side_navigation = IsBrowserSideNavigationEnabled();
|
| + TestRenderFrameHost* main_frame = static_cast<TestRenderFrameHost*>(rfh);
|
| + if (!browser_side_navigation ||
|
| + main_frame->frame_tree_node()->navigation_request()) {
|
| + main_frame->PrepareForCommit();
|
| + }
|
| +}
|
| +
|
| } // namespace content
|
|
|