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

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

Issue 9323071: Use InterstitialPage through a delegate interface instead of deriving from it. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros Created 8 years, 10 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
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc (revision 120733)
+++ chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc (working copy)
@@ -8,6 +8,7 @@
#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/interstitial_page.h"
#include "content/browser/tab_contents/test_tab_contents.h"
#include "content/public/browser/navigation_entry.h"
#include "content/test/test_browser_thread.h"
@@ -32,12 +33,11 @@
: SafeBrowsingBlockingPage(service, web_contents, unsafe_resources) {
// Don't delay details at all for the unittest.
malware_details_proceed_delay_ms_ = 0;
+
+ // Don't create a view.
+ interstitial_page_->DontCreateViewForTesting();
}
- // Overriden from InterstitialPage. Don't create a view.
- virtual WebContentsView* CreateWebContentsView() {
- return NULL;
- }
};
class TestSafeBrowsingService: public SafeBrowsingService {
@@ -138,7 +138,8 @@
InterstitialPage::GetInterstitialPage(contents());
if (!interstitial)
return NULL;
- return static_cast<SafeBrowsingBlockingPage*>(interstitial);
+ return static_cast<SafeBrowsingBlockingPage*>(
+ interstitial->GetDelegateForTesting());
}
UserResponse user_response() const { return user_response_; }
@@ -146,14 +147,14 @@
static void ProceedThroughInterstitial(
SafeBrowsingBlockingPage* sb_interstitial) {
- sb_interstitial->Proceed();
+ sb_interstitial->interstitial_page_->Proceed();
// Proceed() posts a task to update the SafeBrowsingService::Client.
MessageLoop::current()->RunAllPending();
}
static void DontProceedThroughInterstitial(
SafeBrowsingBlockingPage* sb_interstitial) {
- sb_interstitial->DontProceed();
+ sb_interstitial->interstitial_page_->DontProceed();
// DontProceed() posts a task to update the SafeBrowsingService::Client.
MessageLoop::current()->RunAllPending();
}
@@ -540,8 +541,8 @@
// Simulate the user clicking "proceed" then "don't proceed" (before the
// interstitial is shown).
- sb_interstitial->Proceed();
- sb_interstitial->DontProceed();
+ sb_interstitial->interstitial_page_->Proceed();
+ sb_interstitial->interstitial_page_->DontProceed();
// Proceed() and DontProceed() post a task to update the
// SafeBrowsingService::Client.
MessageLoop::current()->RunAllPending();
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc ('k') | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698