@@ -17,8 +17,8 @@ class AndroidDeviceDebugServiceInheritor extends AndroidDeviceDebugService {
17
17
super ( < any > { deviceInfo : { identifier : "123" } } , $devicesService , $cleanupService , $errors , $logger , $androidProcessService , $staticConfig , $net , $deviceLogProvider ) ;
18
18
}
19
19
20
- public getChromeDebugUrl ( debugOptions : IDebugOptions , port : number ) : string {
21
- return super . getChromeDebugUrl ( debugOptions , port ) ;
20
+ public getChromeDebugUrl ( debugOptions : IDebugOptions , port : number , legacy ?: boolean ) : string {
21
+ return super . getChromeDebugUrl ( debugOptions , port , legacy ) ;
22
22
}
23
23
}
24
24
@@ -43,6 +43,7 @@ interface IChromeUrlTestCase {
43
43
debugOptions : IDebugOptions ;
44
44
expectedChromeUrl : string ;
45
45
scenarioName : string ;
46
+ legacy ?: boolean ;
46
47
}
47
48
48
49
describe ( "androidDeviceDebugService" , ( ) => {
@@ -55,7 +56,14 @@ describe("androidDeviceDebugService", () => {
55
56
{
56
57
scenarioName : "useBundledDevTools and useHttpUrl are not passed" ,
57
58
debugOptions : { } ,
58
- expectedChromeUrl : `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
59
+ expectedChromeUrl : `devtools://devtools/bundled/inspector.html?ws=localhost:${ expectedPort } ` ,
60
+ } ,
61
+ // legacy chrome debug url
62
+ {
63
+ scenarioName : "useBundledDevTools and useHttpUrl are not passed and using legacy chrome debug url" ,
64
+ debugOptions : { } ,
65
+ expectedChromeUrl : `chrome-devtools://devtools/bundled/inspector.html?ws=localhost:${ expectedPort } &experiments=true` ,
66
+ legacy : true
59
67
} ,
60
68
61
69
// When useBundledDevTools is true
@@ -64,23 +72,23 @@ describe("androidDeviceDebugService", () => {
64
72
debugOptions : {
65
73
useBundledDevTools : true
66
74
} ,
67
- expectedChromeUrl : `chrome- devtools://devtools/bundled/inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
75
+ expectedChromeUrl : `devtools://devtools/bundled/inspector.html?ws=localhost:${ expectedPort } ` ,
68
76
} ,
69
77
{
70
78
scenarioName : "useBundledDevTools is true and useHttpUrl is false" ,
71
79
debugOptions : {
72
80
useBundledDevTools : true ,
73
81
useHttpUrl : false
74
82
} ,
75
- expectedChromeUrl : `chrome- devtools://devtools/bundled/inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
83
+ expectedChromeUrl : `devtools://devtools/bundled/inspector.html?ws=localhost:${ expectedPort } ` ,
76
84
} ,
77
85
{
78
86
scenarioName : "useBundledDevTools is true and useHttpUrl is true" ,
79
87
debugOptions : {
80
88
useBundledDevTools : true ,
81
89
useHttpUrl : true
82
90
} ,
83
- expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
91
+ expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?ws=localhost:${ expectedPort } ` ,
84
92
} ,
85
93
86
94
// When useBundledDevTools is false
@@ -89,23 +97,23 @@ describe("androidDeviceDebugService", () => {
89
97
debugOptions : {
90
98
useBundledDevTools : false
91
99
} ,
92
- expectedChromeUrl : `chrome- devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
100
+ expectedChromeUrl : `devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?ws=localhost:${ expectedPort } ` ,
93
101
} ,
94
102
{
95
103
scenarioName : "useBundledDevTools is false and useHttpUrl is false" ,
96
104
debugOptions : {
97
105
useBundledDevTools : false ,
98
106
useHttpUrl : false
99
107
} ,
100
- expectedChromeUrl : `chrome- devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
108
+ expectedChromeUrl : `devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?ws=localhost:${ expectedPort } ` ,
101
109
} ,
102
110
{
103
111
scenarioName : "useBundledDevTools is false and useHttpUrl is true" ,
104
112
debugOptions : {
105
113
useBundledDevTools : false ,
106
114
useHttpUrl : true
107
115
} ,
108
- expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
116
+ expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?ws=localhost:${ expectedPort } ` ,
109
117
} ,
110
118
111
119
// When useBundledDevTools is not passed
@@ -114,14 +122,14 @@ describe("androidDeviceDebugService", () => {
114
122
debugOptions : {
115
123
useHttpUrl : false
116
124
} ,
117
- expectedChromeUrl : `chrome- devtools://devtools/bundled/inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
125
+ expectedChromeUrl : `devtools://devtools/bundled/inspector.html?ws=localhost:${ expectedPort } ` ,
118
126
} ,
119
127
{
120
128
scenarioName : "useBundledDevTools is not passed and useHttpUrl is true" ,
121
129
debugOptions : {
122
130
useHttpUrl : true
123
131
} ,
124
- expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
132
+ expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?ws=localhost:${ expectedPort } ` ,
125
133
} ,
126
134
127
135
// devToolsCommit tests
@@ -130,36 +138,36 @@ describe("androidDeviceDebugService", () => {
130
138
debugOptions : {
131
139
useBundledDevTools : false
132
140
} ,
133
- expectedChromeUrl : `chrome- devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
141
+ expectedChromeUrl : `devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?ws=localhost:${ expectedPort } ` ,
134
142
} ,
135
143
{
136
144
scenarioName : "devToolsCommit is disregarded when useBundledDevTools is not passed" ,
137
145
debugOptions : { } ,
138
- expectedChromeUrl : `chrome- devtools://devtools/bundled/inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
146
+ expectedChromeUrl : `devtools://devtools/bundled/inspector.html?ws=localhost:${ expectedPort } ` ,
139
147
} ,
140
148
{
141
149
scenarioName : "devToolsCommit is set to passed value when useBundledDevTools is set to false" ,
142
150
debugOptions : {
143
151
useBundledDevTools : false ,
144
152
devToolsCommit : customDevToolsCommit
145
153
} ,
146
- expectedChromeUrl : `chrome- devtools://devtools/remote/serve_file/@${ customDevToolsCommit } /inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
154
+ expectedChromeUrl : `devtools://devtools/remote/serve_file/@${ customDevToolsCommit } /inspector.html?ws=localhost:${ expectedPort } ` ,
147
155
} ,
148
156
{
149
157
scenarioName : "devToolsCommit is set to passed value when useHttpUrl is set to true" ,
150
158
debugOptions : {
151
159
useHttpUrl : true ,
152
160
devToolsCommit : customDevToolsCommit
153
161
} ,
154
- expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ customDevToolsCommit } /inspector.html?experiments=true& ws=localhost:${ expectedPort } ` ,
162
+ expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ customDevToolsCommit } /inspector.html?ws=localhost:${ expectedPort } ` ,
155
163
}
156
164
] ;
157
165
158
166
for ( const testCase of chromUrlTestCases ) {
159
167
it ( `returns correct url when ${ testCase . scenarioName } ` , ( ) => {
160
168
const testInjector = createTestInjector ( ) ;
161
169
const androidDeviceDebugService = testInjector . resolve < AndroidDeviceDebugServiceInheritor > ( AndroidDeviceDebugServiceInheritor ) ;
162
- const actualChromeUrl = androidDeviceDebugService . getChromeDebugUrl ( testCase . debugOptions , expectedPort ) ;
170
+ const actualChromeUrl = androidDeviceDebugService . getChromeDebugUrl ( testCase . debugOptions , expectedPort , testCase . legacy ) ;
163
171
assert . equal ( actualChromeUrl , testCase . expectedChromeUrl ) ;
164
172
} ) ;
165
173
}
0 commit comments