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

Unified Diff: content/public/test/browser_side_navigation_test_utils.cc

Issue 2296483002: Fix some unit_tests under PlzNavigate (Closed)
Patch Set: . Created 4 years, 4 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
« no previous file with comments | « content/public/test/browser_side_navigation_test_utils.h ('k') | content/public/test/test_renderer_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
scottmg 2016/08/30 18:15:31 I had to move this file into content/public/test s
+ }
+}
+
} // namespace content
« no previous file with comments | « content/public/test/browser_side_navigation_test_utils.h ('k') | content/public/test/test_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698