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

Unified Diff: chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc

Issue 9706012: Add abstractions that let embedders drive tests of WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove CONTENT_EXPORT on statically linked functions. Merge to head for commit. Created 8 years, 9 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/safe_browsing/browser_feature_extractor_unittest.cc
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
index 1a0bad67659b9b1f173cf60a88e06acdf3927b4a..e8d0b99a584971688010fab1600d9864d0a73083 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -20,10 +20,12 @@
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/tab_contents/test_tab_contents.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/common/referrer.h"
+#include "content/public/browser/navigation_controller.h"
#include "content/test/test_browser_thread.h"
+#include "content/test/web_contents_tester.h"
#include "googleurl/src/gurl.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -31,6 +33,7 @@
using ::testing::Return;
using ::testing::StrictMock;
using content::BrowserThread;
+using content::WebContentsTester;
namespace safe_browsing {
namespace {
@@ -96,12 +99,13 @@ class BrowserFeatureExtractorTest : public ChromeRenderViewHostTestHarness {
type, std::string());
static int page_id = 0;
- content::RenderViewHost* rvh = contents()->pending_rvh();
+ content::RenderViewHost* rvh =
+ WebContentsTester::For(contents())->pending_rvh();
if (!rvh) {
rvh = contents()->GetRenderViewHost();
}
- contents()->ProceedWithCrossSiteNavigation();
- contents()->TestDidNavigateWithReferrer(
+ WebContentsTester::For(contents())->ProceedWithCrossSiteNavigation();
+ WebContentsTester::For(contents())->TestDidNavigateWithReferrer(
rvh, ++page_id, url,
content::Referrer(referrer, WebKit::WebReferrerPolicyDefault), type);
}
« no previous file with comments | « chrome/browser/prerender/prerender_manager.h ('k') | chrome/browser/safe_browsing/client_side_detection_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698