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

Unified Diff: mojo/dart/embedder/test/dart_to_cpp_tests.cc

Issue 1411843005: Dart: Removes C++ set for closing handles on an unhandled exception. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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 | « mojo/dart/embedder/mojo_natives.cc ('k') | mojo/dart/embedder/test/run_dart_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/test/dart_to_cpp_tests.cc
diff --git a/mojo/dart/embedder/test/dart_to_cpp_tests.cc b/mojo/dart/embedder/test/dart_to_cpp_tests.cc
index 90dd1f7bd99503adfca22076ed30bcdb9d7e1ba5..4f1a88d267f12c2685a8c4e5dd9d1761dfb50232 100644
--- a/mojo/dart/embedder/test/dart_to_cpp_tests.cc
+++ b/mojo/dart/embedder/test/dart_to_cpp_tests.cc
@@ -270,8 +270,12 @@ class DartToCppTest : public testing::Test {
base::MessageLoop loop;
base::RunLoop run_loop_;
- static void UnhandledExceptionCallback(bool* exception, Dart_Handle error) {
+ static void UnhandledExceptionCallback(bool* exception,
+ int64_t* closed_handles,
+ Dart_Handle error,
+ int64_t count) {
*exception = true;
+ *closed_handles = count;
}
static bool GenerateEntropy(uint8_t* buffer, intptr_t length) {
@@ -285,6 +289,7 @@ class DartToCppTest : public testing::Test {
const char** arguments,
int arguments_count,
bool* unhandled_exception,
+ int64_t* closed_handles,
char** error) {
base::FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
@@ -305,8 +310,8 @@ class DartToCppTest : public testing::Test {
config->strict_compilation = true;
config->script_uri = path.AsUTF8Unsafe();
config->package_root = package_root.AsUTF8Unsafe();
- config->callbacks.exception =
- base::Bind(&UnhandledExceptionCallback, unhandled_exception);
+ config->callbacks.exception = base::Bind(
+ &UnhandledExceptionCallback, unhandled_exception, closed_handles);
config->entropy = GenerateEntropy;
config->handle = handle;
config->SetVmFlags(arguments, arguments_count);
@@ -334,14 +339,10 @@ class DartToCppTest : public testing::Test {
DartControllerConfig config;
char* error;
bool unhandled_exception = false;
+ int64_t closed_handles;
InitializeDartConfig(
- &config,
- test,
- dart_side_request.PassMessagePipe().release().value(),
- nullptr,
- 0,
- &unhandled_exception,
- &error);
+ &config, test, dart_side_request.PassMessagePipe().release().value(),
+ nullptr, 0, &unhandled_exception, &closed_handles, &error);
dart_thread->Start();
dart_thread->message_loop()->PostTask(FROM_HERE,
« no previous file with comments | « mojo/dart/embedder/mojo_natives.cc ('k') | mojo/dart/embedder/test/run_dart_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698