@@ -3,6 +3,8 @@ import { Yok } from "../../lib/common/yok";
3
3
import * as stubs from "../stubs" ;
4
4
import { assert } from "chai" ;
5
5
6
+ const expectedDevToolsCommitSha = "02e6bde1bbe34e43b309d4ef774b1168d25fd024" ;
7
+
6
8
class IOSDebugServiceInheritor extends IOSDebugService {
7
9
constructor ( protected $devicesService : Mobile . IDevicesService ,
8
10
$platformService : IPlatformService ,
@@ -56,12 +58,14 @@ interface IChromeUrlTestCase {
56
58
describe ( "iOSDebugService" , ( ) => {
57
59
describe ( "getChromeDebugUrl" , ( ) => {
58
60
const expectedPort = 12345 ;
61
+ const customDevToolsCommit = "customDevToolsCommit" ;
62
+
59
63
const chromUrlTestCases : IChromeUrlTestCase [ ] = [
60
64
// Default CLI behavior:
61
65
{
62
66
scenarioName : "useBundledDevTools and useHttpUrl are not passed" ,
63
67
debugOptions : { } ,
64
- expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@02e6bde1bbe34e43b309d4ef774b1168d25fd024 /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
68
+ expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
65
69
} ,
66
70
67
71
// When useBundledDevTools is true
@@ -86,7 +90,7 @@ describe("iOSDebugService", () => {
86
90
useBundledDevTools : true ,
87
91
useHttpUrl : true
88
92
} ,
89
- expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@02e6bde1bbe34e43b309d4ef774b1168d25fd024 /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
93
+ expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
90
94
} ,
91
95
92
96
// When useBundledDevTools is false
@@ -95,23 +99,23 @@ describe("iOSDebugService", () => {
95
99
debugOptions : {
96
100
useBundledDevTools : false
97
101
} ,
98
- expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@02e6bde1bbe34e43b309d4ef774b1168d25fd024 /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
102
+ expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
99
103
} ,
100
104
{
101
105
scenarioName : "useBundledDevTools is false and useHttpUrl is false" ,
102
106
debugOptions : {
103
107
useBundledDevTools : false ,
104
108
useHttpUrl : false
105
109
} ,
106
- expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@02e6bde1bbe34e43b309d4ef774b1168d25fd024 /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
110
+ expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
107
111
} ,
108
112
{
109
113
scenarioName : "useBundledDevTools is false and useHttpUrl is true" ,
110
114
debugOptions : {
111
115
useBundledDevTools : false ,
112
116
useHttpUrl : true
113
117
} ,
114
- expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@02e6bde1bbe34e43b309d4ef774b1168d25fd024 /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
118
+ expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
115
119
} ,
116
120
117
121
// When useBundledDevTools is not passed
@@ -120,14 +124,52 @@ describe("iOSDebugService", () => {
120
124
debugOptions : {
121
125
useHttpUrl : false
122
126
} ,
123
- expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@02e6bde1bbe34e43b309d4ef774b1168d25fd024 /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
127
+ expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
124
128
} ,
125
129
{
126
130
scenarioName : "useBundledDevTools is not passed and useHttpUrl is true" ,
127
131
debugOptions : {
128
132
useHttpUrl : true
129
133
} ,
130
- expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@02e6bde1bbe34e43b309d4ef774b1168d25fd024/inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
134
+ expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
135
+ } ,
136
+
137
+ // devToolsCommit tests
138
+ {
139
+ scenarioName : "devToolsCommit defaults to ${expectedDevToolsCommitSha} and is used in result when useBundledDevTools is not passed" ,
140
+ debugOptions : { } ,
141
+ expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@${ expectedDevToolsCommitSha } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
142
+ } ,
143
+ {
144
+ scenarioName : "devToolsCommit is set to passed value when useBundledDevTools is not passed" ,
145
+ debugOptions : {
146
+ devToolsCommit : customDevToolsCommit
147
+ } ,
148
+ expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@${ customDevToolsCommit } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
149
+ } ,
150
+ {
151
+ scenarioName : "devToolsCommit is set to passed value when useBundledDevTools is set to false" ,
152
+ debugOptions : {
153
+ useBundledDevTools : false ,
154
+ devToolsCommit : customDevToolsCommit
155
+ } ,
156
+ expectedChromeUrl : `chrome-devtools://devtools/remote/serve_file/@${ customDevToolsCommit } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
157
+ } ,
158
+ {
159
+ scenarioName : "devToolsCommit is set to passed value when useHttpUrl is set to true" ,
160
+ debugOptions : {
161
+ useHttpUrl : true ,
162
+ devToolsCommit : customDevToolsCommit
163
+ } ,
164
+ expectedChromeUrl : `https://chrome-devtools-frontend.appspot.com/serve_file/@${ customDevToolsCommit } /inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
165
+ } ,
166
+ {
167
+ scenarioName : "devToolsCommit is disregarded when useBundledDevTools is set to true" ,
168
+ debugOptions : {
169
+ useBundledDevTools : true ,
170
+ devToolsCommit : customDevToolsCommit
171
+ } ,
172
+ expectedChromeUrl : `chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:${ expectedPort } ` ,
131
173
}
132
174
133
175
] ;
0 commit comments