diff --git a/services/fxaccounts/tests/browser/browser_verify_remotetabs_notif.js b/services/fxaccounts/tests/browser/browser_verify_remotetabs_notif.js index 969e65170c11..f5946bcf9eb9 100644 --- a/services/fxaccounts/tests/browser/browser_verify_remotetabs_notif.js +++ b/services/fxaccounts/tests/browser/browser_verify_remotetabs_notif.js @@ -25,30 +25,6 @@ mjs ) ; const -l10n -= -new -Localization -( -[ -" -branding -/ -brand -. -ftl -" -" -browser -/ -accounts -. -ftl -" -] -) -; -const NOTIFICATION_CLICKED_URL = " @@ -117,66 +93,26 @@ notification " ) ; -const -[ -expectedTitle -expectedBody -] -= -await -l10n -. -formatValues +setupMockAlertsService ( -[ { -id +title : " -account -- -tabs -- +1 +Nightly +tab closed -- -remotely " -args -: -{ -closedCount -: -1 -} -} -{ -id +body : " -account -- -view -- +View recently -- closed -- tabs " } -] -) -; -setupMockAlertsService -( -{ -title -: -expectedTitle -body -: -expectedBody -} ) ; let @@ -346,66 +282,26 @@ notification " ) ; -const -[ -expectedTitle -expectedBody -] -= -await -l10n -. -formatValues +setupMockAlertsService ( -[ { -id +title : " -account -- +2 +Nightly tabs -- closed -- -remotely " -args -: -{ -closedCount -: -2 -} -} -{ -id +body : " -account -- -view -- +View recently -- closed -- tabs " } -] -) -; -setupMockAlertsService -( -{ -title -: -expectedTitle -body -: -expectedBody -} ) ; let diff --git a/services/fxaccounts/tests/xpcshell/test_commands_closetab.js b/services/fxaccounts/tests/xpcshell/test_commands_closetab.js index 3eb283af3486..f72fad170b13 100644 --- a/services/fxaccounts/tests/xpcshell/test_commands_closetab.js +++ b/services/fxaccounts/tests/xpcshell/test_commands_closetab.js @@ -32,7 +32,6 @@ mjs const { COMMAND_CLOSETAB -COMMAND_CLOSETAB_TAIL } = ChromeUtils @@ -1262,15 +1261,15 @@ verify ( ) ; -mock +closeTab . -restore +shutdown ( ) ; -closeTab +mock . -shutdown +restore ( ) ; @@ -1537,13 +1536,12 @@ length ; Assert . -ok +equal ( ensureTimerSpy . callCount -> -1 +2 ) ; mock @@ -1552,253 +1550,6 @@ verify ( ) ; -mock -. -restore -( -) -; -closeTab -. -shutdown -( -) -; -} -) -; -add_task -( -async -function -test_telemetry_on_sendCloseTabPush -( -) -{ -const -targetDevice -= -{ -id -: -" -dev1 -" -name -: -" -Device -1 -" -availableCommands -: -{ -[ -COMMAND_CLOSETAB -] -: -" -payload -" -} -} -; -const -fxai -= -FxaInternalMock -( -[ -targetDevice -] -) -; -const -commands -= -{ -_invokes -: -[ -] -invoke -( -cmd -device -payload -) -{ -this -. -_invokes -. -push -( -{ -cmd -device -payload -} -) -; -} -} -; -const -closeTab -= -new -CloseRemoteTab -( -commands -fxai -) -; -closeTab -. -_encrypt -= -( -) -= -> -" -encryptedpayload -" -; -let -now -= -Date -. -now -( -) -; -closeTab -. -now -= -( -) -= -> -now -; -closeTab -. -DELAY -= -10 -; -let -command1 -= -new -RemoteCommand -. -CloseTab -( -" -https -: -/ -/ -foo -. -bar -/ -early -" -) -; -const -store -= -await -getRemoteCommandStore -( -) -; -await -store -. -addRemoteCommandAt -( -targetDevice -. -id -command1 -now -- -15 -) -; -await -closeTab -. -flushQueue -( -) -; -now -+ -= -20 -; -await -closeTab -. -flushQueue -( -) -; -Assert -. -deepEqual -( -fxai -. -telemetry -. -_events -[ -{ -object -: -" -command -- -sent -" -method -: -COMMAND_CLOSETAB_TAIL -value -: -" -dev1 -- -san -" -extra -: -{ -flowID -: -" -1 -" -streamID -: -" -2 -" -} -} -] -) -; closeTab . shutdown