File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1941,8 +1941,12 @@ exports.defineAutoTests = function () {
19411941                                    directoryReader . readEntries ( function  successRead  ( entries )  { 
19421942                                        expect ( entries . length ) . toBe ( 2 ) ; 
19431943                                        if  ( ! isChrome )  { 
1944-                                             expect ( entries [ 0 ] . name ) . toBe ( srcDirNestedFirst ) ; 
1945-                                             expect ( entries [ 1 ] . name ) . toBe ( srcDirNestedSecond ) ; 
1944+                                             // Directory read order is undefined on some platforms, therefore we cannot assume order 
1945+                                             // So we will start with an expected list and iterate over the entries and test to see if they 
1946+                                             // are in our expectation list. When found we will remove them. At the end, our expectation list 
1947+                                             // should be empty. 
1948+                                             const  expected  =  [ srcDirNestedFirst ,  srcDirNestedSecond ] ; 
1949+                                             expect ( entries . map ( ( entry )  =>  entry . name ) ) . toEqual ( jasmine . arrayWithExactContents ( expected ) ) ; 
19461950                                        } 
19471951                                        deleteEntry ( dstDir ,  done ) ; 
19481952                                    } ,  failed . bind ( null ,  done ,  'Error getting entries from: '  +  transferredDirectory ) ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments