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

Unified Diff: components/test_runner/test_runner.cc

Issue 1989103006: Fix event warning crash when a listener is removed while dispatching event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: now compare against actual listener() Created 4 years, 7 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
Index: components/test_runner/test_runner.cc
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc
index 1a6aa90e4561740cd7beba026cc70f6f4ad1b3d5..8f97cadb54dc263c2ec4f315bf0b65dbf88b7db5 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -211,6 +211,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void SetDatabaseQuota(int quota);
void SetDomainRelaxationForbiddenForURLScheme(bool forbidden,
const std::string& scheme);
+ void SetDumpConsoleMessages(bool value);
void SetImagesAllowed(bool allowed);
void SetIsolatedWorldContentSecurityPolicy(int world_id,
const std::string& policy);
@@ -512,6 +513,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
.SetMethod("setDatabaseQuota", &TestRunnerBindings::SetDatabaseQuota)
.SetMethod("setDomainRelaxationForbiddenForURLScheme",
&TestRunnerBindings::SetDomainRelaxationForbiddenForURLScheme)
+ .SetMethod("setDumpConsoleMessages",
+ &TestRunnerBindings::SetDumpConsoleMessages)
.SetMethod("setIconDatabaseEnabled", &TestRunnerBindings::NotImplemented)
.SetMethod("setImagesAllowed", &TestRunnerBindings::SetImagesAllowed)
.SetMethod("setIsolatedWorldContentSecurityPolicy",
@@ -699,6 +702,11 @@ void TestRunnerBindings::SetDomainRelaxationForbiddenForURLScheme(
view_runner_->SetDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
}
+void TestRunnerBindings::SetDumpConsoleMessages(bool enabled) {
+ if (runner_)
+ runner_->SetDumpConsoleMessages(enabled);
+}
+
v8::Local<v8::Value>
TestRunnerBindings::EvaluateScriptInIsolatedWorldAndReturnValue(
int world_id, const std::string& script) {
@@ -2565,6 +2573,15 @@ void TestRunner::DumpNavigationPolicy() {
OnLayoutTestRuntimeFlagsChanged();
}
+void TestRunner::SetDumpConsoleMessages(bool value) {
+ layout_test_runtime_flags_.set_dump_console_messages(value);
+ OnLayoutTestRuntimeFlagsChanged();
+}
+
+bool TestRunner::ShouldDumpConsoleMessages() const {
+ return layout_test_runtime_flags_.dump_console_messages();
+}
+
void TestRunner::CloseWebInspector() {
delegate_->CloseDevTools();
}

Powered by Google App Engine
This is Rietveld 408576698