Skip to content

Commit 4e9279d

Browse files
danbevMylesBorins
authored andcommitted
test: remove NodeTestFixture from Env constructor
Backport-PR-URL: #19504 PR-URL: #18558 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 22b8f9f commit 4e9279d

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

test/cctest/node_test_fixture.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ class EnvironmentTestFixture : public NodeTestFixture {
100100
public:
101101
class Env {
102102
public:
103-
Env(const v8::HandleScope& handle_scope,
104-
const Argv& argv,
105-
NodeTestFixture* test_fixture) {
103+
Env(const v8::HandleScope& handle_scope, const Argv& argv) {
106104
auto isolate = handle_scope.GetIsolate();
107105
context_ = node::NewContext(isolate);
108106
CHECK(!context_.IsEmpty());

test/cctest/test_environment.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class EnvironmentTest : public EnvironmentTestFixture {
3232
TEST_F(EnvironmentTest, AtExitWithEnvironment) {
3333
const v8::HandleScope handle_scope(isolate_);
3434
const Argv argv;
35-
Env env {handle_scope, argv, this};
35+
Env env {handle_scope, argv};
3636

3737
AtExit(*env, at_exit_callback1);
3838
RunAtExit(*env);
@@ -42,7 +42,7 @@ TEST_F(EnvironmentTest, AtExitWithEnvironment) {
4242
TEST_F(EnvironmentTest, AtExitWithArgument) {
4343
const v8::HandleScope handle_scope(isolate_);
4444
const Argv argv;
45-
Env env {handle_scope, argv, this};
45+
Env env {handle_scope, argv};
4646

4747
std::string arg{"some args"};
4848
AtExit(*env, at_exit_callback1, static_cast<void*>(&arg));
@@ -53,8 +53,8 @@ TEST_F(EnvironmentTest, AtExitWithArgument) {
5353
TEST_F(EnvironmentTest, MultipleEnvironmentsPerIsolate) {
5454
const v8::HandleScope handle_scope(isolate_);
5555
const Argv argv;
56-
Env env1 {handle_scope, argv, this};
57-
Env env2 {handle_scope, argv, this};
56+
Env env1 {handle_scope, argv};
57+
Env env2 {handle_scope, argv};
5858

5959
AtExit(*env1, at_exit_callback1);
6060
AtExit(*env2, at_exit_callback2);

test/cctest/test_node_postmortem_metadata.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ TEST_F(DebugSymbolsTest, ExternalStringDataOffset) {
7070
TEST_F(DebugSymbolsTest, BaseObjectPersistentHandle) {
7171
const v8::HandleScope handle_scope(isolate_);
7272
const Argv argv;
73-
Env env{handle_scope, argv, this};
73+
Env env{handle_scope, argv};
7474

7575
v8::Local<v8::Object> object = v8::Object::New(isolate_);
7676
node::BaseObject obj(*env, object);
@@ -87,7 +87,7 @@ TEST_F(DebugSymbolsTest, BaseObjectPersistentHandle) {
8787
TEST_F(DebugSymbolsTest, EnvironmentHandleWrapQueue) {
8888
const v8::HandleScope handle_scope(isolate_);
8989
const Argv argv;
90-
Env env{handle_scope, argv, this};
90+
Env env{handle_scope, argv};
9191

9292
auto expected = reinterpret_cast<uintptr_t>((*env)->handle_wrap_queue());
9393
auto calculated = reinterpret_cast<uintptr_t>(*env) +
@@ -98,7 +98,7 @@ TEST_F(DebugSymbolsTest, EnvironmentHandleWrapQueue) {
9898
TEST_F(DebugSymbolsTest, EnvironmentReqWrapQueue) {
9999
const v8::HandleScope handle_scope(isolate_);
100100
const Argv argv;
101-
Env env{handle_scope, argv, this};
101+
Env env{handle_scope, argv};
102102

103103
auto expected = reinterpret_cast<uintptr_t>((*env)->req_wrap_queue());
104104
auto calculated = reinterpret_cast<uintptr_t>(*env) +
@@ -109,7 +109,7 @@ TEST_F(DebugSymbolsTest, EnvironmentReqWrapQueue) {
109109
TEST_F(DebugSymbolsTest, HandleWrapList) {
110110
const v8::HandleScope handle_scope(isolate_);
111111
const Argv argv;
112-
Env env{handle_scope, argv, this};
112+
Env env{handle_scope, argv};
113113

114114
uv_tcp_t handle;
115115

@@ -138,7 +138,7 @@ TEST_F(DebugSymbolsTest, HandleWrapList) {
138138
TEST_F(DebugSymbolsTest, ReqWrapList) {
139139
const v8::HandleScope handle_scope(isolate_);
140140
const Argv argv;
141-
Env env{handle_scope, argv, this};
141+
Env env{handle_scope, argv};
142142

143143
auto obj_template = v8::FunctionTemplate::New(isolate_);
144144
obj_template->InstanceTemplate()->SetInternalFieldCount(1);

0 commit comments

Comments
 (0)