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

Unified Diff: chrome/browser/extensions/extension_webui_apitest.cc

Issue 807463003: Use FrameMatchingPredicate() to find RenderFrameHosts in ExtensionWebUITest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_webui_apitest.cc
diff --git a/chrome/browser/extensions/extension_webui_apitest.cc b/chrome/browser/extensions/extension_webui_apitest.cc
index 366a24a7eac146f6e2a03ff163ad078943506ea3..66333ccb4b5cef9bd58e7d2e5cca7c6d2438e476 100644
--- a/chrome/browser/extensions/extension_webui_apitest.cc
+++ b/chrome/browser/extensions/extension_webui_apitest.cc
@@ -26,17 +26,6 @@ namespace OnMessage = core_api::test::OnMessage;
namespace {
-void FindFrame(const GURL& url,
- content::RenderFrameHost** out,
- content::RenderFrameHost* frame) {
- if (frame->GetLastCommittedURL() == url) {
- if (*out != NULL) {
- ADD_FAILURE() << "Found multiple frames at " << url;
- }
- *out = frame;
- }
-}
-
// Tests running extension APIs on WebUI.
class ExtensionWebUITest : public ExtensionApiTest {
protected:
@@ -119,10 +108,9 @@ class ExtensionWebUITest : public ExtensionApiTest {
if (active_web_contents->GetLastCommittedURL() == frame_url)
return active_web_contents->GetMainFrame();
- content::RenderFrameHost* frame_host = NULL;
- active_web_contents->ForEachFrame(
- base::Bind(&FindFrame, frame_url, &frame_host));
- return frame_host;
+ return FrameMatchingPredicate(
+ active_web_contents,
+ base::Bind(&content::FrameHasSourceUrl, frame_url));
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698