forked from mirrors/gecko-dev
		
	 745b772897
			
		
	
	
		745b772897
		
	
	
	
	
		
			
			Automatic update from web-platform-tests
Replace some "promise_rejects(t, 'SomeDOMError', stuff)" calls with promise_rejects_dom.
This diff was generated by running:
  find . -type f -print0 | xargs -0 perl -pi -e "BEGIN { \$/ = undef; } s/promise_rejects\(([ \n]*[a-zA-Z_]+[ \n]*,[ \n]*)([\"'][A-Za-z_]*[\"']) *(, *.)/promise_rejects_dom(\1\2\3/gs"
in bash (doesn't work in tcsh, due to the $ inside "").
--
wpt-commits: b7f2dd315a8d84ce786f6336510ee51423011009
wpt-pr: 21600
		
	
			
		
			
				
	
	
		
			39 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE html>
 | |
| <meta charset="utf-8">
 | |
| <title>GeolocationSensor.read() Test</title>
 | |
| <link rel="author" title="Intel" href="http://www.intel.com">
 | |
| <link rel="help" href="https://wicg.github.io/geolocation-sensor/">
 | |
| <script src="/resources/testharness.js"></script>
 | |
| <script src="/resources/testharnessreport.js"></script>
 | |
| <script>
 | |
| const properties = [
 | |
|   'timestamp',
 | |
|   'latitude',
 | |
|   'longitude',
 | |
|   'altitude',
 | |
|   'accuracy',
 | |
|   'altitudeAccuracy',
 | |
|   'heading',
 | |
|   'speed'
 | |
| ];
 | |
| 
 | |
| promise_test(async t => {
 | |
|   const geo = await GeolocationSensor.read({ signal: null });
 | |
|   assert_not_equals(geo.timestamp, null);
 | |
|   properties.forEach(property => assert_own_property(geo, property));
 | |
| }, "Test that read() method resolves with valid reading when signal is null");
 | |
| 
 | |
| promise_test(async t => {
 | |
|   const geo = await GeolocationSensor.read();
 | |
|   assert_not_equals(geo.timestamp, null);
 | |
|   properties.forEach(property => assert_own_property(geo, property));
 | |
| }, "Test that read() method resolves with valid reading");
 | |
| 
 | |
| promise_test(async t => {
 | |
|   const controller = new AbortController();
 | |
|   const signal = controller.signal;
 | |
|   controller.abort();
 | |
| 
 | |
|   await promise_rejects_dom(t, 'AbortError', GeolocationSensor.read({ signal }));
 | |
| }, "Test that read() method rejects 'AbortError' if signal's aborted flag is set");
 | |
| </script>
 |