@@ -39,7 +39,6 @@ define(function (require, exports, module) {
39
39
LiveDevelopment ,
40
40
LiveDevServerManager ,
41
41
DOMAgent ,
42
- Inspector ,
43
42
DocumentManager ,
44
43
ProjectManager ;
45
44
@@ -69,21 +68,22 @@ define(function (require, exports, module) {
69
68
var localText ,
70
69
browserText ;
71
70
72
- //verify we aren 't currently connected
73
- expect ( Inspector . connected ( ) ) . toBeFalsy ( ) ;
71
+ //verify live dev isn 't currently active
72
+ expect ( LiveDevelopment . status ) . toBe ( LiveDevelopment . STATUS_INACTIVE ) ;
74
73
75
74
runs ( function ( ) {
76
75
waitsForDone ( SpecRunnerUtils . openProjectFiles ( [ htmlFile ] ) , "SpecRunnerUtils.openProjectFiles" ) ;
77
76
} ) ;
78
77
79
- //start the connection
78
+ //start live dev
80
79
runs ( function ( ) {
81
80
LiveDevelopment . open ( ) ;
82
81
} ) ;
83
- waitsFor ( function ( ) { return Inspector . connected ( ) ; } , "Waiting for browser" , 10000 ) ;
84
82
85
83
// Wait for the file and its stylesheets to fully load (and be communicated back).
86
- waits ( 1000 ) ;
84
+ waitsFor ( function ( ) {
85
+ return ( LiveDevelopment . status === LiveDevelopment . STATUS_ACTIVE ) ;
86
+ } , "Waiting for browser to become active" , 10000 ) ;
87
87
88
88
runs ( function ( ) {
89
89
waitsForDone ( SpecRunnerUtils . openProjectFiles ( [ cssFile ] ) , "SpecRunnerUtils.openProjectFiles" ) ;
@@ -116,7 +116,7 @@ define(function (require, exports, module) {
116
116
expect ( fixSpaces ( browserText ) ) . toBe ( fixSpaces ( localText ) ) ;
117
117
118
118
var doc = DocumentManager . getOpenDocumentForPath ( testPath + "/" + htmlFile ) ;
119
- // expect(isOpenInBrowser(doc, LiveDevelopment.agents)).toBeTruthy();
119
+ expect ( isOpenInBrowser ( doc , LiveDevelopment . agents ) ) . toBeTruthy ( ) ;
120
120
} ) ;
121
121
}
122
122
@@ -133,7 +133,6 @@ define(function (require, exports, module) {
133
133
LiveDevelopment = testWindow . brackets . test . LiveDevelopment ;
134
134
LiveDevServerManager = testWindow . brackets . test . LiveDevServerManager ;
135
135
DOMAgent = testWindow . brackets . test . DOMAgent ;
136
- Inspector = testWindow . brackets . test . Inspector ;
137
136
DocumentManager = testWindow . brackets . test . DocumentManager ;
138
137
CommandManager = testWindow . brackets . test . CommandManager ;
139
138
Commands = testWindow . brackets . test . Commands ;
@@ -150,56 +149,60 @@ define(function (require, exports, module) {
150
149
LiveDevelopment . close ( ) ;
151
150
} ) ;
152
151
153
- waitsFor ( function ( ) { return ! Inspector . connected ( ) ; } , "Waiting to close inspector" , 10000 ) ;
152
+ waitsFor ( function ( ) {
153
+ return ( LiveDevelopment . status === LiveDevelopment . STATUS_INACTIVE ) ;
154
+ } , "Waiting for browser to become inactive" , 10000 ) ;
154
155
155
156
SpecRunnerUtils . closeTestWindow ( ) ;
156
157
} ) ;
157
158
158
159
it ( "should establish a browser connection for an opened html file" , function ( ) {
159
- //verify we aren 't currently connected
160
- expect ( Inspector . connected ( ) ) . toBeFalsy ( ) ;
160
+ //verify live dev isn 't currently active
161
+ expect ( LiveDevelopment . status ) . toBe ( LiveDevelopment . STATUS_INACTIVE ) ;
161
162
162
163
//open a file
163
164
runs ( function ( ) {
164
165
waitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "simple1.html" ] ) , "SpecRunnerUtils.openProjectFiles" ) ;
165
166
} ) ;
166
167
167
- //start the connection
168
+ //start live dev
168
169
runs ( function ( ) {
169
170
LiveDevelopment . open ( ) ;
170
171
} ) ;
171
- waitsFor ( function ( ) { return Inspector . connected ( ) ; } , "Waiting for browser" , 10000 ) ;
172
+ waitsFor ( function ( ) {
173
+ return ( LiveDevelopment . status === LiveDevelopment . STATUS_ACTIVE ) ;
174
+ } , "Waiting for browser to become active" , 10000 ) ;
172
175
173
176
runs ( function ( ) {
174
- expect ( Inspector . connected ( ) ) . toBeTruthy ( ) ;
177
+ expect ( LiveDevelopment . status ) . toBe ( LiveDevelopment . STATUS_ACTIVE ) ;
175
178
176
179
var doc = DocumentManager . getOpenDocumentForPath ( testPath + "/simple1.html" ) ;
177
- // expect(isOpenInBrowser(doc, LiveDevelopment.agents)).toBeTruthy();
180
+ expect ( isOpenInBrowser ( doc , LiveDevelopment . agents ) ) . toBeTruthy ( ) ;
178
181
} ) ;
179
182
180
- // Let things settle down before trying to close the connection .
183
+ // Let things settle down before trying to stop live dev .
181
184
waits ( 1000 ) ;
182
185
} ) ;
183
186
184
187
it ( "should should not start a browser connection for an opened css file" , function ( ) {
185
- //verify we aren 't currently connected
186
- expect ( Inspector . connected ( ) ) . toBeFalsy ( ) ;
188
+ //verify live dev isn 't currently active
189
+ expect ( LiveDevelopment . status ) . toBe ( LiveDevelopment . STATUS_INACTIVE ) ;
187
190
188
191
//open a file
189
192
runs ( function ( ) {
190
193
waitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "simple1.css" ] ) , "SpecRunnerUtils.openProjectFiles" ) ;
191
194
} ) ;
192
195
193
- //start the connection
196
+ //start live dev
194
197
runs ( function ( ) {
195
198
LiveDevelopment . open ( ) ;
196
199
} ) ;
197
200
198
- //we just need to wait an arbitrary time since we can't check for the connection to be true
201
+ //need to wait an arbitrary time since we can't check for live dev to be active
199
202
waits ( 1000 ) ;
200
203
201
204
runs ( function ( ) {
202
- expect ( Inspector . connected ( ) ) . toBeFalsy ( ) ;
205
+ expect ( LiveDevelopment . status ) . toBe ( LiveDevelopment . STATUS_INACTIVE ) ;
203
206
204
207
var doc = DocumentManager . getOpenDocumentForPath ( testPath + "/simple1.css" ) ;
205
208
expect ( isOpenInBrowser ( doc , LiveDevelopment . agents ) ) . toBeFalsy ( ) ;
@@ -218,8 +221,8 @@ define(function (require, exports, module) {
218
221
var localText ,
219
222
browserText ;
220
223
221
- //verify we aren 't currently connected
222
- expect ( Inspector . connected ( ) ) . toBeFalsy ( ) ;
224
+ //verify live dev isn 't currently active
225
+ expect ( LiveDevelopment . status ) . toBe ( LiveDevelopment . STATUS_INACTIVE ) ;
223
226
224
227
var cssOpened = false ;
225
228
runs ( function ( ) {
@@ -242,7 +245,7 @@ define(function (require, exports, module) {
242
245
waitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "simple1.css" , "simple1.html" ] ) , "SpecRunnerUtils.openProjectFiles" ) ;
243
246
} ) ;
244
247
245
- //start the connection
248
+ //start live dev
246
249
var liveDoc ;
247
250
runs ( function ( ) {
248
251
LiveDevelopment . open ( ) ;
@@ -275,8 +278,8 @@ define(function (require, exports, module) {
275
278
browserHtmlText ,
276
279
htmlDoc ;
277
280
278
- // verify we aren 't currently connected
279
- expect ( Inspector . connected ( ) ) . toBeFalsy ( ) ;
281
+ //verify live dev isn 't currently active
282
+ expect ( LiveDevelopment . status ) . toBe ( LiveDevelopment . STATUS_INACTIVE ) ;
280
283
281
284
var cssOpened = false ;
282
285
runs ( function ( ) {
@@ -299,15 +302,15 @@ define(function (require, exports, module) {
299
302
waitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "simple1.html" ] ) , "SpecRunnerUtils.openProjectFiles" ) ;
300
303
} ) ;
301
304
302
- // Modify some text in test file before starting live connection
305
+ // Modify some text in test file before starting live dev
303
306
runs ( function ( ) {
304
307
htmlDoc = DocumentManager . getCurrentDocument ( ) ;
305
308
origHtmlText = htmlDoc . getText ( ) ;
306
309
updatedHtmlText = origHtmlText . replace ( "Brackets is" , "Live Preview in Brackets is" ) ;
307
310
htmlDoc . setText ( updatedHtmlText ) ;
308
311
} ) ;
309
312
310
- // start the connection
313
+ // start live dev
311
314
var liveDoc , liveHtmlDoc ;
312
315
runs ( function ( ) {
313
316
waitsForDone ( LiveDevelopment . open ( ) , "LiveDevelopment.open()" , 2000 ) ;
0 commit comments