| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "test/unittests/test-isolate.h" | |
| 6 #include "testing/gmock/include/gmock/gmock.h" | |
| 7 | |
| 8 using testing::NotNull; | |
| 9 | |
| 10 namespace v8 { | |
| 11 namespace internal { | |
| 12 | |
| 13 IsolateTest::IsolateTest() : isolate_(v8::Isolate::New()) { | |
| 14 EXPECT_THAT(isolate_, NotNull()); | |
| 15 isolate_->Enter(); | |
| 16 } | |
| 17 | |
| 18 | |
| 19 IsolateTest::~IsolateTest() { | |
| 20 EXPECT_THAT(isolate_, NotNull()); | |
| 21 isolate_->Exit(); | |
| 22 isolate_->Dispose(); | |
| 23 isolate_ = NULL; | |
| 24 } | |
| 25 | |
| 26 | |
| 27 v8::Isolate* IsolateTest::isolate() const { | |
| 28 EXPECT_THAT(isolate_, NotNull()); | |
| 29 return isolate_; | |
| 30 } | |
| 31 | |
| 32 | |
| 33 TEST_F(IsolateTest, GetCurrent) { | |
| 34 EXPECT_THAT(v8::Isolate::GetCurrent(), NotNull()); | |
| 35 EXPECT_EQ(v8::Isolate::GetCurrent(), isolate()); | |
| 36 } | |
| 37 | |
| 38 } // namespace internal | |
| 39 } // namespace v8 | |
| OLD | NEW |