summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 04:13:47 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-18 04:13:47 +0000
commit01ec4ec8ef85dc181f3744fdb6fd41cab7b00018 (patch)
treee8208faaa428979491fc36130c11c6257ce2a91d /chrome/test
parentb729f1fca403a7b2424e78fe3257683637e6b1d1 (diff)
downloadchromium_src-01ec4ec8ef85dc181f3744fdb6fd41cab7b00018.zip
chromium_src-01ec4ec8ef85dc181f3744fdb6fd41cab7b00018.tar.gz
chromium_src-01ec4ec8ef85dc181f3744fdb6fd41cab7b00018.tar.bz2
Switch chrome code to use content::WebUI interface instead of WebUI concrete class. The latter will be renamed to WebUIImpl in a followup change. This completes hiding WebUI from chrome code, and now we can block it through DEPS.
BUG=98716 Review URL: https://chromiumcodereview.appspot.com/9241032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118038 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/base/test_html_dialog_observer.cc8
-rw-r--r--chrome/test/base/test_html_dialog_observer.h7
-rw-r--r--chrome/test/data/webui/certificate_viewer_ui_test-inl.h4
-rw-r--r--chrome/test/data/webui/edit_search_engine_dialog_browsertest.cc4
-rw-r--r--chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h6
5 files changed, 16 insertions, 13 deletions
diff --git a/chrome/test/base/test_html_dialog_observer.cc b/chrome/test/base/test_html_dialog_observer.cc
index b9d19bc..8948417 100644
--- a/chrome/test/base/test_html_dialog_observer.cc
+++ b/chrome/test/base/test_html_dialog_observer.cc
@@ -38,7 +38,7 @@ void TestHtmlDialogObserver::Observe(
js_injection_ready_observer_->OnJsInjectionReady(
content::Details<RenderViewHost>(details).ptr());
}
- web_ui_ = content::Source<WebUI>(source).ptr();
+ web_ui_ = content::Source<content::WebUI>(source).ptr();
registrar_.Remove(this, chrome::NOTIFICATION_HTML_DIALOG_SHOWN,
content::NotificationService::AllSources());
// Wait for navigation on the new WebUI instance to complete. This depends
@@ -50,13 +50,13 @@ void TestHtmlDialogObserver::Observe(
// navigate in this method, ensuring that this is not a race condition.
registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &web_ui_->web_contents()->GetController()));
+ &web_ui_->GetWebContents()->GetController()));
break;
case content::NOTIFICATION_LOAD_STOP:
DCHECK(web_ui_);
registrar_.Remove(this, content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
- &web_ui_->web_contents()->GetController()));
+ &web_ui_->GetWebContents()->GetController()));
done_ = true;
// If the message loop is running stop it.
if (running_) {
@@ -69,7 +69,7 @@ void TestHtmlDialogObserver::Observe(
};
}
-WebUI* TestHtmlDialogObserver::GetWebUI() {
+content::WebUI* TestHtmlDialogObserver::GetWebUI() {
if (!done_) {
EXPECT_FALSE(running_);
running_ = true;
diff --git a/chrome/test/base/test_html_dialog_observer.h b/chrome/test/base/test_html_dialog_observer.h
index a5897ad..7d2ba7c 100644
--- a/chrome/test/base/test_html_dialog_observer.h
+++ b/chrome/test/base/test_html_dialog_observer.h
@@ -11,7 +11,10 @@
#include "content/public/browser/notification_registrar.h"
class JsInjectionReadyObserver;
+
+namespace content {
class WebUI;
+}
// For browser_tests, which run on the UI thread, run a second message
// MessageLoop to detect HtmlDialog creation and quit when the constructed
@@ -27,7 +30,7 @@ class TestHtmlDialogObserver : public content::NotificationObserver {
// Waits for an HtmlDialog to be created. The WebUI instance is captured
// and the method returns it when the navigation on the dialog is complete.
- WebUI* GetWebUI();
+ content::WebUI* GetWebUI();
private:
// content::NotificationObserver:
@@ -39,7 +42,7 @@ class TestHtmlDialogObserver : public content::NotificationObserver {
// Observer to take some action when the dialog is ready for JavaScript
// injection.
JsInjectionReadyObserver* js_injection_ready_observer_;
- WebUI* web_ui_;
+ content::WebUI* web_ui_;
bool done_;
bool running_;
diff --git a/chrome/test/data/webui/certificate_viewer_ui_test-inl.h b/chrome/test/data/webui/certificate_viewer_ui_test-inl.h
index 91d67c0..a4dd83c 100644
--- a/chrome/test/data/webui/certificate_viewer_ui_test-inl.h
+++ b/chrome/test/data/webui/certificate_viewer_ui_test-inl.h
@@ -39,8 +39,8 @@ void CertificateViewerUITest::ShowCertificateViewer() {
TestHtmlDialogObserver dialog_observer(this);
::ShowCertificateViewer(browser()->window()->GetNativeHandle(), google_cert);
- WebUI* webui = dialog_observer.GetWebUI();
- webui->web_contents()->GetRenderViewHost()->SetWebUIProperty(
+ content::WebUI* webui = dialog_observer.GetWebUI();
+ webui->GetWebContents()->GetRenderViewHost()->SetWebUIProperty(
"expectedUrl", chrome::kChromeUICertificateViewerURL);
SetWebUIInstance(webui);
WebUIBrowserTest::SetUpOnMainThread();
diff --git a/chrome/test/data/webui/edit_search_engine_dialog_browsertest.cc b/chrome/test/data/webui/edit_search_engine_dialog_browsertest.cc
index 8087e5c..7c6a828 100644
--- a/chrome/test/data/webui/edit_search_engine_dialog_browsertest.cc
+++ b/chrome/test/data/webui/edit_search_engine_dialog_browsertest.cc
@@ -54,8 +54,8 @@ void EditSearchEngineDialogUITest::ShowSearchEngineDialog() {
// Now we can get the WebUI object from the observer, and make some details
// about our test available to the JavaScript.
- WebUI* webui = dialog_observer.GetWebUI();
- webui->web_contents()->GetRenderViewHost()->SetWebUIProperty(
+ content::WebUI* webui = dialog_observer.GetWebUI();
+ webui->GetWebContents()->GetRenderViewHost()->SetWebUIProperty(
"expectedUrl", chrome::kChromeUIEditSearchEngineDialogURL);
// Tell the test which WebUI instance we are dealing with and complete
diff --git a/chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h b/chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h
index 287f2e8..1723e48 100644
--- a/chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h
+++ b/chrome/test/data/webui/hung_renderer_dialog_ui_test-inl.h
@@ -41,10 +41,10 @@ void HungRendererDialogUITest::ShowHungRendererDialogInternal() {
// Now we can get the WebUI object from the observer, and make some details
// about our test available to the JavaScript.
- WebUI* webui = dialog_observer.GetWebUI();
- webui->web_contents()->GetRenderViewHost()->SetWebUIProperty(
+ content::WebUI* webui = dialog_observer.GetWebUI();
+ webui->GetWebContents()->GetRenderViewHost()->SetWebUIProperty(
"expectedUrl", chrome::kChromeUIHungRendererDialogURL);
- webui->web_contents()->GetRenderViewHost()->SetWebUIProperty(
+ webui->GetWebContents()->GetRenderViewHost()->SetWebUIProperty(
"expectedTitle", "about:blank");
// Tell the test which WebUI instance we are dealing with and complete