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

Unified Diff: chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc

Issue 117693002: Make RenderFrameHostManager swap RenderFrameHosts, not RenderViewHosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
Index: chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc
diff --git a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc
index 91ec5562a2cf7640a36382d39c89a797eb1afc9a..6897972d670f435e3844083d580d25151fa123a3 100644
--- a/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc
+++ b/chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc
@@ -44,6 +44,13 @@ using ::testing::DoAll;
using ::testing::Invoke;
using ::testing::Return;
+namespace {
+
+// The first RenderFrame is routing ID 1, and the first RenderView is 2.
+const int kRenderViewRoutingId = 2;
+
+}
+
namespace safe_browsing {
class PhishingDOMFeatureExtractorTest : public InProcessBrowserTest {
@@ -76,7 +83,7 @@ class PhishingDOMFeatureExtractorTest : public InProcessBrowserTest {
virtual void SetUpOnMainThread() OVERRIDE {
extractor_.reset(new PhishingDOMFeatureExtractor(
- content::RenderView::FromRoutingID(1), &clock_));
+ content::RenderView::FromRoutingID(kRenderViewRoutingId), &clock_));
ASSERT_TRUE(StartTestServer());
host_resolver()->AddRule("*", "127.0.0.1");
@@ -113,8 +120,9 @@ class PhishingDOMFeatureExtractorTest : public InProcessBrowserTest {
// Does the actual work of removing the iframe "frame1" from the document.
void RemoveIframe() {
- blink::WebFrame* main_frame =
- content::RenderView::FromRoutingID(1)->GetWebView()->mainFrame();
+ content::RenderView* render_view =
+ content::RenderView::FromRoutingID(kRenderViewRoutingId);
+ blink::WebFrame* main_frame = render_view->GetWebView()->mainFrame();
ASSERT_TRUE(main_frame);
main_frame->executeScript(
blink::WebString(

Powered by Google App Engine
This is Rietveld 408576698