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

Unified Diff: chrome/test/base/test_html_dialog_observer.cc

Issue 8586009: Allow WebUI Tests to use preLoad in HtmlDialogUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address more comments from James. Created 9 years, 1 month 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/test/base/test_html_dialog_observer.cc
diff --git a/chrome/test/base/test_html_dialog_observer.cc b/chrome/test/base/test_html_dialog_observer.cc
index 6f51eb7d5597571016af4cf3ff34c61da86ea398..e6d14cbbde4affef963a52f370ad4a70d79cbece 100644
--- a/chrome/test/base/test_html_dialog_observer.cc
+++ b/chrome/test/base/test_html_dialog_observer.cc
@@ -5,6 +5,8 @@
#include "chrome/test/base/test_html_dialog_observer.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/test/base/js_injection_ready_observer.h"
+#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/notification_service.h"
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/tab_contents.h"
@@ -12,10 +14,11 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
-#include "chrome/test/base/ui_test_utils.h"
-TestHtmlDialogObserver::TestHtmlDialogObserver()
- : web_ui_(NULL), done_(false), running_(false) {
+TestHtmlDialogObserver::TestHtmlDialogObserver(
+ JsInjectionReadyObserver* js_injection_ready_observer)
+ : js_injection_ready_observer_(js_injection_ready_observer),
+ web_ui_(NULL), done_(false), running_(false) {
registrar_.Add(this, chrome::NOTIFICATION_HTML_DIALOG_SHOWN,
content::NotificationService::AllSources());
}
@@ -29,6 +32,10 @@ void TestHtmlDialogObserver::Observe(
const content::NotificationDetails& details) {
switch (type) {
case chrome::NOTIFICATION_HTML_DIALOG_SHOWN:
+ if (js_injection_ready_observer_) {
+ js_injection_ready_observer_->OnJsInjectionReady(
+ content::Details<RenderViewHost>(details).ptr());
+ }
web_ui_ = content::Source<WebUI>(source).ptr();
registrar_.Remove(this, chrome::NOTIFICATION_HTML_DIALOG_SHOWN,
content::NotificationService::AllSources());

Powered by Google App Engine
This is Rietveld 408576698