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

Unified Diff: chrome/browser/ui/webui/web_ui_browsertest.cc

Issue 7861024: Adds testing infrastructure to web_ui_browsertest to support testing HtmlDialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove inline override function declaration for clang. Created 9 years, 3 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
« no previous file with comments | « chrome/browser/ui/webui/web_ui_browsertest.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/web_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/web_ui_browsertest.cc b/chrome/browser/ui/webui/web_ui_browsertest.cc
index 3130446c876a6f39270e088ac58650d5a2cddd17..7c09b95000eb34dba5ba3346ea7598739040a915 100644
--- a/chrome/browser/ui/webui/web_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/web_ui_browsertest.cc
@@ -207,7 +207,8 @@ const char WebUIBrowserTest::kDummyURL[] = "chrome://DummyURL";
WebUIBrowserTest::WebUIBrowserTest()
: test_handler_(new WebUITestHandler()),
- libraries_preloaded_(false) {}
+ libraries_preloaded_(false),
+ override_selected_web_ui_(NULL) {}
namespace {
@@ -254,6 +255,10 @@ void WebUIBrowserTest::TearDownInProcessBrowserTestFixture() {
TestChromeWebUIFactory::RemoveFactoryOverride(GURL(kDummyURL).host());
}
+void WebUIBrowserTest::SetWebUIInstance(WebUI* web_ui) {
+ override_selected_web_ui_ = web_ui;
+}
+
WebUIMessageHandler* WebUIBrowserTest::GetMockMessageHandler() {
return NULL;
}
@@ -363,7 +368,8 @@ bool WebUIBrowserTest::RunJavascriptUsingHandler(
}
void WebUIBrowserTest::SetupHandlers() {
- WebUI* web_ui_instance =
+ WebUI* web_ui_instance = override_selected_web_ui_ ?
+ override_selected_web_ui_ :
browser()->GetSelectedTabContents()->web_ui();
ASSERT_TRUE(web_ui_instance != NULL);
web_ui_instance->set_register_callback_overwrites(true);
« no previous file with comments | « chrome/browser/ui/webui/web_ui_browsertest.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698