| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/libplatform/libplatform.h" | 5 #include "include/libplatform/libplatform.h" |
| 6 #include "src/isolate-inl.h" |
| 6 #include "test/compiler-unittests/compiler-unittests.h" | 7 #include "test/compiler-unittests/compiler-unittests.h" |
| 7 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 8 | 9 |
| 9 using testing::IsNull; | 10 using testing::IsNull; |
| 10 using testing::NotNull; | 11 using testing::NotNull; |
| 11 | 12 |
| 12 namespace v8 { | 13 namespace v8 { |
| 13 namespace internal { | 14 namespace internal { |
| 14 namespace compiler { | 15 namespace compiler { |
| 15 | 16 |
| 16 // static | 17 // static |
| 17 v8::Isolate* CompilerTest::isolate_ = NULL; | 18 v8::Isolate* CompilerTest::isolate_ = NULL; |
| 18 | 19 |
| 19 | 20 |
| 20 CompilerTest::CompilerTest() | 21 CompilerTest::CompilerTest() |
| 21 : isolate_scope_(isolate_), | 22 : isolate_scope_(isolate_), |
| 22 handle_scope_(isolate_), | 23 handle_scope_(isolate_), |
| 23 context_scope_(v8::Context::New(isolate_)), | 24 context_scope_(v8::Context::New(isolate_)), |
| 24 zone_(isolate()) {} | 25 zone_(isolate()) {} |
| 25 | 26 |
| 26 | 27 |
| 27 CompilerTest::~CompilerTest() {} | 28 CompilerTest::~CompilerTest() {} |
| 28 | 29 |
| 29 | 30 |
| 31 Factory* CompilerTest::factory() const { return isolate()->factory(); } |
| 32 |
| 33 |
| 30 // static | 34 // static |
| 31 void CompilerTest::SetUpTestCase() { | 35 void CompilerTest::SetUpTestCase() { |
| 32 Test::SetUpTestCase(); | 36 Test::SetUpTestCase(); |
| 33 EXPECT_THAT(isolate_, IsNull()); | 37 EXPECT_THAT(isolate_, IsNull()); |
| 34 isolate_ = v8::Isolate::New(); | 38 isolate_ = v8::Isolate::New(); |
| 35 ASSERT_THAT(isolate_, NotNull()); | 39 ASSERT_THAT(isolate_, NotNull()); |
| 36 } | 40 } |
| 37 | 41 |
| 38 | 42 |
| 39 // static | 43 // static |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 81 |
| 78 } | 82 } |
| 79 | 83 |
| 80 | 84 |
| 81 int main(int argc, char** argv) { | 85 int main(int argc, char** argv) { |
| 82 testing::InitGoogleMock(&argc, argv); | 86 testing::InitGoogleMock(&argc, argv); |
| 83 testing::AddGlobalTestEnvironment(new CompilerTestEnvironment); | 87 testing::AddGlobalTestEnvironment(new CompilerTestEnvironment); |
| 84 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 88 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
| 85 return RUN_ALL_TESTS(); | 89 return RUN_ALL_TESTS(); |
| 86 } | 90 } |
| OLD | NEW |