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

Unified Diff: chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc

Issue 2849603005: Do not reinvent the wheel / use content APIs to find a frame by name. (Closed)
Patch Set: Making the return statement in FrameMatchingPredicate safe against null dereferencing. Created 3 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
Index: chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc b/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
index 3b051d1e4770ffbddbd9f7ec241fa3be5e780211..fb73c92faf8fbfbf097beb6bf8929f78893b1760 100644
--- a/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
+++ b/chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc
@@ -702,21 +702,8 @@ class DragAndDropBrowserTest : public InProcessBrowserTest,
}
content::RenderFrameHost* GetFrameByName(const std::string& name_to_find) {
- content::RenderFrameHost* result = nullptr;
- for (content::RenderFrameHost* rfh : web_contents()->GetAllFrames()) {
- if (rfh->GetFrameName() == name_to_find) {
- if (result) {
- ADD_FAILURE() << "More than one frame named "
- << "'" << name_to_find << "'";
- return nullptr;
- }
- result = rfh;
- }
- }
-
- EXPECT_TRUE(result) << "Couldn't find a frame named "
- << "'" << name_to_find << "'";
- return result;
+ return content::FrameMatchingPredicate(
+ web_contents(), base::Bind(&content::FrameMatchesName, name_to_find));
}
void AssertTestPageIsLoaded() {
« no previous file with comments | « chrome/browser/subresource_filter/subresource_filter_browsertest.cc ('k') | content/browser/webui/web_ui_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698