Skip to content

Commit 229c727

Browse files
authored
tests: devtools with loopback host (#6013)
1 parent ad1ff64 commit 229c727

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

test/services/android-device-debug-service.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe("androidDeviceDebugService", () => {
7272
{
7373
scenarioName: "useBundledDevTools and useHttpUrl are not passed",
7474
debugOptions: {},
75-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
75+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
7676
},
7777

7878
// When useBundledDevTools is true
@@ -81,23 +81,23 @@ describe("androidDeviceDebugService", () => {
8181
debugOptions: {
8282
useBundledDevTools: true,
8383
},
84-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
84+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
8585
},
8686
{
8787
scenarioName: "useBundledDevTools is true and useHttpUrl is false",
8888
debugOptions: {
8989
useBundledDevTools: true,
9090
useHttpUrl: false,
9191
},
92-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
92+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
9393
},
9494
{
9595
scenarioName: "useBundledDevTools is true and useHttpUrl is true",
9696
debugOptions: {
9797
useBundledDevTools: true,
9898
useHttpUrl: true,
9999
},
100-
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
100+
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
101101
},
102102

103103
// When useBundledDevTools is false
@@ -107,23 +107,23 @@ describe("androidDeviceDebugService", () => {
107107
debugOptions: {
108108
useBundledDevTools: false,
109109
},
110-
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
110+
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
111111
},
112112
{
113113
scenarioName: "useBundledDevTools is false and useHttpUrl is false",
114114
debugOptions: {
115115
useBundledDevTools: false,
116116
useHttpUrl: false,
117117
},
118-
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
118+
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
119119
},
120120
{
121121
scenarioName: "useBundledDevTools is false and useHttpUrl is true",
122122
debugOptions: {
123123
useBundledDevTools: false,
124124
useHttpUrl: true,
125125
},
126-
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
126+
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
127127
},
128128

129129
// When useBundledDevTools is not passed
@@ -133,14 +133,14 @@ describe("androidDeviceDebugService", () => {
133133
debugOptions: {
134134
useHttpUrl: false,
135135
},
136-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
136+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
137137
},
138138
{
139139
scenarioName: "useBundledDevTools is not passed and useHttpUrl is true",
140140
debugOptions: {
141141
useHttpUrl: true,
142142
},
143-
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
143+
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
144144
},
145145

146146
// devToolsCommit tests
@@ -150,13 +150,13 @@ describe("androidDeviceDebugService", () => {
150150
debugOptions: {
151151
useBundledDevTools: false,
152152
},
153-
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
153+
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
154154
},
155155
{
156156
scenarioName:
157157
"devToolsCommit is disregarded when useBundledDevTools is not passed",
158158
debugOptions: {},
159-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
159+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
160160
},
161161
{
162162
scenarioName:
@@ -165,7 +165,7 @@ describe("androidDeviceDebugService", () => {
165165
useBundledDevTools: false,
166166
devToolsCommit: customDevToolsCommit,
167167
},
168-
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?ws=localhost:${expectedPort}`,
168+
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?ws=127.0.0.1:${expectedPort}`,
169169
},
170170
{
171171
scenarioName:
@@ -174,7 +174,7 @@ describe("androidDeviceDebugService", () => {
174174
useHttpUrl: true,
175175
devToolsCommit: customDevToolsCommit,
176176
},
177-
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${customDevToolsCommit}/inspector.html?ws=localhost:${expectedPort}`,
177+
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${customDevToolsCommit}/inspector.html?ws=127.0.0.1:${expectedPort}`,
178178
},
179179
];
180180

test/services/ios-device-debug-service.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe("iOSDeviceDebugService", () => {
9797
{
9898
scenarioName: "useBundledDevTools and useHttpUrl are not passed",
9999
debugOptions: {},
100-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
100+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
101101
},
102102

103103
// When useBundledDevTools is true
@@ -106,23 +106,23 @@ describe("iOSDeviceDebugService", () => {
106106
debugOptions: {
107107
useBundledDevTools: true,
108108
},
109-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
109+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
110110
},
111111
{
112112
scenarioName: "useBundledDevTools is true and useHttpUrl is false",
113113
debugOptions: {
114114
useBundledDevTools: true,
115115
useHttpUrl: false,
116116
},
117-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
117+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
118118
},
119119
{
120120
scenarioName: "useBundledDevTools is true and useHttpUrl is true",
121121
debugOptions: {
122122
useBundledDevTools: true,
123123
useHttpUrl: true,
124124
},
125-
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
125+
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
126126
},
127127

128128
// When useBundledDevTools is false
@@ -132,23 +132,23 @@ describe("iOSDeviceDebugService", () => {
132132
debugOptions: {
133133
useBundledDevTools: false,
134134
},
135-
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
135+
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
136136
},
137137
{
138138
scenarioName: "useBundledDevTools is false and useHttpUrl is false",
139139
debugOptions: {
140140
useBundledDevTools: false,
141141
useHttpUrl: false,
142142
},
143-
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
143+
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
144144
},
145145
{
146146
scenarioName: "useBundledDevTools is false and useHttpUrl is true",
147147
debugOptions: {
148148
useBundledDevTools: false,
149149
useHttpUrl: true,
150150
},
151-
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
151+
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
152152
},
153153

154154
// When useBundledDevTools is not passed
@@ -158,14 +158,14 @@ describe("iOSDeviceDebugService", () => {
158158
debugOptions: {
159159
useHttpUrl: false,
160160
},
161-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
161+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
162162
},
163163
{
164164
scenarioName: "useBundledDevTools is not passed and useHttpUrl is true",
165165
debugOptions: {
166166
useHttpUrl: true,
167167
},
168-
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
168+
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
169169
},
170170

171171
// devToolsCommit tests
@@ -174,15 +174,15 @@ describe("iOSDeviceDebugService", () => {
174174
debugOptions: {
175175
useBundledDevTools: false,
176176
},
177-
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=localhost:${expectedPort}`,
177+
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${expectedDevToolsCommitSha}/inspector.html?ws=127.0.0.1:${expectedPort}`,
178178
},
179179
{
180180
scenarioName:
181181
"devToolsCommit is disregarded when useBundledDevTools is not passed",
182182
debugOptions: {
183183
devToolsCommit: customDevToolsCommit,
184184
},
185-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
185+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
186186
},
187187
{
188188
scenarioName:
@@ -191,7 +191,7 @@ describe("iOSDeviceDebugService", () => {
191191
useBundledDevTools: false,
192192
devToolsCommit: customDevToolsCommit,
193193
},
194-
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?ws=localhost:${expectedPort}`,
194+
expectedChromeUrl: `devtools://devtools/remote/serve_file/@${customDevToolsCommit}/inspector.html?ws=127.0.0.1:${expectedPort}`,
195195
},
196196
{
197197
scenarioName:
@@ -200,7 +200,7 @@ describe("iOSDeviceDebugService", () => {
200200
useHttpUrl: true,
201201
devToolsCommit: customDevToolsCommit,
202202
},
203-
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${customDevToolsCommit}/inspector.html?ws=localhost:${expectedPort}`,
203+
expectedChromeUrl: `https://chrome-devtools-frontend.appspot.com/serve_file/@${customDevToolsCommit}/inspector.html?ws=127.0.0.1:${expectedPort}`,
204204
},
205205
{
206206
scenarioName:
@@ -209,7 +209,7 @@ describe("iOSDeviceDebugService", () => {
209209
useBundledDevTools: true,
210210
devToolsCommit: customDevToolsCommit,
211211
},
212-
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=localhost:${expectedPort}`,
212+
expectedChromeUrl: `devtools://devtools/bundled/inspector.html?ws=127.0.0.1:${expectedPort}`,
213213
},
214214
];
215215

0 commit comments

Comments
 (0)