| Index: components/test_runner/web_frame_test_client.cc
|
| diff --git a/components/test_runner/web_frame_test_client.cc b/components/test_runner/web_frame_test_client.cc
|
| index 84ca1d666e3afeaf667509802eb0f9a79977e6c0..22056d8fbb1196d3ae6327786af3a6c0f05e9b59 100644
|
| --- a/components/test_runner/web_frame_test_client.cc
|
| +++ b/components/test_runner/web_frame_test_client.cc
|
| @@ -188,12 +188,16 @@ blink::WebColorChooser* WebFrameTestClient::createColorChooser(
|
| }
|
|
|
| void WebFrameTestClient::runModalAlertDialog(const blink::WebString& message) {
|
| + if (!test_runner()->ShouldDumpJavaScriptDialogs())
|
| + return;
|
| delegate_->PrintMessage(std::string("ALERT: ") + message.utf8().data() +
|
| "\n");
|
| }
|
|
|
| bool WebFrameTestClient::runModalConfirmDialog(
|
| const blink::WebString& message) {
|
| + if (!test_runner()->ShouldDumpJavaScriptDialogs())
|
| + return true;
|
| delegate_->PrintMessage(std::string("CONFIRM: ") + message.utf8().data() +
|
| "\n");
|
| return true;
|
| @@ -203,6 +207,8 @@ bool WebFrameTestClient::runModalPromptDialog(
|
| const blink::WebString& message,
|
| const blink::WebString& default_value,
|
| blink::WebString* actual_value) {
|
| + if (!test_runner()->ShouldDumpJavaScriptDialogs())
|
| + return true;
|
| delegate_->PrintMessage(std::string("PROMPT: ") + message.utf8().data() +
|
| ", default text: " + default_value.utf8().data() +
|
| "\n");
|
| @@ -210,7 +216,8 @@ bool WebFrameTestClient::runModalPromptDialog(
|
| }
|
|
|
| bool WebFrameTestClient::runModalBeforeUnloadDialog(bool is_reload) {
|
| - delegate_->PrintMessage(std::string("CONFIRM NAVIGATION\n"));
|
| + if (test_runner()->ShouldDumpJavaScriptDialogs())
|
| + delegate_->PrintMessage(std::string("CONFIRM NAVIGATION\n"));
|
| return !test_runner()->shouldStayOnPageAfterHandlingBeforeUnload();
|
| }
|
|
|
|
|