File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1941,8 +1941,12 @@ exports.defineAutoTests = function () {
1941
1941
directoryReader . readEntries ( function successRead ( entries ) {
1942
1942
expect ( entries . length ) . toBe ( 2 ) ;
1943
1943
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 ) ) ;
1946
1950
}
1947
1951
deleteEntry ( dstDir , done ) ;
1948
1952
} , failed . bind ( null , done , 'Error getting entries from: ' + transferredDirectory ) ) ;
You can’t perform that action at this time.
0 commit comments