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

Unified Diff: mojo/dart/embedder/test/validation_unittest.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/test/run_dart_tests.cc ('k') | mojo/dart/test/unhandled_exception_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/test/validation_unittest.cc
diff --git a/mojo/dart/embedder/test/validation_unittest.cc b/mojo/dart/embedder/test/validation_unittest.cc
index 1fde4d6fe2d355f24343c89ded5938dfd9e3ae7d..3fdae1458f65b92135d8387b21259c37f8b966a2 100644
--- a/mojo/dart/embedder/test/validation_unittest.cc
+++ b/mojo/dart/embedder/test/validation_unittest.cc
@@ -40,8 +40,12 @@ bool GenerateEntropy(uint8_t* buffer, intptr_t length) {
return true;
}
-void ExceptionCallback(bool* exception, Dart_Handle error) {
+void ExceptionCallback(bool* exception,
+ int64_t* closed_handles,
+ Dart_Handle error,
+ int64_t count) {
*exception = true;
+ *closed_handles = count;
}
// Enumerates files inside |path| and collects all data needed to run
@@ -118,6 +122,7 @@ void RunTest(const std::string& test) {
char* error = NULL;
bool unhandled_exception = false;
+ int64_t closed_handles = 0;
DartControllerConfig config;
// Run with strict compilation even in Release mode so that ASAN testing gets
// coverage of Dart asserts, type-checking, etc.
@@ -125,7 +130,7 @@ void RunTest(const std::string& test) {
config.script_uri = path.value();
config.package_root = package_root.AsUTF8Unsafe();
config.callbacks.exception =
- base::Bind(&ExceptionCallback, &unhandled_exception);
+ base::Bind(&ExceptionCallback, &unhandled_exception, &closed_handles);
config.entropy = GenerateEntropy;
config.SetVmFlags(nullptr, 0);
config.error = &error;
@@ -134,6 +139,7 @@ void RunTest(const std::string& test) {
bool success = DartController::RunSingleDartScript(config);
EXPECT_TRUE(success) << error;
EXPECT_FALSE(unhandled_exception);
+ EXPECT_EQ(closed_handles, 0);
}
TEST(DartTest, validation) {
« no previous file with comments | « mojo/dart/embedder/test/run_dart_tests.cc ('k') | mojo/dart/test/unhandled_exception_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698