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

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: 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));
ncarter (slow) 2017/04/27 22:03:42 You've removed some ADD_FAILURES here, but I don't
Łukasz Anforowicz 2017/04/27 22:59:28 Yes - I think replacing gtest asserts with a DCHEC
}
void AssertTestPageIsLoaded() {

Powered by Google App Engine
This is Rietveld 408576698