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

Side by Side Diff: mojo/dart/embedder/test/dart_test.h

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 unified diff | Download patch
« no previous file with comments | « mojo/dart/embedder/test/dart_finalizer_test.cc ('k') | mojo/dart/embedder/test/dart_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_DART_EMBEDDER_TEST_DART_TEST_H_
6 #define MOJO_DART_EMBEDDER_TEST_DART_TEST_H_
7
8 #include "base/bind.h"
9 #include "base/files/file_path.h"
10 #include "base/path_service.h"
11 #include "base/rand_util.h"
12 #include "mojo/dart/embedder/dart_controller.h"
13 #include "mojo/public/c/system/types.h"
14 #include "mojo/public/cpp/environment/environment.h"
15 #include "testing/gtest/include/gtest/gtest.h"
16
17 namespace mojo {
18 namespace dart {
19
20 class DartTest : public testing::Test {
21 public:
22 DartTest() {}
23
24 static void SetUpTestCase() {
25 DartController::Initialize(nullptr, true, false, nullptr, 0);
26 }
27
28 static void TearDownTestCase() {
29 DartController::Shutdown();
30 }
31
32 void RunDartTest(const base::FilePath& path,
33 const std::vector<std::string>& script_arguments,
34 bool compile_all,
35 bool expect_unhandled_exception,
36 int expected_unclosed_handles);
37
38 protected:
39 static bool GenerateEntropy(uint8_t* buffer, intptr_t length) {
40 base::RandBytes(static_cast<void*>(buffer), length);
41 return true;
42 }
43
44 static void ExceptionCallback(bool* exception,
45 int64_t* closed_handles,
46 Dart_Handle error,
47 int64_t count) {
48 EXPECT_TRUE(Dart_IsError(error));
49 *exception = true;
50 *closed_handles = count;
51 }
52 };
53
54 } // namespace dart
55 } // namespace mojo
56
57 #endif // MOJO_DART_EMBEDDER_TEST_DART_TEST_H_
OLDNEW
« no previous file with comments | « mojo/dart/embedder/test/dart_finalizer_test.cc ('k') | mojo/dart/embedder/test/dart_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698