Chromium Code Reviews| 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 << "'"; |
|
Łukasz Anforowicz
2017/04/28 22:52:09
This ADD_FAILURE will be replaced by a DCHECK from
sky
2017/05/01 16:50:30
Remember that a DCHECK in tests causes a crash. Wo
Łukasz Anforowicz
2017/05/01 18:11:29
Done. Thanks for raising this point again - I pre
|
| - return nullptr; |
| - } |
| - result = rfh; |
| - } |
| - } |
| - |
| - EXPECT_TRUE(result) << "Couldn't find a frame named " |
| - << "'" << name_to_find << "'"; |
|
Łukasz Anforowicz
2017/04/28 22:52:09
This EXPECT_TRUE will be replaced by a DCHECK from
|
| - return result; |
| + return content::FrameMatchingPredicate( |
| + web_contents(), base::Bind(&content::FrameMatchesName, name_to_find)); |
| } |
| void AssertTestPageIsLoaded() { |