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

Unified Diff: components/test_runner/web_test_proxy.cc

Issue 1787743003: Remove unneeded code from WebTestProxyBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing accidental reversal of condition in RunModalBeforeUnloadDialog. Created 4 years, 9 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 | « components/test_runner/web_test_proxy.h ('k') | components/test_runner/web_test_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/web_test_proxy.cc
diff --git a/components/test_runner/web_test_proxy.cc b/components/test_runner/web_test_proxy.cc
index d6f0b671e391a87c170ece42540d523cd937612c..2db9db404915ba7294af2f13e4c9b7e383f282fd 100644
--- a/components/test_runner/web_test_proxy.cc
+++ b/components/test_runner/web_test_proxy.cc
@@ -302,8 +302,7 @@ std::string DumpAllBackForwardLists(TestInterfaces* interfaces,
}
WebTestProxyBase::WebTestProxyBase()
- : web_test_interfaces_(NULL),
- test_interfaces_(NULL),
+ : test_interfaces_(NULL),
delegate_(NULL),
web_widget_(NULL),
spellcheck_(new SpellCheckClient(this)),
@@ -313,19 +312,13 @@ WebTestProxyBase::WebTestProxyBase()
WebTestProxyBase::~WebTestProxyBase() {
test_interfaces_->WindowClosed(this);
- delegate_->OnWebTestProxyBaseDestroy(this);
}
void WebTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) {
- web_test_interfaces_ = interfaces;
test_interfaces_ = interfaces->GetTestInterfaces();
test_interfaces_->WindowOpened(this);
}
-WebTestInterfaces* WebTestProxyBase::GetInterfaces() {
- return web_test_interfaces_;
-}
-
void WebTestProxyBase::SetDelegate(WebTestDelegate* delegate) {
delegate_ = delegate;
spellcheck_->SetDelegate(delegate);
@@ -333,10 +326,6 @@ void WebTestProxyBase::SetDelegate(WebTestDelegate* delegate) {
speech_recognizer_->SetDelegate(delegate);
}
-WebTestDelegate* WebTestProxyBase::GetDelegate() {
- return delegate_;
-}
-
blink::WebView* WebTestProxyBase::GetWebView() const {
DCHECK(web_widget_);
// TestRunner does not support popup widgets. So |web_widget|_ is always a
@@ -402,6 +391,33 @@ void WebTestProxyBase::ShowValidationMessage(
base::UTF16ToUTF8(wrapped_sub_text) + "\n");
}
+void WebTestProxyBase::RunModalAlertDialog(const blink::WebString& message) {
+ delegate_->PrintMessage(std::string("ALERT: ") + message.utf8().data() +
+ "\n");
+}
+
+bool WebTestProxyBase::RunModalConfirmDialog(const blink::WebString& message) {
+ delegate_->PrintMessage(std::string("CONFIRM: ") + message.utf8().data() +
+ "\n");
+ return true;
+}
+
+bool WebTestProxyBase::RunModalPromptDialog(
+ const blink::WebString& message,
+ const blink::WebString& default_value,
+ blink::WebString* actual_value) {
+ delegate_->PrintMessage(std::string("PROMPT: ") + message.utf8().data() +
+ ", default text: " + default_value.utf8().data() +
+ "\n");
+ return true;
+}
+
+bool WebTestProxyBase::RunModalBeforeUnloadDialog(bool is_reload) {
+ delegate_->PrintMessage(std::string("CONFIRM NAVIGATION\n"));
+ return !test_interfaces_->GetTestRunner()
+ ->shouldStayOnPageAfterHandlingBeforeUnload();
+}
+
std::string WebTestProxyBase::DumpBackForwardLists() {
return DumpAllBackForwardLists(test_interfaces_, delegate_);
}
« no previous file with comments | « components/test_runner/web_test_proxy.h ('k') | components/test_runner/web_test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698