@@ -65,7 +65,7 @@ define(function (require, exports, module) {
6565 require ( "test/UnitTestSuite" ) ;
6666 require ( "test/PerformanceTestSuite" ) ;
6767
68- var suite ,
68+ var selectedSuite ,
6969 params = new UrlParams ( ) ,
7070 reporter ,
7171 _nodeConnectionDeferred = new $ . Deferred ( ) ,
@@ -127,7 +127,7 @@ define(function (require, exports, module) {
127127 window . location . reload ( true ) ;
128128 } ) ;
129129
130- $ ( "#" + suite ) . closest ( "li" ) . toggleClass ( "active" , true ) ;
130+ $ ( "#" + selectedSuite ) . closest ( "li" ) . toggleClass ( "active" , true ) ;
131131
132132 AppInit . _dispatchReady ( AppInit . APP_READY ) ;
133133
@@ -200,15 +200,30 @@ define(function (require, exports, module) {
200200 ) ;
201201 } ) ;
202202
203- suite = params . get ( "suite" ) || localStorage . getItem ( "SpecRunner.suite" ) || "UnitTestSuite" ;
203+ selectedSuite = params . get ( "suite" ) || localStorage . getItem ( "SpecRunner.suite" ) || "UnitTestSuite" ;
204204
205205 // Create a top-level filter to show/hide performance and extensions tests
206- var isPerfSuite = ( suite === "PerformanceTestSuite" ) ,
207- isExtSuite = ( suite === "ExtensionTestSuite" ) ,
208- isIntegrationSuite = ( suite === "IntegrationTestSuite" ) ;
206+ var runAll = ( selectedSuite === "all" ) ,
207+ isPerfSuite = ( selectedSuite === "PerformanceTestSuite" ) ,
208+ isExtSuite = ( selectedSuite === "ExtensionTestSuite" ) ,
209+ isIntegrationSuite = ( selectedSuite === "IntegrationTestSuite" ) ,
210+ category ;
211+
212+ if ( isPerfSuite ) {
213+ category = "performance" ;
214+ } else if ( isIntegrationSuite ) {
215+ category = "integration" ;
216+ } else if ( isExtSuite ) {
217+ category = "extension" ;
218+ }
209219
210220 var topLevelFilter = function ( spec ) {
211- var suite = spec . suite ;
221+ // special case "all" suite to run unit, perf, extension, and integration tests
222+ if ( runAll ) {
223+ return true ;
224+ }
225+
226+ var currentSuite = spec . suite ;
212227
213228 // unit test suites have no category
214229 if ( ! isPerfSuite && ! isExtSuite && ! isIntegrationSuite ) {
@@ -217,38 +232,28 @@ define(function (require, exports, module) {
217232 return false ;
218233 }
219234
220- while ( suite ) {
221- if ( suite . category !== undefined ) {
235+ while ( currentSuite ) {
236+ if ( currentSuite . category !== undefined ) {
222237 // any suite in the hierarchy may specify a category
223238 return false ;
224239 }
225240
226- suite = suite . parentSuite ;
241+ currentSuite = currentSuite . parentSuite ;
227242 }
228243
229244 return true ;
230245 }
231246
232- var category ;
233-
234- if ( isPerfSuite ) {
235- category = "performance" ;
236- } else if ( isIntegrationSuite ) {
237- category = "integration" ;
238- } else {
239- category = "extension" ;
240- }
241-
242247 if ( spec . category === category ) {
243248 return true ;
244249 }
245250
246- while ( suite ) {
247- if ( suite . category === category ) {
251+ while ( currentSuite ) {
252+ if ( currentSuite . category === category ) {
248253 return true ;
249254 }
250255
251- suite = suite . parentSuite ;
256+ currentSuite = currentSuite . parentSuite ;
252257 }
253258
254259 return false ;
@@ -263,7 +268,7 @@ define(function (require, exports, module) {
263268 // configure spawned test windows to load extensions
264269 SpecRunnerUtils . setLoadExtensionsInTestWindow ( isExtSuite ) ;
265270
266- _loadExtensionTests ( suite ) . done ( function ( ) {
271+ _loadExtensionTests ( selectedSuite ) . done ( function ( ) {
267272 var jasmineEnv = jasmine . getEnv ( ) ;
268273
269274 // Initiailize unit test preferences for each spec
@@ -297,7 +302,7 @@ define(function (require, exports, module) {
297302 reporterView = new BootstrapReporterView ( document , reporter ) ;
298303
299304 // remember the suite for the next unit test window launch
300- localStorage . setItem ( "SpecRunner.suite" , suite ) ;
305+ localStorage . setItem ( "SpecRunner.suite" , selectedSuite ) ;
301306
302307 $ ( window . document ) . ready ( _documentReadyHandler ) ;
303308 } ) ;
0 commit comments