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

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

Issue 1852903002: Create an interactive site-per-process browsertest class and move DocumentHasFocus there. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig's comments Created 4 years, 8 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_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index fac8957dbfd8e28c7518cbcb49e8401e6c04cdec..70a06cc2a4bed7db75da0e123b3c312ee86e9d40 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -24,6 +24,8 @@
#include "content/browser/accessibility/accessibility_mode_helper.h"
#include "content/browser/accessibility/browser_accessibility.h"
#include "content/browser/accessibility/browser_accessibility_manager.h"
+#include "content/browser/frame_host/frame_tree_node.h"
+#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/web_contents/web_contents_view.h"
@@ -744,6 +746,13 @@ bool FrameHasSourceUrl(const GURL& url, RenderFrameHost* frame) {
return frame->GetLastCommittedURL() == url;
}
+RenderFrameHost* ChildFrameAt(RenderFrameHost* frame, size_t index) {
+ RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(frame);
+ if (index >= rfh->frame_tree_node()->child_count())
+ return nullptr;
+ return rfh->frame_tree_node()->child_at(index)->current_frame_host();
+}
+
bool ExecuteWebUIResourceTest(WebContents* web_contents,
const std::vector<int>& js_resource_ids) {
// Inject WebUI test runner script first prior to other scripts required to
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698