forked from mirrors/gecko-dev
		
	Bug 1884216 - Fix test_dom_quota_try.js to deal with different number of errors in nightly builds; r=dom-storage-reviewers,asuth
The error propagation during temporary storage initialization is a bit different in nightly builds due to the use of OK_IN_NIGHTLY_PROPAGATE_IN_OTHERS macro. This patch also fixes the case when logging to telemetry is disabled completely. Differential Revision: https://phabricator.services.mozilla.com/D203965
This commit is contained in:
		
							parent
							
								
									d748d02371
								
							
						
					
					
						commit
						1830746011
					
				
					 1 changed files with 26 additions and 4 deletions
				
			
		|  | @ -3,6 +3,10 @@ | ||||||
|  * http://creativecommons.org/publicdomain/zero/1.0/
 |  * http://creativecommons.org/publicdomain/zero/1.0/
 | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | const { AppConstants } = ChromeUtils.importESModule( | ||||||
|  |   "resource://gre/modules/AppConstants.sys.mjs" | ||||||
|  | ); | ||||||
|  | 
 | ||||||
| const { TelemetryTestUtils } = ChromeUtils.importESModule( | const { TelemetryTestUtils } = ChromeUtils.importESModule( | ||||||
|   "resource://testing-common/TelemetryTestUtils.sys.mjs" |   "resource://testing-common/TelemetryTestUtils.sys.mjs" | ||||||
| ); | ); | ||||||
|  | @ -73,9 +77,25 @@ const testcases = [ | ||||||
|       await requestFinished(request); |       await requestFinished(request); | ||||||
|     }, |     }, | ||||||
|     initFunction: initTemporaryStorage, |     initFunction: initTemporaryStorage, | ||||||
|     expectedNumberOfEvents: { |     getExpectedNumberOfEvents() { | ||||||
|  |       if (AppConstants.EARLY_BETA_OR_EARLIER || AppConstants.DEBUG) { | ||||||
|  |         if (AppConstants.NIGHTLY_BUILD) { | ||||||
|  |           return { | ||||||
|             initFailure: 9, |             initFailure: 9, | ||||||
|             initSuccess: 0, |             initSuccess: 0, | ||||||
|  |           }; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         return { | ||||||
|  |           initFailure: 14, | ||||||
|  |           initSuccess: 0, | ||||||
|  |         }; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       return { | ||||||
|  |         initFailure: 0, | ||||||
|  |         initSuccess: 0, | ||||||
|  |       }; | ||||||
|     }, |     }, | ||||||
|     async cleanup() { |     async cleanup() { | ||||||
|       const request = clear(); |       const request = clear(); | ||||||
|  | @ -144,7 +164,9 @@ async function testSteps() { | ||||||
|         ok(!expectedInitResult, msg); |         ok(!expectedInitResult, msg); | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       const expectedNumberOfEventsObject = testcase.expectedNumberOfEvents; |       const expectedNumberOfEventsObject = testcase.getExpectedNumberOfEvents | ||||||
|  |         ? testcase.getExpectedNumberOfEvents() | ||||||
|  |         : testcase.expectedNumberOfEvents; | ||||||
| 
 | 
 | ||||||
|       const expectedNumberOfEvents = expectedInitResult |       const expectedNumberOfEvents = expectedInitResult | ||||||
|         ? expectedNumberOfEventsObject.initSuccess |         ? expectedNumberOfEventsObject.initSuccess | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Jan Varga
						Jan Varga