| 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_);
|
| }
|
|
|