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