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

Unified Diff: chrome/browser/ui/browser_browsertest.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/ui/browser_browsertest.cc
===================================================================
--- chrome/browser/ui/browser_browsertest.cc (revision 120733)
+++ chrome/browser/ui/browser_browsertest.cc (working copy)
@@ -44,6 +44,7 @@
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/interstitial_page.h"
#include "content/public/browser/favicon_status.h"
+#include "content/public/browser/interstitial_page_delegate.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
@@ -153,15 +154,24 @@
// Displays "INTERSTITIAL" while the interstitial is attached.
// (InterstitialPage can be used in a test directly, but there would be no way
// to visually tell if it is showing or not.)
-class TestInterstitialPage : public InterstitialPage {
+class TestInterstitialPage : public content::InterstitialPageDelegate {
public:
- TestInterstitialPage(WebContents* tab, bool new_navigation, const GURL& url)
- : InterstitialPage(tab, new_navigation, url) { }
+ TestInterstitialPage(WebContents* tab, bool new_navigation, const GURL& url) {
+ interstitial_page_ = InterstitialPage::Create(
+ tab, new_navigation, url , this);
+ interstitial_page_->Show();
+ }
virtual ~TestInterstitialPage() { }
+ void Proceed() {
+ interstitial_page_->Proceed();
+ }
virtual std::string GetHTMLContents() OVERRIDE {
return "<h1>INTERSTITIAL</h1>";
}
+
+ private:
+ InterstitialPage* interstitial_page_; // Owns us.
};
} // namespace
@@ -1358,7 +1368,6 @@
ui_test_utils::WindowedNotificationObserver interstitial_observer(
content::NOTIFICATION_INTERSTITIAL_ATTACHED,
content::Source<WebContents>(contents));
- interstitial->Show();
interstitial_observer.Wait();
EXPECT_TRUE(contents->ShowingInterstitialPage());
« no previous file with comments | « chrome/browser/tab_contents/chrome_interstitial_page.cc ('k') | chrome/browser/ui/pdf/pdf_unsupported_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698