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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_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/safe_browsing_blocking_page_unittest.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
index 07c5003661c85906c4b022df0be32f73d0a3784f..581358db748e43dba18a31f2c3ca5d9dd9c70c05 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -8,15 +8,19 @@
#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
-#include "content/browser/tab_contents/test_tab_contents.h"
#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
#include "content/test/test_browser_thread.h"
+#include "content/test/web_contents_tester.h"
using content::BrowserThread;
using content::InterstitialPage;
using content::NavigationEntry;
using content::WebContents;
+using content::WebContentsTester;
using content::WebContentsView;
static const char* kGoogleURL = "http://www.google.com/";
@@ -110,7 +114,7 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness {
}
void Navigate(const char* url, int page_id) {
- contents()->TestDidNavigate(
+ WebContentsTester::For(contents())->TestDidNavigate(
contents()->GetRenderViewHost(), page_id, GURL(url),
content::PAGE_TRANSITION_TYPED);
}
@@ -122,10 +126,13 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness {
// The pending RVH should commit for cross-site navigations.
content::RenderViewHost* rvh = is_cross_site ?
- contents()->pending_rvh() :
+ WebContentsTester::For(contents())->pending_rvh() :
contents()->GetRenderViewHost();
- contents()->TestDidNavigate(rvh, entry->GetPageID(), GURL(entry->GetURL()),
- content::PAGE_TRANSITION_TYPED);
+ WebContentsTester::For(contents())->TestDidNavigate(
+ rvh,
+ entry->GetPageID(),
+ GURL(entry->GetURL()),
+ content::PAGE_TRANSITION_TYPED);
}
void ShowInterstitial(bool is_subresource, const char* url) {
« no previous file with comments | « chrome/browser/safe_browsing/malware_details_unittest.cc ('k') | chrome/browser/sessions/tab_restore_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698