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

Unified Diff: components/test_runner/web_frame_test_client.cc

Issue 2496613003: Suppress text dump of JavaScript modal dialog messages in testharness.js tests (Closed)
Patch Set: Created 4 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: 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();
}

Powered by Google App Engine
This is Rietveld 408576698