@@ -977,7 +977,7 @@ describe('lib/browsers/chrome', () => {
977977 } )
978978 } )
979979
980- it ( 'writes default preferences when they do not exist on disk' , ( ) => {
980+ it ( 'writes default preferences when they do not exist on disk' , async ( ) => {
981981 const outputJson = sinon . stub ( fs , 'outputJson' )
982982 const defaultPrefs = outputJson . withArgs ( '/foo/Default/Preferences' ) . resolves ( )
983983 const securePrefs = outputJson . withArgs ( '/foo/Default/Secure Preferences' ) . resolves ( )
@@ -996,27 +996,25 @@ describe('lib/browsers/chrome', () => {
996996 // Get the default preferences that should be written
997997 const defaultChromePrefs = chrome . _getDefaultChromePreferences ( )
998998
999- expect ( chrome . _writeChromePreferences ( '/foo' , originalPrefs , defaultChromePrefs ) ) . to . eventually . equal ( )
1000- . then ( ( ) => {
1001- // Should write default preferences since they don't exist on disk
1002- expect ( defaultPrefs ) . to . be . calledWith ( '/foo/Default/Preferences' , {
1003- fake_preference : {
1004- value : 'value' ,
1005- } ,
1006- } )
999+ await chrome . _writeChromePreferences ( '/foo' , originalPrefs , defaultChromePrefs )
10071000
1008- // defaultSecure is empty, so it should not be written
1009- expect ( securePrefs ) . to . not . be . called
1010-
1011- expect ( statePrefs ) . to . be . calledWith ( '/foo/Local State' , {
1012- fake_local_state : {
1013- value : 'value' ,
1014- } ,
1015- } )
1001+ // Should write default preferences since they don't exist on disk
1002+ expect ( defaultPrefs ) . to . be . calledWith ( '/foo/Default/Preferences' , {
1003+ fake_preference : {
1004+ value : 'value' ,
1005+ } ,
10161006 } )
1017- . finally ( ( ) => {
1018- mockDefaultPrefs . restore ( )
1007+
1008+ // defaultSecure is empty, so it should not be written
1009+ expect ( securePrefs ) . to . not . be . called
1010+
1011+ expect ( statePrefs ) . to . be . calledWith ( '/foo/Local State' , {
1012+ fake_local_state : {
1013+ value : 'value' ,
1014+ } ,
10191015 } )
1016+
1017+ mockDefaultPrefs . restore ( )
10201018 } )
10211019 } )
10221020
0 commit comments