| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ad3a164 commit ab1a4eb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -107,6 +107,7 @@ class NodeTestFixture : public ::testing::Test { | |||
| 107 | 107 | void TearDown() override { | |
| 108 | 108 | isolate_->Exit(); | |
| 109 | 109 | isolate_->Dispose(); | |
| 110 | + platform->DrainTasks(isolate_); | ||
| 110 | 111 | platform->UnregisterIsolate(isolate_); | |
| 111 | 112 | isolate_ = nullptr; | |
| 112 | 113 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,6 +88,19 @@ TEST_F(EnvironmentTest, MultipleEnvironmentsPerIsolate) { | |||
| 88 | 88 | EXPECT_TRUE(called_cb_2); | |
| 89 | 89 | } | |
| 90 | 90 | ||
| 91 | + TEST_F(EnvironmentTest, NoEnvironmentSanity) { | ||
| 92 | + const v8::HandleScope handle_scope(isolate_); | ||
| 93 | + v8::Local<v8::Context> context = v8::Context::New(isolate_); | ||
| 94 | + EXPECT_EQ(node::Environment::GetCurrent(context), nullptr); | ||
| 95 | + EXPECT_EQ(node::GetCurrentEnvironment(context), nullptr); | ||
| 96 | + EXPECT_EQ(node::Environment::GetCurrent(isolate_), nullptr); | ||
| 97 | + | ||
| 98 | + v8::Context::Scope context_scope(context); | ||
| 99 | + EXPECT_EQ(node::Environment::GetCurrent(context), nullptr); | ||
| 100 | + EXPECT_EQ(node::GetCurrentEnvironment(context), nullptr); | ||
| 101 | + EXPECT_EQ(node::Environment::GetCurrent(isolate_), nullptr); | ||
| 102 | + } | ||
| 103 | + | ||
| 91 | 104 | TEST_F(EnvironmentTest, NonNodeJSContext) { | |
| 92 | 105 | const v8::HandleScope handle_scope(isolate_); | |
| 93 | 106 | const Argv argv; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments