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

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

Issue 1545483003: Dart: Reorganize files (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix build file Created 5 years 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/dart_test.h ('k') | mojo/dart/embedder/test/dart_to_cpp.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/test/dart_test.cc
diff --git a/mojo/dart/embedder/test/dart_test.cc b/mojo/dart/embedder/test/dart_test.cc
deleted file mode 100644
index 4fe4651e02e1dd9a059f63afef02b3be114b5ad3..0000000000000000000000000000000000000000
--- a/mojo/dart/embedder/test/dart_test.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/dart/embedder/test/dart_test.h"
-
-#include "base/bind.h"
-#include "base/files/file_path.h"
-#include "base/path_service.h"
-#include "base/rand_util.h"
-#include "mojo/dart/embedder/dart_controller.h"
-#include "mojo/public/c/system/types.h"
-#include "mojo/public/cpp/environment/environment.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace mojo {
-namespace dart {
-
-void DartTest::RunDartTest(const base::FilePath& path,
- const std::vector<std::string>& script_arguments,
- bool compile_all,
- bool expect_unhandled_exception,
- int expected_unclosed_handles) {
- // Grab the C string pointer.
- std::vector<const char*> script_arguments_c_str;
- for (size_t i = 0; i < script_arguments.size(); i++) {
- script_arguments_c_str.push_back(script_arguments[i].c_str());
- }
- DCHECK(script_arguments.size() == script_arguments_c_str.size());
-
- // Setup the package root.
- base::FilePath package_root;
- PathService::Get(base::DIR_EXE, &package_root);
- package_root = package_root.AppendASCII("gen")
- .AppendASCII("dart-pkg")
- .AppendASCII("packages");
-
- char* error = nullptr;
- 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.
- config.strict_compilation = true;
- config.compile_all = compile_all;
- config.script_uri = path.AsUTF8Unsafe();
- config.package_root = package_root.AsUTF8Unsafe();
- config.callbacks.exception =
- base::Bind(&ExceptionCallback, &unhandled_exception, &closed_handles);
- config.entropy = GenerateEntropy;
- config.error = &error;
-
- if (script_arguments_c_str.size() > 0) {
- config.SetScriptFlags(script_arguments_c_str.data(),
- script_arguments_c_str.size());
- }
-
- bool success = DartController::RunDartScript(config);
- EXPECT_TRUE(success) << error;
- EXPECT_EQ(expect_unhandled_exception, unhandled_exception);
- EXPECT_EQ(expected_unclosed_handles, closed_handles);
-}
-
-} // namespace dart
-} // namespace mojo
« no previous file with comments | « mojo/dart/embedder/test/dart_test.h ('k') | mojo/dart/embedder/test/dart_to_cpp.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698