Bug 1362993 - Rewrite gBrowser.addTab() to use BrowserTestUtils.addTab(). r=florian
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Mon, 15 May 2017 21:49:50 +0200
changeset 406652 a2b7eaff126829fff66d9d84499a3a81e9a46f6a
parent 406651 08e52e63564d5fae25227c2c14555198758f345b
child 406653 c63d8286d4548cd385947dc8c4895800b1e793f2
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1362993
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1362993 - Rewrite gBrowser.addTab() to use BrowserTestUtils.addTab(). r=florian
browser/base/content/test/alerts/browser_notification_do_not_disturb.js
browser/base/content/test/alerts/browser_notification_remove_permission.js
browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js
browser/base/content/test/general/browser_aboutCertError.js
browser/base/content/test/general/browser_aboutHealthReport.js
browser/base/content/test/general/browser_aboutNetError.js
browser/base/content/test/general/browser_alltabslistener.js
browser/base/content/test/general/browser_bookmark_titles.js
browser/base/content/test/general/browser_bug1015721.js
browser/base/content/test/general/browser_bug380960.js
browser/base/content/test/general/browser_bug386835.js
browser/base/content/test/general/browser_bug406216.js
browser/base/content/test/general/browser_bug416661.js
browser/base/content/test/general/browser_bug419612.js
browser/base/content/test/general/browser_bug423833.js
browser/base/content/test/general/browser_bug431826.js
browser/base/content/test/general/browser_bug432599.js
browser/base/content/test/general/browser_bug435325.js
browser/base/content/test/general/browser_bug441778.js
browser/base/content/test/general/browser_bug462289.js
browser/base/content/test/general/browser_bug477014.js
browser/base/content/test/general/browser_bug479408.js
browser/base/content/test/general/browser_bug491431.js
browser/base/content/test/general/browser_bug495058.js
browser/base/content/test/general/browser_bug521216.js
browser/base/content/test/general/browser_bug533232.js
browser/base/content/test/general/browser_bug537013.js
browser/base/content/test/general/browser_bug553455.js
browser/base/content/test/general/browser_bug555224.js
browser/base/content/test/general/browser_bug555767.js
browser/base/content/test/general/browser_bug559991.js
browser/base/content/test/general/browser_bug561636.js
browser/base/content/test/general/browser_bug563588.js
browser/base/content/test/general/browser_bug575561.js
browser/base/content/test/general/browser_bug575830.js
browser/base/content/test/general/browser_bug577121.js
browser/base/content/test/general/browser_bug579872.js
browser/base/content/test/general/browser_bug580638.js
browser/base/content/test/general/browser_bug580956.js
browser/base/content/test/general/browser_bug581242.js
browser/base/content/test/general/browser_bug581253.js
browser/base/content/test/general/browser_bug585785.js
browser/base/content/test/general/browser_bug585830.js
browser/base/content/test/general/browser_bug592338.js
browser/base/content/test/general/browser_bug594131.js
browser/base/content/test/general/browser_bug595507.js
browser/base/content/test/general/browser_bug624734.js
browser/base/content/test/general/browser_bug655584.js
browser/base/content/test/general/browser_bug664672.js
browser/base/content/test/general/browser_bug678392.js
browser/base/content/test/general/browser_bug719271.js
browser/base/content/test/general/browser_bug749738.js
browser/base/content/test/general/browser_bug817947.js
browser/base/content/test/general/browser_clipboard.js
browser/base/content/test/general/browser_ctrlTab.js
browser/base/content/test/general/browser_discovery.js
browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js
browser/base/content/test/general/browser_double_close_tab.js
browser/base/content/test/general/browser_drag.js
browser/base/content/test/general/browser_e10s_chrome_process.js
browser/base/content/test/general/browser_e10s_switchbrowser.js
browser/base/content/test/general/browser_favicon_change.js
browser/base/content/test/general/browser_favicon_change_not_in_document.js
browser/base/content/test/general/browser_feed_discovery.js
browser/base/content/test/general/browser_findbarClose.js
browser/base/content/test/general/browser_fullscreen-window-open.js
browser/base/content/test/general/browser_gZipOfflineChild.js
browser/base/content/test/general/browser_gestureSupport.js
browser/base/content/test/general/browser_hide_removing.js
browser/base/content/test/general/browser_keywordBookmarklets.js
browser/base/content/test/general/browser_keywordSearch.js
browser/base/content/test/general/browser_keywordSearch_postData.js
browser/base/content/test/general/browser_lastAccessedTab.js
browser/base/content/test/general/browser_offlineQuotaNotification.js
browser/base/content/test/general/browser_overflowScroll.js
browser/base/content/test/general/browser_pinnedTabs.js
browser/base/content/test/general/browser_relatedTabs.js
browser/base/content/test/general/browser_removeTabsToTheEnd.js
browser/base/content/test/general/browser_restore_isAppTab.js
browser/base/content/test/general/browser_save_video_frame.js
browser/base/content/test/general/browser_selectTabAtIndex.js
browser/base/content/test/general/browser_star_hsts.js
browser/base/content/test/general/browser_subframe_favicons_not_used.js
browser/base/content/test/general/browser_tabReorder.js
browser/base/content/test/general/browser_tab_detach_restore.js
browser/base/content/test/general/browser_tab_dragdrop.js
browser/base/content/test/general/browser_tabfocus.js
browser/base/content/test/general/browser_tabs_isActive.js
browser/base/content/test/general/browser_tabs_owner.js
browser/base/content/test/general/browser_unknownContentType_title.js
browser/base/content/test/general/browser_utilityOverlay.js
browser/base/content/test/general/browser_visibleFindSelection.js
browser/base/content/test/general/browser_visibleTabs.js
browser/base/content/test/general/browser_visibleTabs_bookmarkAllPages.js
browser/base/content/test/general/browser_visibleTabs_bookmarkAllTabs.js
browser/base/content/test/general/browser_visibleTabs_contextMenu.js
browser/base/content/test/general/browser_visibleTabs_tabPreview.js
browser/base/content/test/general/browser_web_channel.js
browser/base/content/test/general/browser_windowactivation.js
browser/base/content/test/general/browser_zbug569342.js
browser/base/content/test/newtab/browser_newtab_bug1271075.js
browser/base/content/test/newtab/browser_newtab_reflow_load.js
browser/base/content/test/pageinfo/browser_pageInfo.js
browser/base/content/test/pageinfo/browser_pageinfo_image_info.js
browser/base/content/test/pageinfo/browser_pageinfo_images.js
browser/base/content/test/pageinfo/browser_pageinfo_svg_image.js
browser/base/content/test/plugins/browser_CTP_context_menu.js
browser/base/content/test/plugins/browser_CTP_data_urls.js
browser/base/content/test/plugins/browser_CTP_drag_drop.js
browser/base/content/test/plugins/browser_CTP_hide_overlay.js
browser/base/content/test/plugins/browser_CTP_iframe.js
browser/base/content/test/plugins/browser_CTP_multi_allow.js
browser/base/content/test/plugins/browser_CTP_nonplugins.js
browser/base/content/test/plugins/browser_CTP_notificationBar.js
browser/base/content/test/plugins/browser_CTP_outsideScrollArea.js
browser/base/content/test/plugins/browser_CTP_remove_navigate.js
browser/base/content/test/plugins/browser_CTP_resize.js
browser/base/content/test/plugins/browser_CTP_zoom.js
browser/base/content/test/plugins/browser_blocking.js
browser/base/content/test/plugins/browser_blocklist_content.js
browser/base/content/test/plugins/browser_bug743421.js
browser/base/content/test/plugins/browser_bug744745.js
browser/base/content/test/plugins/browser_bug787619.js
browser/base/content/test/plugins/browser_bug797677.js
browser/base/content/test/plugins/browser_bug812562.js
browser/base/content/test/plugins/browser_bug818118.js
browser/base/content/test/plugins/browser_bug820497.js
browser/base/content/test/plugins/browser_clearplugindata.js
browser/base/content/test/plugins/browser_pageInfo_plugins.js
browser/base/content/test/plugins/browser_pluginCrashCommentAndURL.js
browser/base/content/test/plugins/browser_plugin_reloading.js
browser/base/content/test/plugins/browser_pluginnotification.js
browser/base/content/test/plugins/browser_plugins_added_dynamically.js
browser/base/content/test/plugins/browser_private_clicktoplay.js
browser/base/content/test/popupNotifications/browser_popupNotification.js
browser/base/content/test/popupNotifications/browser_reshow_in_background.js
browser/base/content/test/siteIdentity/browser_bug1045809.js
browser/base/content/test/siteIdentity/browser_bug435035.js
browser/base/content/test/siteIdentity/browser_bug822367.js
browser/base/content/test/siteIdentity/browser_bug902156.js
browser/base/content/test/siteIdentity/browser_csp_block_all_mixedcontent.js
browser/base/content/test/siteIdentity/browser_insecureLoginForms.js
browser/base/content/test/siteIdentity/browser_mcb_redirect.js
browser/base/content/test/social/browser_social_activation.js
browser/base/content/test/sync/browser_aboutAccounts.js
browser/base/content/test/tabPrompts/browser_closeTabSpecificPanels.js
browser/base/content/test/tabs/browser_navigatePinnedTab.js
browser/base/content/test/tabs/browser_tabSpinnerTypeProbe.js
browser/base/content/test/tabs/browser_tabSwitchPrintPreview.js
browser/base/content/test/urlbar/browser_autocomplete_edit_completed.js
browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js
browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js
browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js
browser/base/content/test/urlbar/browser_bug304198.js
browser/base/content/test/urlbar/browser_bug556061.js
browser/base/content/test/urlbar/browser_bug562649.js
browser/base/content/test/urlbar/browser_bug623155.js
browser/base/content/test/urlbar/browser_locationBarCommand.js
browser/base/content/test/urlbar/browser_locationBarExternalLoad.js
browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js
browser/base/content/test/urlbar/browser_urlbarAboutHomeLoading.js
browser/base/content/test/urlbar/browser_urlbarCopying.js
browser/base/content/test/urlbar/browser_urlbarEnter.js
browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js
browser/base/content/test/urlbar/browser_urlbarOneOffs.js
browser/base/content/test/urlbar/browser_urlbarRevert.js
browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js
browser/base/content/test/urlbar/browser_urlbarStop.js
browser/base/content/test/webrtc/browser_devices_get_user_media_anim.js
browser/base/content/test/webrtc/browser_devices_get_user_media_tear_off_tab.js
browser/base/content/test/webrtc/browser_devices_get_user_media_unprompted_access_tear_off_tab.js
browser/components/contextualidentity/test/browser/browser_aboutURLs.js
browser/components/contextualidentity/test/browser/browser_blobUrl.js
browser/components/contextualidentity/test/browser/browser_broadcastchannel.js
browser/components/contextualidentity/test/browser/browser_count_and_remove.js
browser/components/contextualidentity/test/browser/browser_eme.js
browser/components/contextualidentity/test/browser/browser_favicon.js
browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js
browser/components/contextualidentity/test/browser/browser_forgetAPI_cookie_getCookiesWithOriginAttributes.js
browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
browser/components/contextualidentity/test/browser/browser_imageCache.js
browser/components/contextualidentity/test/browser/browser_middleClick.js
browser/components/contextualidentity/test/browser/browser_relatedTab.js
browser/components/contextualidentity/test/browser/browser_restore_getCookiesWithOriginAttributes.js
browser/components/contextualidentity/test/browser/browser_serviceworkers.js
browser/components/contextualidentity/test/browser/browser_usercontext.js
browser/components/contextualidentity/test/browser/browser_usercontextid_tabdrop.js
browser/components/contextualidentity/test/browser/browser_windowName.js
browser/components/contextualidentity/test/browser/browser_windowOpen.js
browser/components/customizableui/test/browser_1087303_button_preferences.js
browser/components/customizableui/test/browser_880164_customization_context_menus.js
browser/components/customizableui/test/browser_934951_zoom_in_toolbar.js
browser/components/customizableui/test/browser_947914_button_addons.js
browser/components/customizableui/test/browser_967000_button_feeds.js
browser/components/customizableui/test/browser_973641_button_addon.js
browser/components/customizableui/test/browser_synced_tabs_menu.js
browser/components/originattributes/test/browser/browser_favicon_firstParty.js
browser/components/originattributes/test/browser/browser_firstPartyIsolation.js
browser/components/originattributes/test/browser/browser_firstPartyIsolation_aboutPages.js
browser/components/originattributes/test/browser/browser_windowOpenerRestriction.js
browser/components/originattributes/test/browser/head.js
browser/components/places/tests/browser/browser_sidebarpanels_click.js
browser/components/preferences/in-content-old/tests/browser_bug1020245_openPreferences_to_paneContent.js
browser/components/preferences/in-content-old/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.js
browser/components/preferences/in-content-old/tests/head.js
browser/components/preferences/in-content/tests/browser_bug1020245_openPreferences_to_paneContent.js
browser/components/preferences/in-content/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.js
browser/components/preferences/in-content/tests/head.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
browser/components/safebrowsing/content/test/browser_bug400731.js
browser/components/search/test/browser_aboutSearchReset.js
browser/components/search/test/browser_abouthome_behavior.js
browser/components/search/test/browser_amazon_behavior.js
browser/components/search/test/browser_bing_behavior.js
browser/components/search/test/browser_contextSearchTabPosition.js
browser/components/search/test/browser_ddg_behavior.js
browser/components/search/test/browser_google_behavior.js
browser/components/search/test/browser_healthreport.js
browser/components/search/test/browser_searchbar_openpopup.js
browser/components/search/test/browser_webapi.js
browser/components/search/test/browser_yahoo_behavior.js
browser/components/sessionstore/test/browser_339445.js
browser/components/sessionstore/test/browser_350525.js
browser/components/sessionstore/test/browser_367052.js
browser/components/sessionstore/test/browser_393716.js
browser/components/sessionstore/test/browser_423132.js
browser/components/sessionstore/test/browser_447951.js
browser/components/sessionstore/test/browser_454908.js
browser/components/sessionstore/test/browser_456342.js
browser/components/sessionstore/test/browser_459906.js
browser/components/sessionstore/test/browser_461743.js
browser/components/sessionstore/test/browser_463205.js
browser/components/sessionstore/test/browser_463206.js
browser/components/sessionstore/test/browser_464620_a.js
browser/components/sessionstore/test/browser_464620_b.js
browser/components/sessionstore/test/browser_465215.js
browser/components/sessionstore/test/browser_466937.js
browser/components/sessionstore/test/browser_467409-backslashplosion.js
browser/components/sessionstore/test/browser_480893.js
browser/components/sessionstore/test/browser_485482.js
browser/components/sessionstore/test/browser_485563.js
browser/components/sessionstore/test/browser_491168.js
browser/components/sessionstore/test/browser_506482.js
browser/components/sessionstore/test/browser_579868.js
browser/components/sessionstore/test/browser_579879.js
browser/components/sessionstore/test/browser_581937.js
browser/components/sessionstore/test/browser_586147.js
browser/components/sessionstore/test/browser_601955.js
browser/components/sessionstore/test/browser_624727.js
browser/components/sessionstore/test/browser_625016.js
browser/components/sessionstore/test/browser_628270.js
browser/components/sessionstore/test/browser_635418.js
browser/components/sessionstore/test/browser_662743.js
browser/components/sessionstore/test/browser_662812.js
browser/components/sessionstore/test/browser_682507.js
browser/components/sessionstore/test/browser_687710_2.js
browser/components/sessionstore/test/browser_705597.js
browser/components/sessionstore/test/browser_707862.js
browser/components/sessionstore/test/browser_739531.js
browser/components/sessionstore/test/browser_739805.js
browser/components/sessionstore/test/browser_911547.js
browser/components/sessionstore/test/browser_aboutPrivateBrowsing.js
browser/components/sessionstore/test/browser_aboutSessionRestore.js
browser/components/sessionstore/test/browser_async_duplicate_tab.js
browser/components/sessionstore/test/browser_async_flushes.js
browser/components/sessionstore/test/browser_async_remove_tab.js
browser/components/sessionstore/test/browser_attributes.js
browser/components/sessionstore/test/browser_backup_recovery.js
browser/components/sessionstore/test/browser_capabilities.js
browser/components/sessionstore/test/browser_cleaner.js
browser/components/sessionstore/test/browser_cookies.js
browser/components/sessionstore/test/browser_crashedTabs.js
browser/components/sessionstore/test/browser_docshell_uuid_consistency.js
browser/components/sessionstore/test/browser_dynamic_frames.js
browser/components/sessionstore/test/browser_forget_async_closings.js
browser/components/sessionstore/test/browser_form_restore_events.js
browser/components/sessionstore/test/browser_formdata.js
browser/components/sessionstore/test/browser_formdata_cc.js
browser/components/sessionstore/test/browser_formdata_format.js
browser/components/sessionstore/test/browser_formdata_xpath.js
browser/components/sessionstore/test/browser_frame_history.js
browser/components/sessionstore/test/browser_frametree.js
browser/components/sessionstore/test/browser_history_persist.js
browser/components/sessionstore/test/browser_label_and_icon.js
browser/components/sessionstore/test/browser_multiple_navigateAndRestore.js
browser/components/sessionstore/test/browser_pageStyle.js
browser/components/sessionstore/test/browser_page_title.js
browser/components/sessionstore/test/browser_pending_tabs.js
browser/components/sessionstore/test/browser_privatetabs.js
browser/components/sessionstore/test/browser_purge_shistory.js
browser/components/sessionstore/test/browser_replace_load.js
browser/components/sessionstore/test/browser_restore_redirect.js
browser/components/sessionstore/test/browser_revive_crashed_bg_tabs.js
browser/components/sessionstore/test/browser_scrollPositions.js
browser/components/sessionstore/test/browser_send_async_message_oom.js
browser/components/sessionstore/test/browser_sessionHistory.js
browser/components/sessionstore/test/browser_sessionStorage.js
browser/components/sessionstore/test/browser_sessionStorage_size.js
browser/components/sessionstore/test/browser_sessionStoreContainer.js
browser/components/sessionstore/test/browser_swapDocShells.js
browser/components/sessionstore/test/browser_unrestored_crashedTabs.js
browser/components/shell/test/browser_420786.js
browser/components/translation/test/browser_translation_bing.js
browser/components/translation/test/browser_translation_exceptions.js
browser/components/translation/test/browser_translation_infobar.js
browser/components/translation/test/browser_translation_yandex.js
browser/components/uitour/test/browser_UITour_observe.js
browser/components/uitour/test/browser_UITour_registerPageID.js
browser/components/uitour/test/head.js
browser/extensions/pdfjs/test/browser_pdfjs_savedialog.js
browser/modules/test/browser/browser_ContentSearch.js
browser/modules/test/browser/browser_taskbar_preview.js
devtools/client/commandline/test/helpers.js
devtools/client/debugger/new/test/mochitest/browser_dbg-chrome-debugging.js
devtools/client/debugger/test/mochitest/browser_dbg_chrome-debugging.js
devtools/client/framework/test/browser_target_events.js
devtools/client/framework/test/browser_toolbox_raise.js
devtools/client/framework/test/shared-head.js
devtools/client/inspector/test/browser_inspector_open_on_neterror.js
devtools/client/projecteditor/test/head.js
devtools/client/responsivedesign/test/head.js
devtools/client/scratchpad/test/browser_scratchpad_browser_last_window_closing.js
devtools/client/scratchpad/test/browser_scratchpad_chrome_context_pref.js
devtools/client/scratchpad/test/browser_scratchpad_confirm_close.js
devtools/client/scratchpad/test/browser_scratchpad_contexts.js
devtools/client/scratchpad/test/browser_scratchpad_display_non_error_exceptions.js
devtools/client/scratchpad/test/browser_scratchpad_display_outputs_errors.js
devtools/client/scratchpad/test/browser_scratchpad_edit_ui_updates.js
devtools/client/scratchpad/test/browser_scratchpad_eval_func.js
devtools/client/scratchpad/test/browser_scratchpad_execute_print.js
devtools/client/scratchpad/test/browser_scratchpad_falsy.js
devtools/client/scratchpad/test/browser_scratchpad_files.js
devtools/client/scratchpad/test/browser_scratchpad_goto_line_ui.js
devtools/client/scratchpad/test/browser_scratchpad_help_key.js
devtools/client/scratchpad/test/browser_scratchpad_initialization.js
devtools/client/scratchpad/test/browser_scratchpad_inspect.js
devtools/client/scratchpad/test/browser_scratchpad_long_string.js
devtools/client/scratchpad/test/browser_scratchpad_modeline.js
devtools/client/scratchpad/test/browser_scratchpad_open_error_console.js
devtools/client/scratchpad/test/browser_scratchpad_pprint-02.js
devtools/client/scratchpad/test/browser_scratchpad_pprint.js
devtools/client/scratchpad/test/browser_scratchpad_pprint_error_goto_line.js
devtools/client/scratchpad/test/browser_scratchpad_recent_files.js
devtools/client/scratchpad/test/browser_scratchpad_reload_and_run.js
devtools/client/scratchpad/test/browser_scratchpad_remember_view_options.js
devtools/client/scratchpad/test/browser_scratchpad_reset_undo.js
devtools/client/scratchpad/test/browser_scratchpad_revert_to_saved.js
devtools/client/scratchpad/test/browser_scratchpad_run_error_goto_line.js
devtools/client/scratchpad/test/browser_scratchpad_tab.js
devtools/client/scratchpad/test/browser_scratchpad_tab_switch.js
devtools/client/scratchpad/test/browser_scratchpad_throw_output.js
devtools/client/scratchpad/test/browser_scratchpad_ui.js
devtools/client/scratchpad/test/browser_scratchpad_unsaved.js
devtools/client/scratchpad/test/browser_scratchpad_wrong_window_focus.js
devtools/client/scratchpad/test/head.js
devtools/client/sourceeditor/test/browser_css_getInfo.js
devtools/client/sourceeditor/test/browser_css_statemachine.js
devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js
devtools/client/webconsole/test/browser_console_private_browsing.js
devtools/client/webconsole/test/browser_webconsole_bug_653531_highlighter_console_helper.js
devtools/server/tests/browser/head.js
devtools/shared/webconsole/test/test_console_serviceworker_cached.html
docshell/test/browser/browser_bug134911.js
docshell/test/browser/browser_bug420605.js
docshell/test/browser/browser_bug441169.js
docshell/test/browser/browser_bug655270.js
docshell/test/browser/browser_bug673467.js
docshell/test/browser/browser_bug852909.js
docshell/test/browser/browser_bug92473.js
docshell/test/browser/browser_loadDisallowInherit.js
docshell/test/browser/browser_loadURI.js
docshell/test/browser/browser_onbeforeunload_navigation.js
docshell/test/browser/browser_search_notification.js
docshell/test/browser/browser_uriFixupIntegration.js
docshell/test/navigation/browser_bug343515.js
dom/base/test/browser_bug1058164.js
dom/base/test/browser_bug902350.js
dom/base/test/browser_inputStream_structuredClone.js
dom/base/test/browser_messagemanager_targetframeloader.js
dom/base/test/browser_messagemanager_unload.js
dom/base/test/browser_pagehide_on_tab_close.js
dom/base/test/browser_state_notifications.js
dom/base/test/browser_use_counters.js
dom/html/test/browser_DOMDocElementInserted.js
dom/html/test/browser_bug1108547.js
dom/html/test/browser_bug592641.js
dom/html/test/browser_fullscreen-api-keys.js
dom/html/test/browser_fullscreen-contextmenu-esc.js
dom/indexedDB/test/browser_forgetThisSite.js
dom/indexedDB/test/browser_permissionsPromptAllow.js
dom/indexedDB/test/browser_permissionsPromptDeny.js
dom/indexedDB/test/browser_permissionsPromptWorker.js
dom/indexedDB/test/browser_perwindow_privateBrowsing.js
dom/ipc/tests/browser_domainPolicy.js
dom/manifest/test/browser_ManifestObtainer_obtain.js
dom/plugins/test/mochitest/browser_bug1163570.js
dom/power/test/browser_wakelocks.js
dom/quota/test/browser_permissionsPromptAllow.js
dom/quota/test/browser_permissionsPromptDeny.js
dom/security/test/hsts/head.js
dom/tests/browser/browser_ConsoleStorageAPITests.js
dom/tests/browser/browser_autofocus_background.js
dom/tests/browser/browser_prerendering.js
dom/url/tests/browser_download_after_revoke.js
dom/workers/test/browser_bug1104623.js
dom/workers/test/head.js
dom/workers/test/serviceworkers/browser_download.js
dom/workers/test/serviceworkers/browser_force_refresh.js
dom/workers/test/serviceworkers/browser_multie10s_update.js
dom/xhr/tests/browser_blobFromFile.js
image/test/browser/browser_bug666317.js
image/test/browser/browser_image.js
layout/style/test/browser_newtab_share_rule_processors.js
netwerk/cookie/test/browser/browser_originattributes.js
netwerk/test/browser/browser_child_resource.js
netwerk/test/browser/browser_nsIFormPOSTActionChannel.js
netwerk/test/browser/browser_post_file.js
security/sandbox/test/browser_content_sandbox_fs.js
testing/mochitest/tests/browser/browser_browserLoaded_content_loaded.js
testing/mochitest/tests/browser/browser_waitForFocus.js
testing/talos/talos/tests/tabpaint/bootstrap.js
toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js
toolkit/components/addoncompat/tests/addon/bootstrap.js
toolkit/components/addoncompat/tests/compat-addon/bootstrap.js
toolkit/components/jsdownloads/test/browser/browser_DownloadPDFSaver.js
toolkit/components/passwordmgr/test/browser/browser_DOMFormHasPassword.js
toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms.js
toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js
toolkit/components/passwordmgr/test/browser/browser_passwordmgr_switchtab.js
toolkit/components/perfmonitoring/tests/browser/browser_compartments.js
toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js
toolkit/components/perfmonitoring/tests/browser/head.js
toolkit/components/places/tests/browser/browser_bug399606.js
toolkit/components/reader/test/browser_bug1124271_readerModePinnedTab.js
toolkit/components/reader/test/browser_readerMode.js
toolkit/components/reader/test/browser_readerMode_hidden_nodes.js
toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js
toolkit/components/startup/tests/browser/browser_bug511456.js
toolkit/components/startup/tests/browser/browser_bug537449.js
toolkit/components/thumbnails/test/browser_thumbnails_bug726727.js
toolkit/components/thumbnails/test/browser_thumbnails_privacy.js
toolkit/components/thumbnails/test/head.js
toolkit/content/tests/browser/browser_contentTitle.js
toolkit/content/tests/browser/browser_isSynthetic.js
toolkit/modules/tests/browser/browser_RemotePageManager.js
toolkit/modules/tests/browser/browser_WebNavigation.js
toolkit/modules/tests/browser/browser_WebRequest_cookies.js
toolkit/modules/tests/browser/browser_WebRequest_filtering.js
toolkit/mozapps/extensions/test/browser/browser_bug562797.js
toolkit/mozapps/extensions/test/browser/browser_newaddon.js
toolkit/mozapps/extensions/test/browser/head.js
toolkit/mozapps/extensions/test/xpinstall/browser_amosigned_trigger.js
toolkit/mozapps/extensions/test/xpinstall/browser_amosigned_trigger_iframe.js
toolkit/mozapps/extensions/test/xpinstall/browser_amosigned_url.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth2.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth3.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth4.js
toolkit/mozapps/extensions/test/xpinstall/browser_badargs.js
toolkit/mozapps/extensions/test/xpinstall/browser_badargs2.js
toolkit/mozapps/extensions/test/xpinstall/browser_badhash.js
toolkit/mozapps/extensions/test/xpinstall/browser_badhashtype.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug645699.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug672485.js
toolkit/mozapps/extensions/test/xpinstall/browser_concurrent_installs.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
toolkit/mozapps/extensions/test/xpinstall/browser_corrupt.js
toolkit/mozapps/extensions/test/xpinstall/browser_datauri.js
toolkit/mozapps/extensions/test/xpinstall/browser_empty.js
toolkit/mozapps/extensions/test/xpinstall/browser_enabled.js
toolkit/mozapps/extensions/test/xpinstall/browser_enabled2.js
toolkit/mozapps/extensions/test/xpinstall/browser_enabled3.js
toolkit/mozapps/extensions/test/xpinstall/browser_hash.js
toolkit/mozapps/extensions/test/xpinstall/browser_hash2.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash2.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash3.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash4.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash5.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash6.js
toolkit/mozapps/extensions/test/xpinstall/browser_installchrome.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile3.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile4.js
toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway.js
toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway2.js
toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway3.js
toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway4.js
toolkit/mozapps/extensions/test/xpinstall/browser_offline.js
toolkit/mozapps/extensions/test/xpinstall/browser_relative.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_no_cn.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_no_o.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_tampered.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_trigger.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_untrusted.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_url.js
toolkit/mozapps/extensions/test/xpinstall/browser_softwareupdate.js
toolkit/mozapps/extensions/test/xpinstall/browser_switchtab.js
toolkit/mozapps/extensions/test/xpinstall/browser_trigger_redirect.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger_iframe.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger_xorigin.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_url.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist2.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist3.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist4.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist5.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist6.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist7.js
--- a/browser/base/content/test/alerts/browser_notification_do_not_disturb.js
+++ b/browser/base/content/test/alerts/browser_notification_do_not_disturb.js
@@ -30,17 +30,17 @@ function test() {
   });
 
   pm.add(makeURI(notificationURL), "desktop-notification", pm.ALLOW_ACTION);
 
   // Make sure that do-not-disturb is not enabled.
   ok(!ALERT_SERVICE.manualDoNotDisturb, "Alert service should not be disabled when test starts");
   ALERT_SERVICE.manualDoNotDisturb = false;
 
-  tab = gBrowser.addTab(notificationURL);
+  tab = BrowserTestUtils.addTab(gBrowser, notificationURL);
   gBrowser.selectedTab = tab;
   tab.linkedBrowser.addEventListener("load", onLoad, true);
 }
 
 function onLoad() {
   tab.linkedBrowser.removeEventListener("load", onLoad, true);
   openNotification(tab.linkedBrowser, "showNotification2").then(onAlertShowing);
 }
--- a/browser/base/content/test/alerts/browser_notification_remove_permission.js
+++ b/browser/base/content/test/alerts/browser_notification_remove_permission.js
@@ -12,17 +12,17 @@ function test() {
   registerCleanupFunction(function() {
     pm.remove(makeURI(notificationURL), "desktop-notification");
     gBrowser.removeTab(tab);
     window.restore();
   });
 
   pm.add(makeURI(notificationURL), "desktop-notification", pm.ALLOW_ACTION);
 
-  tab = gBrowser.addTab(notificationURL);
+  tab = BrowserTestUtils.addTab(gBrowser, notificationURL);
   gBrowser.selectedTab = tab;
   tab.linkedBrowser.addEventListener("load", onLoad, true);
 }
 
 function onLoad() {
   tab.linkedBrowser.removeEventListener("load", onLoad, true);
   openNotification(tab.linkedBrowser, "showNotification2").then(onAlertShowing);
 }
--- a/browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js
+++ b/browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js
@@ -20,17 +20,17 @@ add_task(async function checkCaptivePort
 
   info("Waiting for captive portal state to be propagated to the content process.");
   await captivePortalStatePropagated;
 
   // Open a page with a cert error.
   let browser;
   let certErrorLoaded;
   let errorTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
-    let tab = gBrowser.addTab(BAD_CERT_PAGE);
+    let tab = BrowserTestUtils.addTab(gBrowser, BAD_CERT_PAGE);
     gBrowser.selectedTab = tab;
     browser = gBrowser.selectedBrowser;
     certErrorLoaded = BrowserTestUtils.waitForContentEvent(browser, "DOMContentLoaded");
     return tab;
   }, false);
 
   info("Waiting for cert error page to load.")
   await certErrorLoaded;
--- a/browser/base/content/test/general/browser_aboutCertError.js
+++ b/browser/base/content/test/general/browser_aboutCertError.js
@@ -12,17 +12,17 @@ const BAD_STS_CERT = "https://badchain.i
 const {TabStateFlusher} = Cu.import("resource:///modules/sessionstore/TabStateFlusher.jsm", {});
 const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
 
 add_task(async function checkReturnToAboutHome() {
   info("Loading a bad cert page directly and making sure 'return to previous page' goes to about:home");
   let browser;
   let certErrorLoaded;
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
-    gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_CERT);
     browser = gBrowser.selectedBrowser;
     certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
   }, false);
 
   info("Loading and waiting for the cert error");
   await certErrorLoaded;
 
   is(browser.webNavigation.canGoBack, false, "!webNavigation.canGoBack");
@@ -121,17 +121,17 @@ add_task(async function checkAppBuildIDI
 
 const PREF_BLOCKLIST_CLOCK_SKEW_SECONDS = "services.blocklist.clock_skew_seconds";
 
 add_task(async function checkWrongSystemTimeWarning() {
   async function setUpPage() {
     let browser;
     let certErrorLoaded;
     await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
-      gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
+      gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_CERT);
       browser = gBrowser.selectedBrowser;
       certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
     }, false);
 
     info("Loading and waiting for the cert error");
     await certErrorLoaded;
 
     return await ContentTask.spawn(browser, null, async function() {
@@ -219,17 +219,17 @@ add_task(async function checkWrongSystem
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function checkAdvancedDetails() {
   info("Loading a bad cert page and verifying the main error and advanced details section");
   let browser;
   let certErrorLoaded;
   await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
-    gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_CERT);
     browser = gBrowser.selectedBrowser;
     certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
   }, false);
 
   info("Loading and waiting for the cert error");
   await certErrorLoaded;
 
   let message = await ContentTask.spawn(browser, null, async function() {
@@ -281,17 +281,17 @@ add_task(async function checkAdvancedDet
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function checkAdvancedDetailsForHSTS() {
   info("Loading a bad STS cert page and verifying the advanced details section");
   let browser;
   let certErrorLoaded;
   await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
-    gBrowser.selectedTab = gBrowser.addTab(BAD_STS_CERT);
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_STS_CERT);
     browser = gBrowser.selectedBrowser;
     certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
   }, false);
 
   info("Loading and waiting for the cert error");
   await certErrorLoaded;
 
   let message = await ContentTask.spawn(browser, null, async function() {
@@ -350,17 +350,17 @@ add_task(async function checkAdvancedDet
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function checkUnknownIssuerLearnMoreLink() {
   info("Loading a cert error for self-signed pages and checking the correct link is shown");
   let browser;
   let certErrorLoaded;
   await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
-    gBrowser.selectedTab = gBrowser.addTab(UNKNOWN_ISSUER);
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, UNKNOWN_ISSUER);
     browser = gBrowser.selectedBrowser;
     certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
   }, false);
 
   info("Loading and waiting for the cert error");
   await certErrorLoaded;
 
   let href = await ContentTask.spawn(browser, null, async function() {
--- a/browser/base/content/test/general/browser_aboutHealthReport.js
+++ b/browser/base/content/test/general/browser_aboutHealthReport.js
@@ -110,17 +110,17 @@ function test() {
     }
 
     finish();
   })();
 }
 
 function promiseNewTabLoadEvent(aUrl, aEventType = "load") {
   return new Promise(resolve => {
-    let tab = gBrowser.selectedTab = gBrowser.addTab(aUrl);
+    let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, aUrl);
     tab.linkedBrowser.addEventListener(aEventType, function(event) {
       let iframe = tab.linkedBrowser.contentDocument.getElementById("remote-report");
         iframe.addEventListener("load", function frameLoad(e) {
           if (iframe.contentWindow.location.href == "about:blank" ||
               e.target != iframe) {
             return;
           }
           iframe.removeEventListener("load", frameLoad);
--- a/browser/base/content/test/general/browser_aboutNetError.js
+++ b/browser/base/content/test/general/browser_aboutNetError.js
@@ -11,17 +11,17 @@ const LOW_TLS_VERSION = "https://tls1.ex
 const {TabStateFlusher} = Cu.import("resource:///modules/sessionstore/TabStateFlusher.jsm", {});
 const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
 
 add_task(async function checkReturnToPreviousPage() {
   info("Loading a TLS page that isn't supported, ensure we have a fix button and clicking it then loads the page");
   let browser;
   let pageLoaded;
   await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
-    gBrowser.selectedTab = gBrowser.addTab(LOW_TLS_VERSION);
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, LOW_TLS_VERSION);
     browser = gBrowser.selectedBrowser;
     pageLoaded = BrowserTestUtils.waitForErrorPage(browser);
   }, false);
 
   info("Loading and waiting for the net error");
   await pageLoaded;
 
   // NB: This code assumes that the error page and the test page load in the
--- a/browser/base/content/test/general/browser_alltabslistener.js
+++ b/browser/base/content/test/general/browser_alltabslistener.js
@@ -82,18 +82,18 @@ var gFrontNotifications, gAllNotificatio
 var gBackgroundTab, gForegroundTab, gBackgroundBrowser, gForegroundBrowser, gTestBrowser;
 var gTestPage = "/browser/browser/base/content/test/general/alltabslistener.html";
 const kBasePage = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
 var gNextTest;
 
 function test() {
   waitForExplicitFinish();
 
-  gBackgroundTab = gBrowser.addTab();
-  gForegroundTab = gBrowser.addTab();
+  gBackgroundTab = BrowserTestUtils.addTab(gBrowser);
+  gForegroundTab = BrowserTestUtils.addTab(gBrowser);
   gBackgroundBrowser = gBrowser.getBrowserForTab(gBackgroundTab);
   gForegroundBrowser = gBrowser.getBrowserForTab(gForegroundTab);
   gBrowser.selectedTab = gForegroundTab;
 
   // We must wait until a page has completed loading before
   // starting tests or we get notifications from that
   let promises = [
     waitForDocLoadComplete(gBackgroundBrowser),
--- a/browser/base/content/test/general/browser_bookmark_titles.js
+++ b/browser/base/content/test/general/browser_bookmark_titles.js
@@ -15,17 +15,17 @@ var tests = [
     ["data:application/vnd.mozilla.xul+xml,",
      "data:application/vnd.mozilla.xul+xml,"],
     // about:certerror
     ["https://untrusted.example.com/somepage.html",
      "https://untrusted.example.com/somepage.html"]
 ];
 
 add_task(async function() {
-    gBrowser.selectedTab = gBrowser.addTab();
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
     let browser = gBrowser.selectedBrowser;
     browser.stop(); // stop the about:blank load.
 
     // Test that a bookmark of each URI gets the corresponding default title.
     for (let i = 0; i < tests.length; ++i) {
         let [uri, title] = tests[i];
 
         let promiseLoaded = promisePageLoaded(browser);
--- a/browser/base/content/test/general/browser_bug1015721.js
+++ b/browser/base/content/test/general/browser_bug1015721.js
@@ -6,18 +6,18 @@
 const TEST_PAGE = "http://example.org/browser/browser/base/content/test/general/zoom_test.html";
 
 var gTab1, gTab2, gLevel1;
 
 function test() {
   waitForExplicitFinish();
 
   (async function() {
-    gTab1 = gBrowser.addTab();
-    gTab2 = gBrowser.addTab();
+    gTab1 = BrowserTestUtils.addTab(gBrowser);
+    gTab2 = BrowserTestUtils.addTab(gBrowser);
 
     await FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
     await FullZoomHelper.load(gTab1, TEST_PAGE);
     await FullZoomHelper.load(gTab2, TEST_PAGE);
   })().then(zoomTab1, FullZoomHelper.failAndContinue(finish));
 }
 
 function zoomTab1() {
--- a/browser/base/content/test/general/browser_bug380960.js
+++ b/browser/base/content/test/general/browser_bug380960.js
@@ -1,11 +1,11 @@
 function test() {
-  var tab = gBrowser.addTab("about:blank", { skipAnimation: true });
+  var tab = BrowserTestUtils.addTab(gBrowser, "about:blank", { skipAnimation: true });
   gBrowser.removeTab(tab);
   is(tab.parentNode, null, "tab removed immediately");
 
-  tab = gBrowser.addTab("about:blank", { skipAnimation: true });
+  tab = BrowserTestUtils.addTab(gBrowser, "about:blank", { skipAnimation: true });
   gBrowser.removeTab(tab, { animate: true });
   gBrowser.removeTab(tab);
   is(tab.parentNode, null, "tab removed immediately when calling removeTab again after the animation was kicked off");
 }
 
--- a/browser/base/content/test/general/browser_bug386835.js
+++ b/browser/base/content/test/general/browser_bug386835.js
@@ -4,19 +4,19 @@ var gTab1, gTab2, gTab3;
 var gLevel;
 const BACK = 0;
 const FORWARD = 1;
 
 function test() {
   waitForExplicitFinish();
 
   (async function() {
-    gTab1 = gBrowser.addTab(gTestPage);
-    gTab2 = gBrowser.addTab();
-    gTab3 = gBrowser.addTab();
+    gTab1 = BrowserTestUtils.addTab(gBrowser, gTestPage);
+    gTab2 = BrowserTestUtils.addTab(gBrowser);
+    gTab3 = BrowserTestUtils.addTab(gBrowser);
 
     await FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
     await FullZoomHelper.load(gTab1, gTestPage);
     await FullZoomHelper.load(gTab2, gTestPage);
   })().then(secondPageLoaded, FullZoomHelper.failAndContinue(finish));
 }
 
 function secondPageLoaded() {
--- a/browser/base/content/test/general/browser_bug406216.js
+++ b/browser/base/content/test/general/browser_bug406216.js
@@ -15,17 +15,17 @@ const URIS = ["about:config",
               "data:text/html,<title>OK</title>"];
 
 function test() {
   waitForExplicitFinish();
   URIS.forEach(addTab);
 }
 
 function addTab(aURI, aIndex) {
-  var tab = gBrowser.addTab(aURI);
+  var tab = BrowserTestUtils.addTab(gBrowser, aURI);
   if (aIndex == 0)
     gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
 
   tab.linkedBrowser.addEventListener("load", function(event) {
     if (++count == URIS.length)
       executeSoon(doTabsTest);
   }, {capture: true, once: true});
 }
@@ -41,12 +41,12 @@ function doTabsTest() {
       if (aTab != closedTab && aTab.linkedBrowser.currentURI.scheme == scheme)
         gBrowser.removeTab(aTab, {skipPermitUnload: true});
     });
   }, {capture: true, once: true});
 
   gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
   is(gBrowser.tabs.length, 1, "Related tabs are not closed unexpectedly");
 
-  gBrowser.addTab("about:blank");
+  BrowserTestUtils.addTab(gBrowser, "about:blank");
   gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
   finish();
 }
--- a/browser/base/content/test/general/browser_bug416661.js
+++ b/browser/base/content/test/general/browser_bug416661.js
@@ -31,13 +31,13 @@ function end_test_prefNotSet() {
     finish();
   })();
 }
 
 function test() {
   waitForExplicitFinish();
 
   (async function() {
-    tabElm = gBrowser.addTab();
+    tabElm = BrowserTestUtils.addTab(gBrowser);
     await FullZoomHelper.selectTabAndWaitForLocationChange(tabElm);
     await FullZoomHelper.load(tabElm, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html");
   })().then(start_test_prefNotSet, FullZoomHelper.failAndContinue(finish));
 }
--- a/browser/base/content/test/general/browser_bug419612.js
+++ b/browser/base/content/test/general/browser_bug419612.js
@@ -1,18 +1,18 @@
 function test() {
   waitForExplicitFinish();
 
   (async function() {
     let testPage = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
-    let tab1 = gBrowser.addTab();
+    let tab1 = BrowserTestUtils.addTab(gBrowser);
     await FullZoomHelper.selectTabAndWaitForLocationChange(tab1);
     await FullZoomHelper.load(tab1, testPage);
 
-    let tab2 = gBrowser.addTab();
+    let tab2 = BrowserTestUtils.addTab(gBrowser);
     await FullZoomHelper.load(tab2, testPage);
 
     FullZoom.enlarge();
     let tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser);
 
     await FullZoomHelper.selectTabAndWaitForLocationChange(tab2);
     let tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
     is(tab2Zoom, tab1Zoom, "Zoom should affect background tabs");
--- a/browser/base/content/test/general/browser_bug423833.js
+++ b/browser/base/content/test/general/browser_bug423833.js
@@ -10,17 +10,17 @@ var test2tab;
 var test3window;
 
 // We use setInterval instead of setTimeout to avoid race conditions on error doc loads
 var intervalID;
 
 function test() {
   waitForExplicitFinish();
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedBrowser.addEventListener("load", test1Setup, true);
   content.location = testPage;
 }
 
 function test1Setup() {
   if (content.frames.length < 2 ||
       content.frames[1].location != invalidPage)
     // The error frame hasn't loaded yet
--- a/browser/base/content/test/general/browser_bug431826.js
+++ b/browser/base/content/test/general/browser_bug431826.js
@@ -1,14 +1,14 @@
 function remote(task) {
   return ContentTask.spawn(gBrowser.selectedBrowser, null, task);
 }
 
 add_task(async function() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   let promise = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
   gBrowser.loadURI("https://nocert.example.com/");
   await promise;
 
   await remote(() => {
     // Confirm that we are displaying the contributed error page, not the default
     let uri = content.document.documentURI;
--- a/browser/base/content/test/general/browser_bug432599.js
+++ b/browser/base/content/test/general/browser_bug432599.js
@@ -38,17 +38,17 @@ function add_bookmark(aURI, aTitle) {
                                               aURI, PlacesUtils.bookmarks.DEFAULT_INDEX,
                                               aTitle);
 }
 
 // test bug 432599
 function test() {
   waitForExplicitFinish();
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedBrowser.addEventListener("load", function() {
     waitForStarChange(false, initTest);
   }, {capture: true, once: true});
 
   content.location = testURL;
 }
 
 function initTest() {
--- a/browser/base/content/test/general/browser_bug435325.js
+++ b/browser/base/content/test/general/browser_bug435325.js
@@ -14,17 +14,17 @@ function test() {
   // Tests always connect to localhost, and per bug 87717, localhost is now
   // reachable in offline mode.  To avoid this, disable any proxy.
   proxyPrefValue = Services.prefs.getIntPref("network.proxy.type");
   Services.prefs.setIntPref("network.proxy.type", 0);
 
   Services.prefs.setBoolPref("browser.cache.disk.enable", false);
   Services.prefs.setBoolPref("browser.cache.memory.enable", false);
 
-  gBrowser.selectedTab = gBrowser.addTab("http://example.com/");
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
 
   let contentScript = `
     let listener = function () {
       removeEventListener("DOMContentLoaded", listener);
       sendAsyncMessage("Test:DOMContentLoaded", { uri: content.document.documentURI });
     };
     addEventListener("DOMContentLoaded", listener);
   `;
--- a/browser/base/content/test/general/browser_bug441778.js
+++ b/browser/base/content/test/general/browser_bug441778.js
@@ -10,17 +10,17 @@
 function test() {
   waitForExplicitFinish();
 
   const TEST_PAGE_URL = 'data:text/html,<body><iframe src=""></iframe></body>';
   const TEST_IFRAME_URL = "http://test2.example.org/";
 
   (async function() {
     // Prepare the test tab
-    let tab = gBrowser.addTab();
+    let tab = BrowserTestUtils.addTab(gBrowser);
     await FullZoomHelper.selectTabAndWaitForLocationChange(tab);
 
     let testBrowser = tab.linkedBrowser;
 
     await FullZoomHelper.load(tab, TEST_PAGE_URL);
 
     // Change the zoom level and then save it so we can compare it to the level
     // after loading the sub-document.
--- a/browser/base/content/test/general/browser_bug462289.js
+++ b/browser/base/content/test/general/browser_bug462289.js
@@ -6,18 +6,18 @@ function focus_in_navbar() {
     parent = parent.parentNode;
 
   return parent != null;
 }
 
 function test() {
   waitForExplicitFinish();
 
-  tab1 = gBrowser.addTab("about:blank", {skipAnimation: true});
-  tab2 = gBrowser.addTab("about:blank", {skipAnimation: true});
+  tab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
+  tab2 = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
 
   EventUtils.synthesizeMouseAtCenter(tab1, {});
   executeSoon(step2);
 }
 
 function step2() {
   is(gBrowser.selectedTab, tab1, "1st click on tab1 selects tab");
   isnot(document.activeElement, tab1, "1st click on tab1 does not activate tab");
--- a/browser/base/content/test/general/browser_bug477014.js
+++ b/browser/base/content/test/general/browser_bug477014.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // That's a gecko!
 const iconURLSpec = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==";
 var testPage = "data:text/plain,test bug 477014";
 
 add_task(async function() {
-  let tabToDetach = gBrowser.addTab(testPage);
+  let tabToDetach = BrowserTestUtils.addTab(gBrowser, testPage);
   await waitForDocLoadComplete(tabToDetach.linkedBrowser);
 
   gBrowser.setIcon(tabToDetach, iconURLSpec,
                    Services.scriptSecurityManager.getSystemPrincipal());
   tabToDetach.setAttribute("busy", "true");
 
   // detach and set the listener on the new window
   let newWindow = gBrowser.replaceTabWithWindow(tabToDetach);
--- a/browser/base/content/test/general/browser_bug479408.js
+++ b/browser/base/content/test/general/browser_bug479408.js
@@ -1,11 +1,11 @@
 function test() {
   waitForExplicitFinish();
-  let tab = gBrowser.selectedTab = gBrowser.addTab(
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser,
     "http://mochi.test:8888/browser/browser/base/content/test/general/browser_bug479408_sample.html");
 
   gBrowser.addEventListener("DOMLinkAdded", function(aEvent) {
     executeSoon(function() {
       ok(!tab.linkedBrowser.engines,
          "the subframe's search engine wasn't detected");
 
       gBrowser.removeTab(tab);
--- a/browser/base/content/test/general/browser_bug491431.js
+++ b/browser/base/content/test/general/browser_bug491431.js
@@ -5,22 +5,22 @@
 var testPage = "data:text/plain,test bug 491431 Page";
 
 function test() {
   waitForExplicitFinish();
 
   let newWin, tabA, tabB;
 
   // test normal close
-  tabA = gBrowser.addTab(testPage);
+  tabA = BrowserTestUtils.addTab(gBrowser, testPage);
   gBrowser.tabContainer.addEventListener("TabClose", function(firstTabCloseEvent) {
     ok(!firstTabCloseEvent.detail.adoptedBy, "This was a normal tab close");
 
     // test tab close by moving
-    tabB = gBrowser.addTab(testPage);
+    tabB = BrowserTestUtils.addTab(gBrowser, testPage);
     gBrowser.tabContainer.addEventListener("TabClose", function(secondTabCloseEvent) {
       executeSoon(function() {
         ok(secondTabCloseEvent.detail.adoptedBy, "This was a tab closed by moving");
 
         // cleanup
         newWin.close();
         executeSoon(finish);
       });
--- a/browser/base/content/test/general/browser_bug495058.js
+++ b/browser/base/content/test/general/browser_bug495058.js
@@ -6,17 +6,17 @@
 const URIS = [
   "about:blank",
   "about:sessionrestore",
   "about:privatebrowsing",
 ];
 
 add_task(async function() {
   for (let uri of URIS) {
-    let tab = gBrowser.addTab();
+    let tab = BrowserTestUtils.addTab(gBrowser);
     await BrowserTestUtils.loadURI(tab.linkedBrowser, uri);
 
     let win = gBrowser.replaceTabWithWindow(tab);
     await TestUtils.topicObserved("browser-delayed-startup-finished",
                                   subject => subject == win);
     tab = win.gBrowser.selectedTab;
 
     // BrowserTestUtils doesn't get the add-on shims, which means that
--- a/browser/base/content/test/general/browser_bug521216.js
+++ b/browser/base/content/test/general/browser_bug521216.js
@@ -3,17 +3,17 @@ var actual = [];
 var tabIndex = -1;
 this.__defineGetter__("tab", () => gBrowser.tabs[tabIndex]);
 
 function test() {
   waitForExplicitFinish();
   tabIndex = gBrowser.tabs.length;
   gBrowser.addTabsProgressListener(progressListener);
   gBrowser.tabContainer.addEventListener("TabOpen", TabOpen);
-  gBrowser.addTab("data:text/html,<html><head><link href='about:logo' rel='shortcut icon'>");
+  BrowserTestUtils.addTab(gBrowser, "data:text/html,<html><head><link href='about:logo' rel='shortcut icon'>");
 }
 
 function record(aName) {
   info("got " + aName);
   if (actual.indexOf(aName) == -1)
     actual.push(aName);
   if (actual.length == expected.length) {
     is(actual.toString(), expected.toString(),
--- a/browser/base/content/test/general/browser_bug533232.js
+++ b/browser/base/content/test/general/browser_bug533232.js
@@ -1,30 +1,30 @@
 function test() {
   var tab1 = gBrowser.selectedTab;
-  var tab2 = gBrowser.addTab();
+  var tab2 = BrowserTestUtils.addTab(gBrowser);
   var childTab1;
   var childTab2;
 
-  childTab1 = gBrowser.addTab("about:blank", { relatedToCurrent: true });
+  childTab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", { relatedToCurrent: true });
   gBrowser.selectedTab = childTab1;
   gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
   is(idx(gBrowser.selectedTab), idx(tab1),
      "closing a tab next to its parent selects the parent");
 
-  childTab1 = gBrowser.addTab("about:blank", { relatedToCurrent: true });
+  childTab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", { relatedToCurrent: true });
   gBrowser.selectedTab = tab2;
   gBrowser.selectedTab = childTab1;
   gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
   is(idx(gBrowser.selectedTab), idx(tab2),
      "closing a tab next to its parent doesn't select the parent if another tab had been selected ad interim");
 
   gBrowser.selectedTab = tab1;
-  childTab1 = gBrowser.addTab("about:blank", { relatedToCurrent: true });
-  childTab2 = gBrowser.addTab("about:blank", { relatedToCurrent: true });
+  childTab1 = BrowserTestUtils.addTab(gBrowser, "about:blank", { relatedToCurrent: true });
+  childTab2 = BrowserTestUtils.addTab(gBrowser, "about:blank", { relatedToCurrent: true });
   gBrowser.selectedTab = childTab1;
   gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
   is(idx(gBrowser.selectedTab), idx(childTab2),
      "closing a tab next to its parent selects the next tab with the same parent");
   gBrowser.removeTab(gBrowser.selectedTab, { skipPermitUnload: true });
   is(idx(gBrowser.selectedTab), idx(tab2),
      "closing the last tab in a set of child tabs doesn't go back to the parent");
 
--- a/browser/base/content/test/general/browser_bug537013.js
+++ b/browser/base/content/test/general/browser_bug537013.js
@@ -10,18 +10,18 @@ var texts = [
   "Klein bottle for sale. Inquire within.",
   "To err is human; to forgive is not company policy."
 ];
 
 var Clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
 var HasFindClipboard = Clipboard.supportsFindClipboard();
 
 function addTabWithText(aText, aCallback) {
-  let newTab = gBrowser.addTab("data:text/html;charset=utf-8,<h1 id='h1'>" +
-                               aText + "</h1>");
+  let newTab = BrowserTestUtils.addTab(gBrowser, "data:text/html;charset=utf-8,<h1 id='h1'>" +
+                                       aText + "</h1>");
   tabs.push(newTab);
   gBrowser.selectedTab = newTab;
 }
 
 function setFindString(aString) {
   gFindBar.open();
   gFindBar._findField.focus();
   gFindBar._findField.select();
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -432,17 +432,17 @@ function test_restartless() {
     let pm = Services.perms;
     pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
     let progressPromise = waitForProgressNotification();
     let dialogPromise = waitForInstallDialog();
     let triggers = encodeURIComponent(JSON.stringify({
       "XPI": "restartless.xpi"
     }));
-    gBrowser.selectedTab = gBrowser.addTab();
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
     gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
     await progressPromise;
     let installDialog = await dialogPromise;
 
     let notificationPromise = waitForNotification("addon-installed");
     acceptInstallDialog(installDialog);
     await notificationPromise;
 
@@ -585,17 +585,17 @@ function test_allUnverified() {
     await removeTab();
   })();
 },
 
 function test_url() {
   return (async function() {
     let progressPromise = waitForProgressNotification();
     let dialogPromise = waitForInstallDialog();
-    gBrowser.selectedTab = gBrowser.addTab("about:blank");
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
     await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
     gBrowser.loadURI(TESTROOT + "amosigned.xpi");
     await progressPromise;
     let installDialog = await dialogPromise;
 
     let notificationPromise = waitForNotification("addon-install-restart");
     acceptInstallDialog(installDialog);
     let panel = await notificationPromise;
@@ -626,17 +626,17 @@ function test_localFile() {
     }
 
     let failPromise = new Promise(resolve => {
       Services.obs.addObserver(function observer() {
         Services.obs.removeObserver(observer, "addon-install-failed");
         resolve();
       }, "addon-install-failed");
     });
-    gBrowser.selectedTab = gBrowser.addTab("about:blank");
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
     await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
     gBrowser.loadURI(path);
     await failPromise;
 
     // Wait for the browser code to add the failure notification
     await waitForSingleNotification();
 
     let notification = PopupNotifications.panel.childNodes[0];
@@ -653,17 +653,17 @@ function test_tabClose() {
   return (async function() {
     if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
       info("Test skipped due to xpinstall.customConfirmationUI being false.");
       return;
     }
 
     let progressPromise = waitForProgressNotification();
     let dialogPromise = waitForInstallDialog();
-    gBrowser.selectedTab = gBrowser.addTab("about:blank");
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
     await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
     gBrowser.loadURI(TESTROOT + "amosigned.xpi");
     await progressPromise;
     await dialogPromise;
 
     let installs = await getInstalls();
     is(installs.length, 1, "Should be one pending install");
 
@@ -709,17 +709,17 @@ function test_tabNavigate() {
   })();
 },
 
 function test_urlBar() {
   return (async function() {
     let progressPromise = waitForProgressNotification();
     let dialogPromise = waitForInstallDialog();
 
-    gBrowser.selectedTab = gBrowser.addTab("about:blank");
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
     await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
     gURLBar.value = TESTROOT + "amosigned.xpi";
     gURLBar.focus();
     EventUtils.synthesizeKey("VK_RETURN", {});
 
     await progressPromise;
     let installDialog = await dialogPromise;
 
@@ -739,17 +739,17 @@ function test_urlBar() {
 
     await removeTab();
   })();
 },
 
 function test_wrongHost() {
   return (async function() {
     let requestedUrl = TESTROOT2 + "enabled.html";
-    gBrowser.selectedTab = gBrowser.addTab();
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
     let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
     gBrowser.loadURI(TESTROOT2 + "enabled.html");
     await loadedPromise;
 
     let progressPromise = waitForProgressNotification();
     let notificationPromise = waitForNotification("addon-install-failed");
     gBrowser.loadURI(TESTROOT + "corrupt.xpi");
--- a/browser/base/content/test/general/browser_bug555224.js
+++ b/browser/base/content/test/general/browser_bug555224.js
@@ -19,22 +19,22 @@ function testBackgroundLoad() {
 function testInitialZoom() {
   (async function() {
     is(ZoomManager.zoom, 1, "initial zoom level should be 1");
     FullZoom.enlarge();
 
     gTestZoom = ZoomManager.zoom;
     isnot(gTestZoom, 1, "zoom level should have changed");
 
-    gBgTab = gBrowser.addTab();
+    gBgTab = BrowserTestUtils.addTab(gBrowser);
     await FullZoomHelper.load(gBgTab, "http://mochi.test:8888" + TEST_PAGE);
   })().then(testBackgroundLoad, FullZoomHelper.failAndContinue(finish));
 }
 
 function test() {
   waitForExplicitFinish();
 
   (async function() {
-    gTestTab = gBrowser.addTab();
+    gTestTab = BrowserTestUtils.addTab(gBrowser);
     await FullZoomHelper.selectTabAndWaitForLocationChange(gTestTab);
     await FullZoomHelper.load(gTestTab, "http://example.org" + TEST_PAGE);
   })().then(testInitialZoom, FullZoomHelper.failAndContinue(finish));
 }
--- a/browser/base/content/test/general/browser_bug555767.js
+++ b/browser/base/content/test/general/browser_bug555767.js
@@ -2,25 +2,25 @@
      * License, v. 2.0. If a copy of the MPL was not distributed with this
      * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
     add_task(async function() {
       let testURL = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
       let tabSelected = false;
 
       // Open the base tab
-      let baseTab = gBrowser.addTab(testURL);
+      let baseTab = BrowserTestUtils.addTab(gBrowser, testURL);
 
       // Wait for the tab to be fully loaded so matching happens correctly
       await promiseTabLoaded(baseTab);
       if (baseTab.linkedBrowser.currentURI.spec == "about:blank")
         return;
       baseTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
 
-      let testTab = gBrowser.addTab();
+      let testTab = BrowserTestUtils.addTab(gBrowser);
 
       // Select the testTab
       gBrowser.selectedTab = testTab;
 
       // Set the urlbar to include the moz-action
       gURLBar.value = "moz-action:switchtab," + JSON.stringify({url: testURL});
       // Focus the urlbar so we can press enter
       gURLBar.focus();
--- a/browser/base/content/test/general/browser_bug559991.js
+++ b/browser/base/content/test/general/browser_bug559991.js
@@ -8,17 +8,17 @@ function test() {
   waitForExplicitFinish();
 
   gPrefService.setBoolPref("browser.zoom.updateBackgroundTabs", true);
   gPrefService.setBoolPref("browser.zoom.siteSpecific", true);
 
   let uri = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
 
   (async function() {
-    tab = gBrowser.addTab();
+    tab = BrowserTestUtils.addTab(gBrowser);
     await FullZoomHelper.load(tab, uri);
 
     // -------------------------------------------------------------------
     // Test - Trigger a tab switch that should update the zoom level
     await FullZoomHelper.selectTabAndWaitForLocationChange(tab);
     ok(true, "applyPrefToSetting was called");
   })().then(endTest, FullZoomHelper.failAndContinue(endTest));
 }
--- a/browser/base/content/test/general/browser_bug561636.js
+++ b/browser/base/content/test/general/browser_bug561636.js
@@ -35,17 +35,17 @@ function getDocFooter() {
 }
 
 function getEmptyFrame() {
   return "<iframe style='width:100px; height:30px; margin:3px; border:1px solid lightgray;' " +
          "name='t' srcdoc=\"<html><head><meta charset='utf-8'></head><body>form target</body></html>\"></iframe>";
 }
 
 async function openNewTab(uri, background) {
-  let tab = gBrowser.addTab();
+  let tab = BrowserTestUtils.addTab(gBrowser);
   let browser = gBrowser.getBrowserForTab(tab);
   if (!background) {
     gBrowser.selectedTab = tab;
   }
   await promiseTabLoadEvent(tab, "data:text/html," + escape(uri));
   return browser;
 }
 
--- a/browser/base/content/test/general/browser_bug563588.js
+++ b/browser/base/content/test/general/browser_bug563588.js
@@ -5,18 +5,18 @@ function press(key, expectedPos) {
      "accel+" + key + " doesn't change which tab is selected");
   is(gBrowser.tabContainer.selectedIndex, expectedPos,
      "accel+" + key + " moves the tab to the expected position");
   is(document.activeElement, gBrowser.selectedTab,
      "accel+" + key + " leaves the selected tab focused");
 }
 
 function test() {
-  gBrowser.addTab();
-  gBrowser.addTab();
+  BrowserTestUtils.addTab(gBrowser);
+  BrowserTestUtils.addTab(gBrowser);
   is(gBrowser.tabs.length, 3, "got three tabs");
   is(gBrowser.tabs[0], gBrowser.selectedTab, "first tab is selected");
 
   gBrowser.selectedTab.focus();
   is(document.activeElement, gBrowser.selectedTab, "selected tab is focused");
 
   press("right", 1);
   press("down", 2);
--- a/browser/base/content/test/general/browser_bug575561.js
+++ b/browser/base/content/test/general/browser_bug575561.js
@@ -59,17 +59,17 @@ var waitForTabOpen = async function() {
 
   await waitForDocLoadComplete(event.target.linkedBrowser);
   await Promise.resolve();
 
   gBrowser.removeCurrentTab();
 };
 
 var testLink = async function(aLinkIndexOrFunction, pinTab, expectNewTab, testSubFrame, aURL = TEST_URL) {
-  let appTab = gBrowser.addTab(aURL, {skipAnimation: true});
+  let appTab = BrowserTestUtils.addTab(gBrowser, aURL, {skipAnimation: true});
   if (pinTab)
     gBrowser.pinTab(appTab);
   gBrowser.selectedTab = appTab;
 
   await waitForDocLoadComplete();
 
   let browser = appTab.linkedBrowser;
   if (testSubFrame)
--- a/browser/base/content/test/general/browser_bug575830.js
+++ b/browser/base/content/test/general/browser_bug575830.js
@@ -5,18 +5,18 @@
 
 function test() {
   let tab1, tab2;
   const TEST_IMAGE = "http://example.org/browser/browser/base/content/test/general/moz.png";
 
   waitForExplicitFinish();
 
   (async function() {
-    tab1 = gBrowser.addTab();
-    tab2 = gBrowser.addTab();
+    tab1 = BrowserTestUtils.addTab(gBrowser);
+    tab2 = BrowserTestUtils.addTab(gBrowser);
     await FullZoomHelper.selectTabAndWaitForLocationChange(tab1);
     await FullZoomHelper.load(tab1, TEST_IMAGE);
 
     is(ZoomManager.zoom, 1, "initial zoom level for first should be 1");
 
     FullZoom.enlarge();
     let zoom = ZoomManager.zoom;
     isnot(zoom, 1, "zoom level should have changed");
--- a/browser/base/content/test/general/browser_bug577121.js
+++ b/browser/base/content/test/general/browser_bug577121.js
@@ -5,18 +5,18 @@
 function test() {
   Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", false);
   registerCleanupFunction(function() {
     Services.prefs.clearUserPref("toolkit.cosmeticAnimations.enabled");
   });
 
   // Open 2 other tabs, and pin the second one. Like that, the initial tab
   // should get closed.
-  let testTab1 = gBrowser.addTab();
-  let testTab2 = gBrowser.addTab();
+  let testTab1 = BrowserTestUtils.addTab(gBrowser);
+  let testTab2 = BrowserTestUtils.addTab(gBrowser);
   gBrowser.pinTab(testTab2);
 
   // Now execute "Close other Tabs" on the first manually opened tab (tab1).
   // -> tab2 ist pinned, tab1 should remain open and the initial tab should
   // get closed.
   gBrowser.removeAllTabsBut(testTab1);
 
   is(gBrowser.tabs.length, 2, "there are two remaining tabs open");
--- a/browser/base/content/test/general/browser_bug579872.js
+++ b/browser/base/content/test/general/browser_bug579872.js
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function test() {
-  let newTab = gBrowser.addTab();
+  let newTab = BrowserTestUtils.addTab(gBrowser);
   waitForExplicitFinish();
   BrowserTestUtils.browserLoaded(newTab.linkedBrowser).then(mainPart);
 
   function mainPart() {
     gBrowser.pinTab(newTab);
     gBrowser.selectedTab = newTab;
 
     openUILinkIn("javascript:var x=0;", "current");
--- a/browser/base/content/test/general/browser_bug580638.js
+++ b/browser/base/content/test/general/browser_bug580638.js
@@ -23,17 +23,17 @@ function test() {
     }
   }
 
   let lastSelectedTab = gBrowser.selectedTab;
   ok(!lastSelectedTab.pinned, "We should have started with a regular tab selected");
 
   testState(false);
 
-  let pinnedTab = gBrowser.addTab("about:blank");
+  let pinnedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   gBrowser.pinTab(pinnedTab);
 
   // Just pinning the tab shouldn't change the key state.
   testState(false);
 
   // Test updating key state after selecting a tab.
   gBrowser.selectedTab = pinnedTab;
   testState(true);
--- a/browser/base/content/test/general/browser_bug580956.js
+++ b/browser/base/content/test/general/browser_bug580956.js
@@ -10,17 +10,17 @@ function isUndoCloseEnabled() {
 function test() {
   waitForExplicitFinish();
 
   gPrefService.setIntPref("browser.sessionstore.max_tabs_undo", 0);
   gPrefService.clearUserPref("browser.sessionstore.max_tabs_undo");
   is(numClosedTabs(), 0, "There should be 0 closed tabs.");
   ok(!isUndoCloseEnabled(), "Undo Close Tab should be disabled.");
 
-  var tab = gBrowser.addTab("http://mochi.test:8888/");
+  var tab = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/");
   var browser = gBrowser.getBrowserForTab(tab);
   BrowserTestUtils.browserLoaded(browser).then(() => {
     BrowserTestUtils.removeTab(tab).then(() => {
       ok(isUndoCloseEnabled(), "Undo Close Tab should be enabled.");
       finish();
     });
   });
 }
--- a/browser/base/content/test/general/browser_bug581242.js
+++ b/browser/base/content/test/general/browser_bug581242.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function test() {
   // Create a new tab and load about:addons
-  let blanktab = gBrowser.addTab();
+  let blanktab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = blanktab;
   BrowserOpenAddonsMgr();
 
   is(blanktab, gBrowser.selectedTab, "Current tab should be blank tab");
   // Verify that about:addons loads
   waitForExplicitFinish();
   gBrowser.selectedBrowser.addEventListener("load", function() {
     let browser = blanktab.linkedBrowser;
--- a/browser/base/content/test/general/browser_bug581253.js
+++ b/browser/base/content/test/general/browser_bug581253.js
@@ -10,17 +10,17 @@ function test() {
   registerCleanupFunction(function() {
     PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
     if (timerID > 0) {
       clearTimeout(timerID);
     }
   });
   waitForExplicitFinish();
 
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   tab.linkedBrowser.addEventListener("load", (function(event) {
     let uri = makeURI(testURL);
     let bmTxn =
       new PlacesCreateBookmarkTransaction(uri,
                                           PlacesUtils.unfiledBookmarksFolderId,
                                           -1, "", null, []);
     PlacesUtils.transactionManager.doTransaction(bmTxn);
 
--- a/browser/base/content/test/general/browser_bug585785.js
+++ b/browser/base/content/test/general/browser_bug585785.js
@@ -1,14 +1,14 @@
 var tab;
 
 function test() {
   waitForExplicitFinish();
 
-  tab = gBrowser.addTab();
+  tab = BrowserTestUtils.addTab(gBrowser);
   isnot(tab.getAttribute("fadein"), "true", "newly opened tab is yet to fade in");
 
   // Try to remove the tab right before the opening animation's first frame
   window.requestAnimationFrame(checkAnimationState);
 }
 
 function checkAnimationState() {
   is(tab.getAttribute("fadein"), "true", "tab opening animation initiated");
--- a/browser/base/content/test/general/browser_bug585830.js
+++ b/browser/base/content/test/general/browser_bug585830.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function test() {
   let tab1 = gBrowser.selectedTab;
-  let tab2 = gBrowser.addTab("about:blank", {skipAnimation: true});
-  gBrowser.addTab();
+  let tab2 = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
+  BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = tab2;
 
   gBrowser.removeCurrentTab({animate: true});
   gBrowser.tabContainer.advanceSelectedTab(-1, true);
   is(gBrowser.selectedTab, tab1, "First tab should be selected");
   gBrowser.removeTab(tab2);
 
   // test for "null has no properties" fix. See Bug 585830 Comment 13
--- a/browser/base/content/test/general/browser_bug592338.js
+++ b/browser/base/content/test/general/browser_bug592338.js
@@ -35,17 +35,17 @@ function promisePopupNotificationShown(n
 
 var TESTS = [
 function test_install_http() {
   is(LightweightThemeManager.currentTheme, null, "Should be no lightweight theme selected");
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.org/"), "install", pm.ALLOW_ACTION);
 
-  gBrowser.selectedTab = gBrowser.addTab("http://example.org/browser/browser/base/content/test/general/bug592338.html");
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "http://example.org/browser/browser/base/content/test/general/bug592338.html");
   gBrowser.selectedBrowser.addEventListener("pageshow", function() {
     if (gBrowser.contentDocument.location.href == "about:blank")
       return;
 
     gBrowser.selectedBrowser.removeEventListener("pageshow", arguments.callee);
 
     executeSoon(function() {
       BrowserTestUtils.synthesizeMouse("#theme-install", 2, 2, {}, gBrowser.selectedBrowser);
@@ -62,17 +62,17 @@ function test_install_http() {
 },
 
 function test_install_lwtheme() {
   is(LightweightThemeManager.currentTheme, null, "Should be no lightweight theme selected");
 
   var pm = Services.perms;
   pm.add(makeURI("https://example.com/"), "install", pm.ALLOW_ACTION);
 
-  gBrowser.selectedTab = gBrowser.addTab("https://example.com/browser/browser/base/content/test/general/bug592338.html");
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "https://example.com/browser/browser/base/content/test/general/bug592338.html");
   gBrowser.selectedBrowser.addEventListener("pageshow", function() {
     if (gBrowser.contentDocument.location.href == "about:blank")
       return;
 
     gBrowser.selectedBrowser.removeEventListener("pageshow", arguments.callee);
 
     let promise = promisePopupNotificationShown("addon-installed");
     BrowserTestUtils.synthesizeMouse("#theme-install", 2, 2, {}, gBrowser.selectedBrowser);
--- a/browser/base/content/test/general/browser_bug594131.js
+++ b/browser/base/content/test/general/browser_bug594131.js
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function test() {
-  let newTab = gBrowser.addTab("http://example.com");
+  let newTab = BrowserTestUtils.addTab(gBrowser, "http://example.com");
   waitForExplicitFinish();
   BrowserTestUtils.browserLoaded(newTab.linkedBrowser).then(mainPart);
 
   function mainPart() {
     gBrowser.pinTab(newTab);
     gBrowser.selectedTab = newTab;
 
     openUILinkIn("http://example.org/", "current", { inBackground: true });
--- a/browser/base/content/test/general/browser_bug595507.js
+++ b/browser/base/content/test/general/browser_bug595507.js
@@ -3,17 +3,17 @@
  */
 add_task(async function() {
   let uri = "<iframe src=\"data:text/html,<iframe name='t'></iframe><form target='t' action='data:text/html,'><input required id='i'><input id='s' type='submit'></form>\"</iframe>";
 
   var gInvalidFormPopup = document.getElementById("invalid-form-popup");
   ok(gInvalidFormPopup,
      "The browser should have a popup to show when a form is invalid");
 
-  let tab = gBrowser.addTab();
+  let tab = BrowserTestUtils.addTab(gBrowser);
   let browser = gBrowser.getBrowserForTab(tab);
   gBrowser.selectedTab = tab;
 
   await promiseTabLoadEvent(tab, "data:text/html," + escape(uri));
 
   let popupShownPromise = promiseWaitForEvent(gInvalidFormPopup, "popupshown");
 
   await ContentTask.spawn(browser, {}, async function() {
--- a/browser/base/content/test/general/browser_bug624734.js
+++ b/browser/base/content/test/general/browser_bug624734.js
@@ -11,17 +11,17 @@ function finishTest() {
 
   gBrowser.removeCurrentTab();
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
 
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
     if (BookmarkingUI.status == BookmarkingUI.STATUS_UPDATING) {
       waitForCondition(() => BookmarkingUI.status != BookmarkingUI.STATUS_UPDATING, finishTest, "BookmarkingUI was updating for too long");
     } else {
       finishTest();
     }
   });
 
--- a/browser/base/content/test/general/browser_bug655584.js
+++ b/browser/base/content/test/general/browser_bug655584.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Bug 655584 - awesomebar suggestions don't update after tab is closed
 
 add_task(async function() {
-  var tab1 = gBrowser.addTab();
-  var tab2 = gBrowser.addTab();
+  var tab1 = BrowserTestUtils.addTab(gBrowser);
+  var tab2 = BrowserTestUtils.addTab(gBrowser);
 
   // When urlbar in a new tab is focused, and a tab switch occurs,
   // the urlbar popup should be closed
   await BrowserTestUtils.switchTab(gBrowser, tab2);
   gURLBar.focus(); // focus the urlbar in the tab we will switch to
   await BrowserTestUtils.switchTab(gBrowser, tab1);
   gURLBar.openPopup();
   await BrowserTestUtils.switchTab(gBrowser, tab2);
--- a/browser/base/content/test/general/browser_bug664672.js
+++ b/browser/base/content/test/general/browser_bug664672.js
@@ -1,12 +1,12 @@
 function test() {
   waitForExplicitFinish();
 
-  var tab = gBrowser.addTab();
+  var tab = BrowserTestUtils.addTab(gBrowser);
 
   tab.addEventListener("TabClose", function() {
     ok(tab.linkedBrowser, "linkedBrowser should still exist during the TabClose event");
 
     executeSoon(function() {
       ok(!tab.linkedBrowser, "linkedBrowser should be gone after the TabClose event");
 
       finish();
--- a/browser/base/content/test/general/browser_bug678392.js
+++ b/browser/base/content/test/general/browser_bug678392.js
@@ -155,17 +155,17 @@ function test2() {
   // Test growing of snapshot array across tabs.
   let tab = gBrowser.selectedTab;
 
   load(tab, HTTPROOT + "browser_bug678392-1.html", function() {
     load(tab, HTTPROOT + "browser_bug678392-2.html", function() {
       is(gHistorySwipeAnimation._trackedSnapshots.length, 2, "Length of " +
          "snapshot array is equal to 2 after loading two pages");
       let prevTab = tab;
-      tab = gBrowser.addTab("about:newtab");
+      tab = BrowserTestUtils.addTab(gBrowser, "about:newtab");
       gBrowser.selectedTab = tab;
       load(tab, HTTPROOT + "browser_bug678392-2.html" /* initial page */,
            function() {
         load(tab, HTTPROOT + "browser_bug678392-1.html", function() {
           load(tab, HTTPROOT + "browser_bug678392-2.html", function() {
             is(gHistorySwipeAnimation._trackedSnapshots.length, 4, "Length " +
                "of snapshot array is equal to 4 after loading two pages in " +
                "two tabs each.");
--- a/browser/base/content/test/general/browser_bug719271.js
+++ b/browser/base/content/test/general/browser_bug719271.js
@@ -7,18 +7,18 @@ const TEST_PAGE = "http://example.org/br
 const TEST_VIDEO = "http://example.org/browser/browser/base/content/test/general/video.ogg";
 
 var gTab1, gTab2, gLevel1;
 
 function test() {
   waitForExplicitFinish();
 
   (async function() {
-    gTab1 = gBrowser.addTab();
-    gTab2 = gBrowser.addTab();
+    gTab1 = BrowserTestUtils.addTab(gBrowser);
+    gTab2 = BrowserTestUtils.addTab(gBrowser);
 
     await FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
     await FullZoomHelper.load(gTab1, TEST_PAGE);
     await FullZoomHelper.load(gTab2, TEST_VIDEO);
   })().then(zoomTab1, FullZoomHelper.failAndContinue(finish));
 }
 
 function zoomTab1() {
--- a/browser/base/content/test/general/browser_bug749738.js
+++ b/browser/base/content/test/general/browser_bug749738.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 const DUMMY_PAGE = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
 
 function test() {
   waitForExplicitFinish();
 
-  let tab = gBrowser.addTab();
+  let tab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = tab;
 
   BrowserTestUtils.loadURI(tab.linkedBrowser, DUMMY_PAGE);
   BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
     gFindBar.onFindCommand();
     EventUtils.sendString("Dummy");
     gBrowser.removeTab(tab);
 
--- a/browser/base/content/test/general/browser_bug817947.js
+++ b/browser/base/content/test/general/browser_bug817947.js
@@ -26,23 +26,23 @@ function test() {
         win.close();
         finish();
       });
     });
   });
 }
 
 function preparePendingTab(aCallback) {
-  let tab = gBrowser.addTab(URL);
+  let tab = BrowserTestUtils.addTab(gBrowser, URL);
 
   whenLoaded(tab.linkedBrowser, function() {
     BrowserTestUtils.removeTab(tab).then(() => {
       let [{state}] = JSON.parse(SessionStore.getClosedTabData(window));
 
-      tab = gBrowser.addTab("about:blank");
+      tab = BrowserTestUtils.addTab(gBrowser, "about:blank");
       whenLoaded(tab.linkedBrowser, function() {
         SessionStore.setTabState(tab, JSON.stringify(state));
         ok(tab.hasAttribute("pending"), "tab should be pending");
         aCallback(tab);
       });
     });
   });
 }
--- a/browser/base/content/test/general/browser_clipboard.js
+++ b/browser/base/content/test/general/browser_clipboard.js
@@ -2,17 +2,17 @@
 // types (html and images) are copied to and pasted from the clipboard properly.
 
 var testPage = "<body style='margin: 0'>" +
                "  <img id='img' tabindex='1' src='http://example.org/browser/browser/base/content/test/general/moz.png'>" +
                "  <div id='main' contenteditable='true'>Test <b>Bold</b> After Text</div>" +
                "</body>";
 
 add_task(async function() {
-  let tab = gBrowser.addTab();
+  let tab = BrowserTestUtils.addTab(gBrowser);
   let browser = gBrowser.getBrowserForTab(tab);
 
   gBrowser.selectedTab = tab;
 
   await promiseTabLoadEvent(tab, "data:text/html," + escape(testPage));
   await SimpleTest.promiseFocus(browser.contentWindowAsCPOW);
 
   const modifier = (navigator.platform.indexOf("Mac") >= 0) ?
--- a/browser/base/content/test/general/browser_ctrlTab.js
+++ b/browser/base/content/test/general/browser_ctrlTab.js
@@ -1,14 +1,14 @@
 add_task(async function() {
   gPrefService.setBoolPref("browser.ctrlTab.previews", true);
 
-  gBrowser.addTab();
-  gBrowser.addTab();
-  gBrowser.addTab();
+  BrowserTestUtils.addTab(gBrowser);
+  BrowserTestUtils.addTab(gBrowser);
+  BrowserTestUtils.addTab(gBrowser);
 
   checkTabs(4);
 
   await ctrlTabTest([2], 1, 0);
   await ctrlTabTest([2, 3, 1], 2, 2);
   await ctrlTabTest([], 4, 2);
 
   {
@@ -32,17 +32,17 @@ add_task(async function() {
     let tabs = gBrowser.tabs.length;
     await pressCtrlTab();
     await pressCtrlTab(true);
     await synthesizeCtrlW();
     is(gBrowser.tabs.length, tabs - 1, "Ctrl+Tab -> Ctrl+W removes the selected tab");
     await releaseCtrl();
   }
 
-  gBrowser.addTab();
+  BrowserTestUtils.addTab(gBrowser);
   checkTabs(3);
   await ctrlTabTest([2, 1, 0], 7, 1);
 
   { // test for bug 1292049
     let tabToClose = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:buildconfig");
     checkTabs(4);
     selectTabs([0, 1, 2, 3]);
 
--- a/browser/base/content/test/general/browser_discovery.js
+++ b/browser/base/content/test/general/browser_discovery.js
@@ -8,17 +8,17 @@ function setHandlerFunc(aResultFunc) {
   gBrowser.addEventListener("DOMLinkAdded", function(event) {
     executeSoon(aResultFunc);
   }, {once: true});
 }
 
 function test() {
   waitForExplicitFinish();
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   browser = gBrowser.selectedBrowser;
   browser.addEventListener("load", function(event) {
     iconDiscovery();
   }, {capture: true, once: true});
   var rootDir = getRootDirectory(gTestPath);
   content.location = rootDir + "discovery.html";
 }
 
--- a/browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js
+++ b/browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js
@@ -141,17 +141,17 @@ function checkState(expectedStates, cont
 const kPage = "http://example.org/browser/browser/" +
               "base/content/test/general/dummy_page.html";
 
 add_task(async function() {
   await pushPrefs(
     ["full-screen-api.transition-duration.enter", "0 0"],
     ["full-screen-api.transition-duration.leave", "0 0"]);
 
-  let tab = gBrowser.addTab(kPage);
+  let tab = BrowserTestUtils.addTab(gBrowser, kPage);
   let browser = tab.linkedBrowser;
   gBrowser.selectedTab = tab;
   await waitForDocLoadComplete();
 
   registerCleanupFunction(() => {
     if (browser.contentWindow.fullScreen) {
       BrowserFullScreen();
     }
--- a/browser/base/content/test/general/browser_double_close_tab.js
+++ b/browser/base/content/test/general/browser_double_close_tab.js
@@ -32,17 +32,17 @@ function waitForDialogDestroyed(node, ca
     clearTimeout(failureTimeout);
     observer.disconnect();
     observer = null;
     callback();
   }
 }
 
 add_task(async function() {
-  testTab = gBrowser.selectedTab = gBrowser.addTab();
+  testTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   await promiseTabLoadEvent(testTab, TEST_PAGE);
   // XXXgijs the reason this has nesting and callbacks rather than promises is
   // that DOM promises resolve on the next tick. So they're scheduled
   // in an event queue. So when we spin a new event queue for a modal dialog...
   // everything gets messed up and the promise's .then callbacks never get
   // called, despite resolve() being called just fine.
   await new Promise(resolveOuter => {
     waitForDialog(dialogNode => {
--- a/browser/base/content/test/general/browser_drag.js
+++ b/browser/base/content/test/general/browser_drag.js
@@ -26,17 +26,17 @@ function test() {
   var dt = EventUtils.synthesizeDragStart(document.getElementById("identity-box"), expected);
   is(dt, null, "drag on proxy icon");
   gURLBar.setAttribute("pageproxystate", oldstate);
   // Now, the identity information panel is opened by the proxy icon click.
   // We need to close it for next tests.
   EventUtils.synthesizeKey("VK_ESCAPE", {}, window);
 
   // now test dragging onto a tab
-  var tab = gBrowser.addTab("about:blank", {skipAnimation: true});
+  var tab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
   var browser = gBrowser.getBrowserForTab(tab);
 
   browser.addEventListener("load", function() {
     is(browser.contentWindow.location, "http://mochi.test:8888/", "drop on tab");
     gBrowser.removeTab(tab);
     finish();
   }, true);
 
--- a/browser/base/content/test/general/browser_e10s_chrome_process.js
+++ b/browser/base/content/test/general/browser_e10s_chrome_process.js
@@ -36,17 +36,17 @@ const CHROME_PROCESS = Ci.nsIXULRuntime.
 const CONTENT_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
 const PATH = (getRootDirectory(gTestPath) + "test_process_flags_chrome.html").replace("chrome://mochitests", "");
 
 const CHROME = "chrome://mochitests" + PATH;
 const CANREMOTE = "chrome://mochitests-any" + PATH;
 const MUSTREMOTE = "chrome://mochitests-content" + PATH;
 
 add_task(async function init() {
-  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
 });
 
 registerCleanupFunction(() => {
   gBrowser.removeCurrentTab();
 });
 
 function test_url(url, chromeResult, contentResult) {
   is(E10SUtils.canLoadURIInProcess(url, CHROME_PROCESS),
--- a/browser/base/content/test/general/browser_e10s_switchbrowser.js
+++ b/browser/base/content/test/general/browser_e10s_switchbrowser.js
@@ -111,17 +111,17 @@ var forward = async function() {
 
 // Tests that navigating from a page that should be in the remote process and
 // a page that should be in the main process works and retains history
 add_task(async function test_navigation() {
   let expectedRemote = gMultiProcessBrowser;
 
   info("1");
   // Create a tab and load a remote page in it
-  gBrowser.selectedTab = gBrowser.addTab("about:blank", {skipAnimation: true});
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
   let {permanentKey} = gBrowser.selectedBrowser;
   await waitForLoad("http://example.org/" + DUMMY_PATH);
   is(gBrowser.selectedBrowser.isRemoteBrowser, expectedRemote, "Remote attribute should be correct");
   is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
 
   info("2");
   // Load another page
   await waitForLoad("http://example.com/" + DUMMY_PATH);
@@ -188,17 +188,17 @@ add_task(async function test_navigation(
 
 // Tests that calling gBrowser.loadURI or browser.loadURI to load a page in a
 // different process updates the browser synchronously
 add_task(async function test_synchronous() {
   let expectedRemote = gMultiProcessBrowser;
 
   info("1");
   // Create a tab and load a remote page in it
-  gBrowser.selectedTab = gBrowser.addTab("about:blank", {skipAnimation: true});
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
   let {permanentKey} = gBrowser.selectedBrowser;
   await waitForLoad("http://example.org/" + DUMMY_PATH);
   is(gBrowser.selectedBrowser.isRemoteBrowser, expectedRemote, "Remote attribute should be correct");
   is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
 
   info("2");
   // Load another page
   info("Loading about:robots");
@@ -228,17 +228,17 @@ add_task(async function test_synchronous
 
 // Tests that load flags are correctly passed through to the child process with
 // normal loads
 add_task(async function test_loadflags() {
   let expectedRemote = gMultiProcessBrowser;
 
   info("1");
   // Create a tab and load a remote page in it
-  gBrowser.selectedTab = gBrowser.addTab("about:blank", {skipAnimation: true});
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
   await waitForLoadWithFlags("about:robots");
   is(gBrowser.selectedBrowser.isRemoteBrowser, false, "Remote attribute should be correct");
   await check_history();
 
   info("2");
   // Load a page in the remote process with some custom flags
   await waitForLoadWithFlags("http://example.com/" + DUMMY_PATH, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY);
   is(gBrowser.selectedBrowser.isRemoteBrowser, expectedRemote, "Remote attribute should be correct");
--- a/browser/base/content/test/general/browser_favicon_change.js
+++ b/browser/base/content/test/general/browser_favicon_change.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change.html"
 
 add_task(async function() {
-  let extraTab = gBrowser.selectedTab = gBrowser.addTab();
+  let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   extraTab.linkedBrowser.loadURI(TEST_URL);
   let tabLoaded = BrowserTestUtils.browserLoaded(extraTab.linkedBrowser);
   let expectedFavicon = "http://example.org/one-icon";
   let haveChanged = new Promise.defer();
   let observer = new MutationObserver(function(mutations) {
     for (let mut of mutations) {
       if (mut.attributeName != "image") {
         continue;
--- a/browser/base/content/test/general/browser_favicon_change_not_in_document.js
+++ b/browser/base/content/test/general/browser_favicon_change_not_in_document.js
@@ -1,14 +1,14 @@
 "use strict";
 
 const TEST_URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_favicon_change_not_in_document.html"
 
 add_task(async function() {
-  let extraTab = gBrowser.selectedTab = gBrowser.addTab();
+  let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   let tabLoaded = promiseTabLoaded(extraTab);
   extraTab.linkedBrowser.loadURI(TEST_URL);
   let expectedFavicon = "http://example.org/one-icon";
   let haveChanged = new Promise.defer();
   let observer = new MutationObserver(function(mutations) {
     for (let mut of mutations) {
       if (mut.attributeName != "image") {
         continue;
--- a/browser/base/content/test/general/browser_feed_discovery.js
+++ b/browser/base/content/test/general/browser_feed_discovery.js
@@ -1,15 +1,15 @@
 const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/feed_discovery.html"
 
 /** Test for Bug 377611 **/
 
 add_task(async function() {
   // Open a new tab.
-  gBrowser.selectedTab = gBrowser.addTab(URL);
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, URL);
   registerCleanupFunction(() => gBrowser.removeCurrentTab());
 
   let browser = gBrowser.selectedBrowser;
   await BrowserTestUtils.browserLoaded(browser);
 
   let discovered = browser.feeds;
   ok(discovered.length > 0, "some feeds should be discovered");
 
--- a/browser/base/content/test/general/browser_findbarClose.js
+++ b/browser/base/content/test/general/browser_findbarClose.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests find bar auto-close behavior
 
 var newTab;
 
 add_task(async function findbar_test() {
   waitForExplicitFinish();
-  newTab = gBrowser.addTab("about:blank");
+  newTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
 
   let promise = ContentTask.spawn(newTab.linkedBrowser, null, async function() {
     await ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", false);
   });
   newTab.linkedBrowser.loadURI("http://example.com/browser/" +
     "browser/base/content/test/general/test_bug628179.html");
   await promise;
 
--- a/browser/base/content/test/general/browser_fullscreen-window-open.js
+++ b/browser/base/content/test/general/browser_fullscreen-window-open.js
@@ -11,17 +11,17 @@ const TEST_FILE = "file_fullscreen-windo
 const gHttpTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/",
                                                           "http://127.0.0.1:8888/");
 
 function test() {
   waitForExplicitFinish();
 
   Services.prefs.setBoolPref(PREF_DISABLE_OPEN_NEW_WINDOW, true);
 
-  let newTab = gBrowser.addTab(gHttpTestRoot + TEST_FILE);
+  let newTab = BrowserTestUtils.addTab(gBrowser, gHttpTestRoot + TEST_FILE);
   gBrowser.selectedTab = newTab;
 
   whenTabLoaded(newTab, function() {
     // Enter browser fullscreen mode.
     BrowserFullScreen();
 
     runNextTest();
   });
--- a/browser/base/content/test/general/browser_gZipOfflineChild.js
+++ b/browser/base/content/test/general/browser_gZipOfflineChild.js
@@ -63,17 +63,17 @@ function handleMessageEvents(event) {
 }
 
 function test() {
   waitForExplicitFinish();
 
   Services.prefs.setBoolPref("offline-apps.allow_by_default", true);
 
   // Open a new tab.
-  gBrowser.selectedTab = gBrowser.addTab(URL);
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, URL);
   registerCleanupFunction(() => gBrowser.removeCurrentTab());
 
   BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
     let window = gBrowser.selectedBrowser.contentWindow;
 
     window.addEventListener("message", handleMessageEvents);
   });
 }
--- a/browser/base/content/test/general/browser_gestureSupport.js
+++ b/browser/base/content/test/general/browser_gestureSupport.js
@@ -636,13 +636,13 @@ function test_rotateGesturesOnTab() {
   }
 
   gBrowser.removeTab(test_imageTab);
   test_imageTab = null;
   finish();
 }
 
 function test_rotateGestures() {
-  test_imageTab = gBrowser.addTab("chrome://branding/content/about-logo.png");
+  test_imageTab = BrowserTestUtils.addTab(gBrowser, "chrome://branding/content/about-logo.png");
   gBrowser.selectedTab = test_imageTab;
 
   gBrowser.selectedBrowser.addEventListener("load", test_rotateGesturesOnTab, true);
 }
--- a/browser/base/content/test/general/browser_hide_removing.js
+++ b/browser/base/content/test/general/browser_hide_removing.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Bug 587922: tabs don't get removed if they're hidden
 
 function test() {
   waitForExplicitFinish();
 
   // Add a tab that will get removed and hidden
-  let testTab = gBrowser.addTab("about:blank", {skipAnimation: true});
+  let testTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
   is(gBrowser.visibleTabs.length, 2, "just added a tab, so 2 tabs");
   gBrowser.selectedTab = testTab;
 
   let numVisBeforeHide, numVisAfterHide;
   gBrowser.tabContainer.addEventListener("TabSelect", function() {
     // While the next tab is being selected, hide the removing tab
     numVisBeforeHide = gBrowser.visibleTabs.length;
     gBrowser.hideTab(testTab);
--- a/browser/base/content/test/general/browser_keywordBookmarklets.js
+++ b/browser/base/content/test/general/browser_keywordBookmarklets.js
@@ -1,15 +1,15 @@
 "use strict"
 
 add_task(async function test_keyword_bookmarklet() {
   let bm = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
                                                 title: "bookmarklet",
                                                 url: "javascript:'1';" });
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   registerCleanupFunction(async function() {
     gBrowser.removeTab(tab);
     await PlacesUtils.bookmarks.remove(bm);
   });
   await promisePageShow();
   let originalPrincipal = gBrowser.contentPrincipal;
 
   function getPrincipalURI() {
--- a/browser/base/content/test/general/browser_keywordSearch.js
+++ b/browser/base/content/test/general/browser_keywordSearch.js
@@ -29,17 +29,17 @@ function test() {
         }, {once: true});
         executeSoon(finish);
       }
     }
   };
 
   Services.ww.registerNotification(windowObserver);
 
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   let listener = {
     onStateChange: function onLocationChange(webProgress, req, flags, status) {
       // Only care about document starts
       let docStart = Ci.nsIWebProgressListener.STATE_IS_DOCUMENT |
                      Ci.nsIWebProgressListener.STATE_START;
       if (!(flags & docStart))
         return;
--- a/browser/base/content/test/general/browser_keywordSearch_postData.js
+++ b/browser/base/content/test/general/browser_keywordSearch_postData.js
@@ -14,17 +14,17 @@ var gTests = [
     testText: "?   foo  ",
     expectText: "foo"
   }
 ];
 
 function test() {
   waitForExplicitFinish();
 
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   let searchObserver = function search_observer(aSubject, aTopic, aData) {
     let engine = aSubject.QueryInterface(Ci.nsISearchEngine);
     info("Observer: " + aData + " for " + engine.name);
 
     if (aData != "engine-added")
       return;
 
--- a/browser/base/content/test/general/browser_lastAccessedTab.js
+++ b/browser/base/content/test/general/browser_lastAccessedTab.js
@@ -21,17 +21,17 @@ function test() {
   waitForExplicitFinish();
 
   originalTab = gBrowser.selectedTab;
   nextStep(step2);
 }
 
 function step2() {
   isCurrent(originalTab, "selected tab has the current timestamp");
-  newTab = gBrowser.addTab("about:blank", {skipAnimation: true});
+  newTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
   nextStep(step3);
 }
 
 function step3() {
   ok(newTab.lastAccessed < Date.now(), "new tab hasn't been selected so far");
   gBrowser.selectedTab = newTab;
   isCurrent(newTab, "new tab has the current timestamp after being selected");
   nextStep(step4);
--- a/browser/base/content/test/general/browser_offlineQuotaNotification.js
+++ b/browser/base/content/test/general/browser_offlineQuotaNotification.js
@@ -31,17 +31,17 @@ function checkInContentPreferences(win) 
 }
 
 function test() {
   waitForExplicitFinish();
 
   Services.prefs.setBoolPref("offline-apps.allow_by_default", false);
 
   // Open a new tab.
-  gBrowser.selectedTab = gBrowser.addTab(URL);
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, URL);
   registerCleanupFunction(() => gBrowser.removeCurrentTab());
 
 
   Promise.all([
     // Wait for a notification that asks whether to allow offline storage.
     promiseNotification(),
     // Wait for the tab to load.
     BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser),
--- a/browser/base/content/test/general/browser_overflowScroll.js
+++ b/browser/base/content/test/general/browser_overflowScroll.js
@@ -31,17 +31,17 @@ function test() {
 }
 
 function doTest() {
   tabstrip.smoothScroll = false;
 
   var tabMinWidth = parseInt(getComputedStyle(gBrowser.selectedTab, null).minWidth);
   var tabCountForOverflow = Math.ceil(width(tabstrip) / tabMinWidth * 3);
   while (tabs.length < tabCountForOverflow)
-    gBrowser.addTab("about:blank", {skipAnimation: true});
+    BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
   gBrowser.pinTab(tabs[0]);
 
   tabstrip.addEventListener("overflow", runOverflowTests);
 }
 
 function runOverflowTests(aEvent) {
   if (aEvent.detail != 1 ||
       aEvent.target != tabstrip)
--- a/browser/base/content/test/general/browser_pinnedTabs.js
+++ b/browser/base/content/test/general/browser_pinnedTabs.js
@@ -22,17 +22,17 @@ function PinUnpinHandler(tab, eventName)
   gBrowser.tabContainer.addEventListener(eventName, function(e) {
     if (e.originalTarget == tab) {
       self.eventCount++;
     }
   }, {capture: true, once: true});
 }
 
 function test() {
-  tabs = [gBrowser.selectedTab, gBrowser.addTab(), gBrowser.addTab(), gBrowser.addTab()];
+  tabs = [gBrowser.selectedTab, BrowserTestUtils.addTab(gBrowser), BrowserTestUtils.addTab(gBrowser), BrowserTestUtils.addTab(gBrowser)];
   indexTest(0, 0);
   indexTest(1, 1);
   indexTest(2, 2);
   indexTest(3, 3);
 
   var eh = new PinUnpinHandler(tabs[3], "TabPinned");
   gBrowser.pinTab(tabs[3]);
   is(eh.eventCount, 2, "TabPinned event should be fired");
--- a/browser/base/content/test/general/browser_relatedTabs.js
+++ b/browser/base/content/test/general/browser_relatedTabs.js
@@ -6,17 +6,17 @@ add_task(async function() {
   is(gBrowser.tabs.length, 1, "one tab is open initially");
 
   // Add several new tabs in sequence, interrupted by selecting a
   // different tab, moving a tab around and closing a tab,
   // returning a list of opened tabs for verifying the expected order.
   // The new tab behaviour is documented in bug 465673
   let tabs = [];
   function addTab(aURL, aReferrer) {
-    let tab = gBrowser.addTab(aURL, {referrerURI: aReferrer});
+    let tab = BrowserTestUtils.addTab(gBrowser, aURL, {referrerURI: aReferrer});
     tabs.push(tab);
     return BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   }
 
   await addTab("http://mochi.test:8888/#0");
   gBrowser.selectedTab = tabs[0];
   await addTab("http://mochi.test:8888/#1");
   await addTab("http://mochi.test:8888/#2", gBrowser.currentURI);
--- a/browser/base/content/test/general/browser_removeTabsToTheEnd.js
+++ b/browser/base/content/test/general/browser_removeTabsToTheEnd.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function test() {
   // Add two new tabs after the original tab. Pin the first one.
   let originalTab = gBrowser.selectedTab;
-  let newTab1 = gBrowser.addTab();
-  gBrowser.addTab();
+  let newTab1 = BrowserTestUtils.addTab(gBrowser);
+  BrowserTestUtils.addTab(gBrowser);
   gBrowser.pinTab(newTab1);
 
   // Check that there is only one closable tab from originalTab to the end
   is(gBrowser.getTabsToTheEndFrom(originalTab).length, 1,
     "One unpinned tab to the right");
 
   // Remove tabs to the end
   gBrowser.removeTabsToTheEndFrom(originalTab);
--- a/browser/base/content/test/general/browser_restore_isAppTab.js
+++ b/browser/base/content/test/general/browser_restore_isAppTab.js
@@ -97,17 +97,17 @@ var restart = async function(browser) {
 
   let tab = gBrowser.getTabForBrowser(browser);
   SessionStore.reviveCrashedTab(tab);
 
   await promiseTabLoaded(tab);
 };
 
 add_task(async function navigate() {
-  let tab = gBrowser.addTab("about:robots");
+  let tab = BrowserTestUtils.addTab(gBrowser, "about:robots");
   let browser = tab.linkedBrowser;
   gBrowser.selectedTab = tab;
   await waitForDocLoadComplete();
   loadFrameScript(browser);
   let isAppTab = await isBrowserAppTab(browser);
   ok(!isAppTab, "Docshell shouldn't think it is an app tab");
 
   gBrowser.pinTab(tab);
@@ -136,17 +136,17 @@ add_task(async function navigate() {
 
   gBrowser.removeCurrentTab();
 });
 
 add_task(async function crash() {
   if (!gMultiProcessBrowser || !("nsICrashReporter" in Ci))
     return;
 
-  let tab = gBrowser.addTab(DUMMY);
+  let tab = BrowserTestUtils.addTab(gBrowser, DUMMY);
   let browser = tab.linkedBrowser;
   gBrowser.selectedTab = tab;
   await waitForDocLoadComplete();
   loadFrameScript(browser);
   let isAppTab = await isBrowserAppTab(browser);
   ok(!isAppTab, "Docshell shouldn't think it is an app tab");
 
   gBrowser.pinTab(tab);
--- a/browser/base/content/test/general/browser_save_video_frame.js
+++ b/browser/base/content/test/general/browser_save_video_frame.js
@@ -93,17 +93,17 @@ add_task(async function() {
 
   // Make sure that we clean these things up when we're done.
   registerCleanupFunction(function() {
     mockTransferRegisterer.unregister();
     MockFilePicker.cleanup();
     destDir.remove(true);
   });
 
-  let tab = gBrowser.addTab();
+  let tab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = tab;
   let browser = tab.linkedBrowser;
   info("Loading video tab");
   await promiseTabLoadEvent(tab, VIDEO_URL);
   info("Video tab loaded.");
 
   let context = document.getElementById("contentAreaContextMenu");
   let popupPromise = promisePopupShown(context);
--- a/browser/base/content/test/general/browser_selectTabAtIndex.js
+++ b/browser/base/content/test/general/browser_selectTabAtIndex.js
@@ -11,17 +11,17 @@ function test() {
   function sendAccelKey(key) {
     // Make sure the keystroke goes to chrome.
     document.activeElement.blur();
     EventUtils.synthesizeKey(key.toString(), { altKey: isLinux, accelKey: !isLinux });
   }
 
   function createTabs(count) {
     for (let n = 0; n < count; n++)
-      gBrowser.addTab();
+      BrowserTestUtils.addTab(gBrowser);
   }
 
   function testKey(key, expectedTab) {
     sendAccelKey(key);
     assertTab(expectedTab);
   }
 
   function testIndex(index, expectedTab) {
--- a/browser/base/content/test/general/browser_star_hsts.js
+++ b/browser/base/content/test/general/browser_star_hsts.js
@@ -11,17 +11,17 @@ add_task(async function test_star_redire
     let sss = Cc["@mozilla.org/ssservice;1"]
                 .getService(Ci.nsISiteSecurityService);
     sss.removeState(Ci.nsISiteSecurityService.HEADER_HSTS,
                     NetUtil.newURI("http://example.com/"), 0);
     PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
     gBrowser.removeCurrentTab();
   });
 
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   // This will add the page to the HSTS cache.
   await promiseTabLoadEvent(tab, secureURL, secureURL);
   // This should transparently be redirected to the secure page.
   await promiseTabLoadEvent(tab, unsecureURL, secureURL);
 
   await promiseStarState(BookmarkingUI.STATUS_UNSTARRED);
 
   let promiseBookmark = promiseOnBookmarkItemAdded(gBrowser.currentURI);
--- a/browser/base/content/test/general/browser_subframe_favicons_not_used.js
+++ b/browser/base/content/test/general/browser_subframe_favicons_not_used.js
@@ -1,16 +1,16 @@
 /* Make sure <link rel="..."> isn't respected in sub-frames. */
 
 function test() {
   waitForExplicitFinish();
 
   let testPath = getRootDirectory(gTestPath);
 
-  let tab = gBrowser.addTab(testPath + "file_bug970276_popup1.html");
+  let tab = BrowserTestUtils.addTab(gBrowser, testPath + "file_bug970276_popup1.html");
 
   tab.linkedBrowser.addEventListener("load", function() {
     let expectedIcon = testPath + "file_bug970276_favicon1.ico";
     is(gBrowser.getIcon(tab), expectedIcon, "Correct icon.");
 
     gBrowser.removeTab(tab);
 
     finish();
--- a/browser/base/content/test/general/browser_tabReorder.js
+++ b/browser/base/content/test/general/browser_tabReorder.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 add_task(async function() {
   let initialTabsLength = gBrowser.tabs.length;
 
-  let newTab1 = gBrowser.selectedTab = gBrowser.addTab("about:robots", {skipAnimation: true});
-  let newTab2 = gBrowser.selectedTab = gBrowser.addTab("about:about", {skipAnimation: true});
-  let newTab3 = gBrowser.selectedTab = gBrowser.addTab("about:config", {skipAnimation: true});
+  let newTab1 = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:robots", {skipAnimation: true});
+  let newTab2 = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:about", {skipAnimation: true});
+  let newTab3 = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:config", {skipAnimation: true});
   registerCleanupFunction(function() {
     while (gBrowser.tabs.length > initialTabsLength) {
       gBrowser.removeTab(gBrowser.tabs[initialTabsLength]);
     }
   });
 
   is(gBrowser.tabs.length, initialTabsLength + 3, "new tabs are opened");
   is(gBrowser.tabs[initialTabsLength], newTab1, "newTab1 position is correct");
--- a/browser/base/content/test/general/browser_tab_detach_restore.js
+++ b/browser/base/content/test/general/browser_tab_detach_restore.js
@@ -4,17 +4,17 @@ const {TabStateFlusher} = Cu.import("res
 
 add_task(async function() {
   let uri = "http://example.com/browser/browser/base/content/test/general/dummy_page.html";
 
   // Clear out the closed windows set to start
   while (SessionStore.getClosedWindowCount() > 0)
     SessionStore.forgetClosedWindow(0);
 
-  let tab = gBrowser.addTab();
+  let tab = BrowserTestUtils.addTab(gBrowser);
   tab.linkedBrowser.loadURI(uri);
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await TabStateFlusher.flush(tab.linkedBrowser);
 
   let key = tab.linkedBrowser.permanentKey;
   let win = gBrowser.replaceTabWithWindow(tab);
   await new Promise(resolve => whenDelayedStartupFinished(win, resolve));
 
--- a/browser/base/content/test/general/browser_tab_dragdrop.js
+++ b/browser/base/content/test/general/browser_tab_dragdrop.js
@@ -101,20 +101,20 @@ function checkObjectValue(browser) {
 }
 
 add_task(async function() {
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED);
 
   // create a few tabs
   let tabs = [
     gBrowser.tabs[0],
-    gBrowser.addTab("about:blank", {skipAnimation: true}),
-    gBrowser.addTab("about:blank", {skipAnimation: true}),
-    gBrowser.addTab("about:blank", {skipAnimation: true}),
-    gBrowser.addTab("about:blank", {skipAnimation: true})
+    BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true}),
+    BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true}),
+    BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true}),
+    BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true})
   ];
 
   // Initially 0 1 2 3 4
   await loadURI(tabs[1], "data:text/html;charset=utf-8,<title>tab1</title><body>tab1<iframe>");
   await loadURI(tabs[2], "data:text/plain;charset=utf-8,tab2");
   await loadURI(tabs[3], "data:text/html;charset=utf-8,<title>tab3</title><body>tab3<iframe>");
   await loadURI(tabs[4], "http://example.com/browser/browser/base/content/test/general/browser_tab_dragdrop_embed.html");
   await BrowserTestUtils.switchTab(gBrowser, tabs[3]);
--- a/browser/base/content/test/general/browser_tabfocus.js
+++ b/browser/base/content/test/general/browser_tabfocus.js
@@ -122,20 +122,20 @@ function focusElementInChild(elementid, 
     browser.messageManager.sendAsyncMessage("Browser:ChangeFocus",
                                             { id: elementid, type });
   } else {
     browser.contentDocument.getElementById(elementid)[type]();
   }
 }
 
 add_task(async function() {
-  tab1 = gBrowser.addTab();
+  tab1 = BrowserTestUtils.addTab(gBrowser);
   browser1 = gBrowser.getBrowserForTab(tab1);
 
-  tab2 = gBrowser.addTab();
+  tab2 = BrowserTestUtils.addTab(gBrowser);
   browser2 = gBrowser.getBrowserForTab(tab2);
 
   await promiseTabLoadEvent(tab1, "data:text/html," + escape(testPage1));
   await promiseTabLoadEvent(tab2, "data:text/html," + escape(testPage2));
 
   var childFocusScript = "data:,(" + focusInChild.toString() + ")();";
   browser1.messageManager.loadFrameScript(childFocusScript, true);
   browser2.messageManager.loadFrameScript(childFocusScript, true);
--- a/browser/base/content/test/general/browser_tabs_isActive.js
+++ b/browser/base/content/test/general/browser_tabs_isActive.js
@@ -35,17 +35,17 @@ function waitForMs(aMs) {
       resolve(true);
     }
   });
 }
 
 add_task(async function() {
   let url = kTestPage;
   let originalTab = gBrowser.selectedTab; // test tab
-  let newTab = gBrowser.addTab(url, {skipAnimation: true});
+  let newTab = BrowserTestUtils.addTab(gBrowser, url, {skipAnimation: true});
   let parentSide, childSide;
 
   // new tab added but not selected checks
   parentSide = getParentTabState(newTab);
   childSide = await getChildTabState(newTab);
   checkState(parentSide, childSide, false, "newly added " + url + " tab is not active");
   parentSide = getParentTabState(originalTab);
   childSide = await getChildTabState(originalTab);
@@ -95,17 +95,17 @@ add_task(async function() {
   checkState(parentSide, childSide, false, "original tab is active again after switch back");
 
   gBrowser.removeTab(newTab);
 });
 
 add_task(async function() {
   let url = "about:about";
   let originalTab = gBrowser.selectedTab; // test tab
-  let newTab = gBrowser.addTab(url, {skipAnimation: true});
+  let newTab = BrowserTestUtils.addTab(gBrowser, url, {skipAnimation: true});
   let parentSide, childSide;
 
   parentSide = getParentTabState(newTab);
   childSide = await getChildTabState(newTab);
   checkState(parentSide, childSide, false, "newly added " + url + " tab is not active");
   parentSide = getParentTabState(originalTab);
   childSide = await getChildTabState(originalTab);
   checkState(parentSide, childSide, true, "original tab is active initially");
--- a/browser/base/content/test/general/browser_tabs_owner.js
+++ b/browser/base/content/test/general/browser_tabs_owner.js
@@ -6,19 +6,19 @@ thisTestLeaksUncaughtRejectionsAndShould
 
 //
 // Whitelisting this test.
 // As part of bug 1077403, the leaking uncaught rejection should be fixed.
 //
 thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: gBrowser._finalizeTabSwitch is not a function");
 
 function test() {
-  gBrowser.addTab();
-  gBrowser.addTab();
-  gBrowser.addTab();
+  BrowserTestUtils.addTab(gBrowser);
+  BrowserTestUtils.addTab(gBrowser);
+  BrowserTestUtils.addTab(gBrowser);
 
   var tabs = gBrowser.tabs;
   var owner;
 
   is(tabs.length, 4, "4 tabs are open");
 
   owner = gBrowser.selectedTab = tabs[2];
   BrowserOpenTab();
--- a/browser/base/content/test/general/browser_unknownContentType_title.js
+++ b/browser/base/content/test/general/browser_unknownContentType_title.js
@@ -10,17 +10,17 @@ function waitForNewWindow() {
       });
     };
 
     Services.obs.addObserver(listener, "toplevel-window-ready")
   });
 }
 
 add_task(async function() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab(url);
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, url);
   let browser = tab.linkedBrowser;
   await promiseTabLoaded(gBrowser.selectedTab);
 
   is(gBrowser.contentTitle, "Test Page", "Should have the right title.")
 
   browser.loadURI(unknown_url);
   let win = await waitForNewWindow();
   is(win.location, "chrome://mozapps/content/downloads/unknownContentType.xul",
--- a/browser/base/content/test/general/browser_utilityOverlay.js
+++ b/browser/base/content/test/general/browser_utilityOverlay.js
@@ -95,17 +95,17 @@ function test_openNewTabWith() {
   BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
     is(tab.linkedBrowser.currentURI.spec, "http://example.com/", "example.com loaded");
     gBrowser.removeCurrentTab();
     runNextTest();
   });
 }
 
 function test_openUILink() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
     is(tab.linkedBrowser.currentURI.spec, "http://example.org/", "example.org loaded");
     gBrowser.removeCurrentTab();
     runNextTest();
   });
 
   openUILink("http://example.org/"); // defaults to "current"
 }
--- a/browser/base/content/test/general/browser_visibleFindSelection.js
+++ b/browser/base/content/test/general/browser_visibleFindSelection.js
@@ -1,14 +1,14 @@
 add_task(async function() {
   const childContent = "<div style='position: absolute; left: 2200px; background: green; width: 200px; height: 200px;'>" +
                        "div</div><div  style='position: absolute; left: 0px; background: red; width: 200px; height: 200px;'>" +
                        "<span id='s'>div</span></div>";
 
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   await promiseTabLoadEvent(tab, "data:text/html," + escape(childContent));
   await SimpleTest.promiseFocus(gBrowser.selectedBrowser.contentWindowAsCPOW);
 
   let findBarOpenPromise = promiseWaitForEvent(gBrowser, "findbaropen");
   EventUtils.synthesizeKey("f", { accelKey: true });
   await findBarOpenPromise;
 
--- a/browser/base/content/test/general/browser_visibleTabs.js
+++ b/browser/base/content/test/general/browser_visibleTabs.js
@@ -4,20 +4,20 @@
 
 "use strict";
 
 add_task(function* () {
   // There should be one tab when we start the test
   let [origTab] = gBrowser.visibleTabs;
 
   // Add a tab that will get pinned
-  let pinned = gBrowser.addTab();
+  let pinned = BrowserTestUtils.addTab(gBrowser);
   gBrowser.pinTab(pinned);
 
-  let testTab = gBrowser.addTab();
+  let testTab = BrowserTestUtils.addTab(gBrowser);
 
   let visible = gBrowser.visibleTabs;
   is(visible.length, 3, "3 tabs should be open");
   is(visible[0], pinned, "the pinned tab is first");
   is(visible[1], origTab, "original tab is next");
   is(visible[2], testTab, "last created tab is last");
 
   // Only show the test tab (but also get pinned and selected)
--- a/browser/base/content/test/general/browser_visibleTabs_bookmarkAllPages.js
+++ b/browser/base/content/test/general/browser_visibleTabs_bookmarkAllPages.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function test() {
   waitForExplicitFinish();
 
-  let tabOne = gBrowser.addTab("about:blank");
-  let tabTwo = gBrowser.addTab("http://mochi.test:8888/");
+  let tabOne = BrowserTestUtils.addTab(gBrowser, "about:blank");
+  let tabTwo = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/");
   gBrowser.selectedTab = tabTwo;
 
   let browser = gBrowser.getBrowserForTab(tabTwo);
   let onLoad = function() {
     browser.removeEventListener("load", onLoad, true);
 
     gBrowser.showOnlyTheseTabs([tabTwo]);
 
--- a/browser/base/content/test/general/browser_visibleTabs_bookmarkAllTabs.js
+++ b/browser/base/content/test/general/browser_visibleTabs_bookmarkAllTabs.js
@@ -6,34 +6,34 @@ function test() {
   waitForExplicitFinish();
 
   // There should be one tab when we start the test
   let [origTab] = gBrowser.visibleTabs;
   is(gBrowser.visibleTabs.length, 1, "1 tab should be open");
   is(Disabled(), true, "Bookmark All Tabs should be disabled");
 
   // Add a tab
-  let testTab1 = gBrowser.addTab();
+  let testTab1 = BrowserTestUtils.addTab(gBrowser);
   is(gBrowser.visibleTabs.length, 2, "2 tabs should be open");
   is(Disabled(), true, "Bookmark All Tabs should be disabled since there are two tabs with the same address");
 
-  let testTab2 = gBrowser.addTab("about:mozilla");
+  let testTab2 = BrowserTestUtils.addTab(gBrowser, "about:mozilla");
   is(gBrowser.visibleTabs.length, 3, "3 tabs should be open");
   // Wait for tab load, the code checks for currentURI.
   testTab2.linkedBrowser.addEventListener("load", function() {
     is(Disabled(), false, "Bookmark All Tabs should be enabled since there are two tabs with different addresses");
 
     // Hide the original tab
     gBrowser.selectedTab = testTab2;
     gBrowser.showOnlyTheseTabs([testTab2]);
     is(gBrowser.visibleTabs.length, 1, "1 tab should be visible");
     is(Disabled(), true, "Bookmark All Tabs should be disabled as there is only one visible tab");
 
     // Add a tab that will get pinned
-    let pinned = gBrowser.addTab();
+    let pinned = BrowserTestUtils.addTab(gBrowser);
     is(gBrowser.visibleTabs.length, 2, "2 tabs should be visible now");
     is(Disabled(), false, "Bookmark All Tabs should be available as there are two visible tabs");
     gBrowser.pinTab(pinned);
     is(Hidden(), false, "Bookmark All Tabs should be visible on a normal tab");
     is(Disabled(), true, "Bookmark All Tabs should not be available since one tab is pinned");
     gBrowser.selectedTab = pinned;
     is(Hidden(), true, "Bookmark All Tabs should be hidden on a pinned tab");
 
--- a/browser/base/content/test/general/browser_visibleTabs_contextMenu.js
+++ b/browser/base/content/test/general/browser_visibleTabs_contextMenu.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const remoteClientsFixture = [ { id: 1, name: "Foo"}, { id: 2, name: "Bar"} ];
 
 add_task(async function test() {
   // There should be one tab when we start the test
   let [origTab] = gBrowser.visibleTabs;
   is(gBrowser.visibleTabs.length, 1, "there is one visible tab");
-  let testTab = gBrowser.addTab();
+  let testTab = BrowserTestUtils.addTab(gBrowser);
   is(gBrowser.visibleTabs.length, 2, "there are now two visible tabs");
 
   // Check the context menu with two tabs
   updateTabContextMenu(origTab);
   is(document.getElementById("context_closeTab").disabled, false, "Close Tab is enabled");
   is(document.getElementById("context_reloadAllTabs").disabled, false, "Reload All Tabs is enabled");
 
 
@@ -45,17 +45,17 @@ add_task(async function test() {
 
   // Check the context menu with one tab.
   updateTabContextMenu(testTab);
   is(document.getElementById("context_closeTab").disabled, false, "Close Tab is enabled when more than one tab exists");
   is(document.getElementById("context_reloadAllTabs").disabled, true, "Reload All Tabs is disabled");
 
   // Add a tab that will get pinned
   // So now there's one pinned tab, one visible unpinned tab, and one hidden tab
-  let pinned = gBrowser.addTab();
+  let pinned = BrowserTestUtils.addTab(gBrowser);
   gBrowser.pinTab(pinned);
   is(gBrowser.visibleTabs.length, 2, "now there are two visible tabs");
 
   // Check the context menu on the unpinned visible tab
   updateTabContextMenu(testTab);
   is(document.getElementById("context_closeOtherTabs").disabled, true, "Close Other Tabs is disabled");
   is(document.getElementById("context_closeTabsToTheEnd").disabled, true, "Close Tabs To The End is disabled");
 
--- a/browser/base/content/test/general/browser_visibleTabs_tabPreview.js
+++ b/browser/base/content/test/general/browser_visibleTabs_tabPreview.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 add_task(function* test() {
   gPrefService.setBoolPref("browser.ctrlTab.previews", true);
 
   let [origTab] = gBrowser.visibleTabs;
-  let tabOne = gBrowser.addTab();
-  let tabTwo = gBrowser.addTab();
+  let tabOne = BrowserTestUtils.addTab(gBrowser);
+  let tabTwo = BrowserTestUtils.addTab(gBrowser);
 
   // test the ctrlTab.tabList
   pressCtrlTab();
   ok(ctrlTab.tabList.length, 3, "Show 3 tabs in tab preview");
   releaseCtrl();
 
   gBrowser.showOnlyTheseTabs([origTab]);
   pressCtrlTab();
--- a/browser/base/content/test/general/browser_web_channel.js
+++ b/browser/base/content/test/general/browser_web_channel.js
@@ -28,17 +28,17 @@ var gTests = [
         channel.listen(function(id, message, target) {
           is(id, "generic");
           is(message.something.nested, "hello");
           channel.stopListening();
           gBrowser.removeTab(tab);
           resolve();
         });
 
-        tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?generic");
+        tab = BrowserTestUtils.addTab(gBrowser, HTTP_PATH + HTTP_ENDPOINT + "?generic");
       });
     }
   },
   {
     desc: "WebChannel generic message in a private window.",
     async run() {
       let promiseTestDone = new Promise(function(resolve, reject) {
         let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH));
@@ -75,17 +75,17 @@ var gTests = [
           if (message.command === "two") {
             is(message.detail.data.nested, true);
             channel.stopListening();
             gBrowser.removeTab(tab);
             resolve();
           }
         });
 
-        tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?twoway");
+        tab = BrowserTestUtils.addTab(gBrowser, HTTP_PATH + HTTP_ENDPOINT + "?twoway");
       });
     }
   },
   {
     desc: "WebChannel two way communication in an iframe",
     async run() {
       let parentChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
       let iframeChannel = new WebChannel("twoway", Services.io.newURI(HTTP_IFRAME_PATH));
@@ -190,17 +190,17 @@ var gTests = [
         let channel = new WebChannel("multichannel", Services.io.newURI(HTTP_PATH));
 
         channel.listen(function(id, message, sender) {
           is(id, "multichannel");
           gBrowser.removeTab(tab);
           resolve();
         });
 
-        tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?multichannel");
+        tab = BrowserTestUtils.addTab(gBrowser, HTTP_PATH + HTTP_ENDPOINT + "?multichannel");
       });
     }
   },
   {
     desc: "WebChannel unsolicited send, using system principal",
     async run() {
       let channel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
 
--- a/browser/base/content/test/general/browser_windowactivation.js
+++ b/browser/base/content/test/general/browser_windowactivation.js
@@ -13,17 +13,17 @@ var browser1, browser2;
 
 add_task(async function reallyRunTests() {
 
   let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, testPage);
   browser1 = tab1.linkedBrowser;
 
   // This can't use openNewForegroundTab because if we focus tab2 now, we
   // won't send a focus event during test 6, further down in this file.
-  let tab2 = gBrowser.addTab(testPage);
+  let tab2 = BrowserTestUtils.addTab(gBrowser, testPage);
   browser2 = tab2.linkedBrowser;
   await BrowserTestUtils.browserLoaded(browser2);
 
   browser1.messageManager.loadFrameScript("data:,(" + childFunction.toString() + ")();", true);
   browser2.messageManager.loadFrameScript("data:,(" + childFunction.toString() + ")();", true);
 
   gURLBar.focus();
 
--- a/browser/base/content/test/general/browser_zbug569342.js
+++ b/browser/base/content/test/general/browser_zbug569342.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var gTab = null;
 
 function load(url, cb) {
-  gTab = gBrowser.addTab(url);
+  gTab = BrowserTestUtils.addTab(gBrowser, url);
   gBrowser.addEventListener("load", function(event) {
     if (event.target.location != url)
       return;
 
     gBrowser.removeEventListener("load", arguments.callee, true);
     // Trigger onLocationChange by switching tabs.
     gBrowser.selectedTab = gTab;
     cb();
--- a/browser/base/content/test/newtab/browser_newtab_bug1271075.js
+++ b/browser/base/content/test/newtab/browser_newtab_bug1271075.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 add_task(async function() {
   is(gBrowser.tabs.length, 1, "one tab is open initially");
 
   // Add a few tabs.
   let tabs = [];
   function addTab(aURL, aReferrer) {
-    let tab = gBrowser.addTab(aURL, {referrerURI: aReferrer});
+    let tab = BrowserTestUtils.addTab(gBrowser, aURL, {referrerURI: aReferrer});
     tabs.push(tab);
     return BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   }
 
   await addTab("http://mochi.test:8888/#0");
   await addTab("http://mochi.test:8888/#1");
   await addTab("http://mochi.test:8888/#2");
   await addTab("http://mochi.test:8888/#3");
--- a/browser/base/content/test/newtab/browser_newtab_reflow_load.js
+++ b/browser/base/content/test/newtab/browser_newtab_reflow_load.js
@@ -6,17 +6,17 @@
 const FRAME_SCRIPT = getRootDirectory(gTestPath) + "content-reflows.js";
 const ADDITIONAL_WAIT_MS = 2000;
 
 /*
  * Ensure that loading about:newtab doesn't cause uninterruptible reflows.
  */
 add_task(async function() {
   await BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
-    return gBrowser.selectedTab = gBrowser.addTab("about:blank", {animate: false});
+    return gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {animate: false});
   }, false);
 
   let browser = gBrowser.selectedBrowser;
   let mm = browser.messageManager;
   mm.loadFrameScript(FRAME_SCRIPT, true);
   mm.addMessageListener("newtab-reflow", ({data: stack}) => {
     ok(false, `unexpected uninterruptible reflow ${stack}`);
   });
--- a/browser/base/content/test/pageinfo/browser_pageInfo.js
+++ b/browser/base/content/test/pageinfo/browser_pageInfo.js
@@ -1,14 +1,14 @@
 function test() {
   waitForExplicitFinish();
 
   var pageInfo;
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedBrowser.addEventListener("load", function() {
     Services.obs.addObserver(observer, "page-info-dialog-loaded");
     pageInfo = BrowserPageInfo();
   }, {capture: true, once: true});
   content.location =
     "https://example.com/browser/browser/base/content/test/pageinfo/feed_tab.html";
 
   function observer(win, topic, data) {
--- a/browser/base/content/test/pageinfo/browser_pageinfo_image_info.js
+++ b/browser/base/content/test/pageinfo/browser_pageinfo_image_info.js
@@ -1,14 +1,14 @@
 /* Make sure that "View Image Info" loads the correct image data */
 
 function test() {
   waitForExplicitFinish();
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   gBrowser.selectedBrowser.addEventListener("load", function() {
     var doc = gBrowser.contentDocument;
     var testImg = doc.getElementById("test-image");
     var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
                                    "mediaTab", testImg);
 
     pageInfo.addEventListener("load", function() {
--- a/browser/base/content/test/pageinfo/browser_pageinfo_images.js
+++ b/browser/base/content/test/pageinfo/browser_pageinfo_images.js
@@ -1,14 +1,14 @@
 /* Check proper image url retrieval from all kinds of elements/styles */
 
 function test() {
   waitForExplicitFinish();
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   gBrowser.selectedBrowser.addEventListener("load", function() {
     var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
                                    "mediaTab");
 
     pageInfo.addEventListener("load", function() {
       pageInfo.onFinished.push(function() {
         executeSoon(function() {
--- a/browser/base/content/test/pageinfo/browser_pageinfo_svg_image.js
+++ b/browser/base/content/test/pageinfo/browser_pageinfo_svg_image.js
@@ -1,12 +1,12 @@
 function test() {
   waitForExplicitFinish();
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   gBrowser.selectedBrowser.addEventListener("load", function() {
     var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
                                    "mediaTab");
 
     pageInfo.addEventListener("load", function() {
       pageInfo.onFinished.push(function() {
         executeSoon(function() {
--- a/browser/base/content/test/plugins/browser_CTP_context_menu.js
+++ b/browser/base/content/test/plugins/browser_CTP_context_menu.js
@@ -12,17 +12,17 @@ add_task(async function() {
     window.focus();
   });
 });
 
 // Test that the activate action in content menus for CTP plugins works
 add_task(async function() {
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   let bindingPromise = waitForEvent(gBrowser.selectedBrowser, "PluginBindingAttached", null, true, true);
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_test.html");
   await promiseUpdatePluginBindings(gBrowser.selectedBrowser);
   await bindingPromise;
 
--- a/browser/base/content/test/plugins/browser_CTP_data_urls.js
+++ b/browser/base/content/test/plugins/browser_CTP_data_urls.js
@@ -10,17 +10,17 @@ add_task(async function() {
     setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
     Services.prefs.clearUserPref("plugins.click_to_play");
     Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
     gBrowser.removeCurrentTab();
     window.focus();
     gTestBrowser = null;
   });
 
-  gBrowser.selectedTab =  gBrowser.addTab();
+  gBrowser.selectedTab =  BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
 });
--- a/browser/base/content/test/plugins/browser_CTP_drag_drop.js
+++ b/browser/base/content/test/plugins/browser_CTP_drag_drop.js
@@ -13,17 +13,17 @@ add_task(async function() {
     window.focus();
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_test.html");
 
   // Work around for delayed PluginBindingAttached
   await promiseUpdatePluginBindings(gBrowser.selectedBrowser);
 
@@ -38,17 +38,17 @@ add_task(async function() {
 
   await promisePopupNotification("click-to-play-plugins", gNewWindow.gBrowser.selectedBrowser);
 
   ok(PopupNotifications.getNotification("click-to-play-plugins", gNewWindow.gBrowser.selectedBrowser), "Should have a click-to-play notification in the tab in the new window");
   ok(!PopupNotifications.getNotification("click-to-play-plugins", gBrowser.selectedBrowser), "Should not have a click-to-play notification in the old window now");
 });
 
 add_task(async function() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, gNewWindow.gBrowser.selectedTab);
 
   await promisePopupNotification("click-to-play-plugins", gBrowser.selectedBrowser);
 
   ok(PopupNotifications.getNotification("click-to-play-plugins", gBrowser.selectedBrowser), "Should have a click-to-play notification in the initial tab again");
 
   // Work around for delayed PluginBindingAttached
   await promiseUpdatePluginBindings(gBrowser.selectedBrowser);
--- a/browser/base/content/test/plugins/browser_CTP_hide_overlay.js
+++ b/browser/base/content/test/plugins/browser_CTP_hide_overlay.js
@@ -12,17 +12,17 @@ add_task(async function() {
     gBrowser.removeCurrentTab();
     window.focus();
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
 
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_test.html");
 
--- a/browser/base/content/test/plugins/browser_CTP_iframe.js
+++ b/browser/base/content/test/plugins/browser_CTP_iframe.js
@@ -11,17 +11,17 @@ add_task(async function() {
     gBrowser.removeCurrentTab();
     window.focus();
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_iframe.html");
 
   // Tests that the overlays are visible and actionable if the plugin is in an iframe.
 
--- a/browser/base/content/test/plugins/browser_CTP_multi_allow.js
+++ b/browser/base/content/test/plugins/browser_CTP_multi_allow.js
@@ -12,17 +12,17 @@ add_task(async function() {
     gBrowser.removeCurrentTab();
     window.focus();
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
 
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_two_types.html");
 
   // Work around for delayed PluginBindingAttached
--- a/browser/base/content/test/plugins/browser_CTP_nonplugins.js
+++ b/browser/base/content/test/plugins/browser_CTP_nonplugins.js
@@ -13,17 +13,17 @@ add_task(async function() {
     window.focus();
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_DISABLED, "Test Plug-in");
 
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_two_types.html");
 
   // Work around for delayed PluginBindingAttached
   await promiseUpdatePluginBindings(gBrowser.selectedBrowser);
 
--- a/browser/base/content/test/plugins/browser_CTP_notificationBar.js
+++ b/browser/base/content/test/plugins/browser_CTP_notificationBar.js
@@ -11,17 +11,17 @@ add_task(async function() {
     Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
     gBrowser.removeCurrentTab();
     window.focus();
     gTestBrowser = null;
   });
 
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  let newTab = gBrowser.addTab();
+  let newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
--- a/browser/base/content/test/plugins/browser_CTP_outsideScrollArea.js
+++ b/browser/base/content/test/plugins/browser_CTP_outsideScrollArea.js
@@ -15,17 +15,17 @@ add_task(async function() {
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  let newTab = gBrowser.addTab();
+  let newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
   ok(!popupNotification, "Test 1, Should not have a click-to-play notification");
 });
--- a/browser/base/content/test/plugins/browser_CTP_remove_navigate.js
+++ b/browser/base/content/test/plugins/browser_CTP_remove_navigate.js
@@ -20,17 +20,17 @@ add_task(async function() {
 });
 
 /**
  * Tests that if a plugin is removed just as we transition to
  * a different page, that we don't show the hidden plugin
  * notification bar on the new page.
  */
 add_task(async function() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   // Load up a page with a plugin...
   let notificationPromise = waitForNotificationBar("plugin-hidden", gBrowser.selectedBrowser);
   await promiseTabLoadEvent(gBrowser.selectedTab, gHttpTestRoot + "plugin_small.html");
   await promiseUpdatePluginBindings(gBrowser.selectedBrowser);
   await notificationPromise;
 
   // Trigger the PluginRemoved event to be fired, and then immediately
--- a/browser/base/content/test/plugins/browser_CTP_resize.js
+++ b/browser/base/content/test/plugins/browser_CTP_resize.js
@@ -14,17 +14,17 @@ add_task(async function() {
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  let newTab = gBrowser.addTab();
+  let newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
   ok(!popupNotification, "Test 1, Should not have a click-to-play notification");
 
--- a/browser/base/content/test/plugins/browser_CTP_zoom.js
+++ b/browser/base/content/test/plugins/browser_CTP_zoom.js
@@ -18,17 +18,17 @@ add_task(async function() {
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   let popupNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
   ok(!popupNotification, "Test 1, Should not have a click-to-play notification");
 
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_zoom.html");
--- a/browser/base/content/test/plugins/browser_blocking.js
+++ b/browser/base/content/test/plugins/browser_blocking.js
@@ -17,17 +17,17 @@ add_task(async function() {
     resetBlocklist();
     gBrowser.removeCurrentTab();
     window.focus();
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   updateAllTestPlugins(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
 
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
   // Prime the content process
--- a/browser/base/content/test/plugins/browser_blocklist_content.js
+++ b/browser/base/content/test/plugins/browser_blocklist_content.js
@@ -16,17 +16,17 @@ add_task(async function() {
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
 
   // Prime the blocklist service, the remote service doesn't launch on startup.
   await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html></html>");
   let exmsg = await promiseInitContentBlocklistSvc(gBrowser.selectedBrowser);
--- a/browser/base/content/test/plugins/browser_bug743421.js
+++ b/browser/base/content/test/plugins/browser_bug743421.js
@@ -11,17 +11,17 @@ add_task(async function() {
     resetBlocklist();
     gBrowser.removeCurrentTab();
     window.focus();
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
-  let newTab = gBrowser.addTab();
+  let newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
 
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
--- a/browser/base/content/test/plugins/browser_bug744745.js
+++ b/browser/base/content/test/plugins/browser_bug744745.js
@@ -18,17 +18,17 @@ add_task(async function() {
     setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
     gBrowser.removeCurrentTab();
     window.focus();
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   gTestBrowser.addEventListener("PluginBindingAttached", pluginBindingAttached, true, true);
 
--- a/browser/base/content/test/plugins/browser_bug787619.js
+++ b/browser/base/content/test/plugins/browser_bug787619.js
@@ -12,17 +12,17 @@ add_task(async function() {
     window.focus();
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   let testRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
   await promiseTabLoadEvent(gBrowser.selectedTab, testRoot + "plugin_bug787619.html");
 
   // Due to layout being async, "PluginBindAttached" may trigger later.
--- a/browser/base/content/test/plugins/browser_bug797677.js
+++ b/browser/base/content/test/plugins/browser_bug797677.js
@@ -11,17 +11,17 @@ add_task(async function() {
     setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
     setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
     consoleService.unregisterListener(errorListener);
     gBrowser.removeCurrentTab();
     window.focus();
     gTestBrowser = null;
   });
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   let consoleService = Cc["@mozilla.org/consoleservice;1"]
                          .getService(Ci.nsIConsoleService);
   let errorListener = {
     observe(aMessage) {
       if (aMessage.message.includes("NS_ERROR_FAILURE"))
         gConsoleErrors++;
--- a/browser/base/content/test/plugins/browser_bug812562.js
+++ b/browser/base/content/test/plugins/browser_bug812562.js
@@ -8,17 +8,17 @@ add_task(async function() {
     setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
     await asyncSetAndUpdateBlocklist(gTestRoot + "blockNoPlugins.xml", gTestBrowser);
     resetBlocklist();
     Services.prefs.clearUserPref("plugins.click_to_play");
     gBrowser.removeCurrentTab();
     window.focus();
     gTestBrowser = null;
   });
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   // Prime the blocklist service, the remote service doesn't launch on startup.
   await promiseTabLoadEvent(gBrowser.selectedTab, "data:text/html,<html></html>");
   let exmsg = await promiseInitContentBlocklistSvc(gBrowser.selectedBrowser);
--- a/browser/base/content/test/plugins/browser_bug818118.js
+++ b/browser/base/content/test/plugins/browser_bug818118.js
@@ -11,17 +11,17 @@ add_task(async function() {
     window.focus();
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
 
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_both.html");
 
   // Work around for delayed PluginBindingAttached
   await promiseUpdatePluginBindings(gTestBrowser);
--- a/browser/base/content/test/plugins/browser_bug820497.js
+++ b/browser/base/content/test/plugins/browser_bug820497.js
@@ -12,17 +12,17 @@ add_task(async function() {
     window.focus();
     gTestBrowser = null;
   });
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
 
   gTestBrowser.addEventListener("PluginBindingAttached", function() { gNumPluginBindingsAttached++ }, true, true);
 
   await promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_bug820497.html");
--- a/browser/base/content/test/plugins/browser_clearplugindata.js
+++ b/browser/base/content/test/plugins/browser_clearplugindata.js
@@ -67,17 +67,17 @@ function setPrefs(cookies, pluginData) {
   itemPrefs.setBoolPref("passwords", false);
   itemPrefs.setBoolPref("sessions", false);
   itemPrefs.setBoolPref("siteSettings", false);
   itemPrefs.setBoolPref("pluginData", pluginData);
 }
 
 async function testClearingData(url) {
   // Load page to set data for the plugin.
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   await promiseTabLoadEvent(gBrowser.selectedTab, url);
 
   await promiseUpdatePluginBindings(gTestBrowser);
 
   ok(stored(["foo.com", "bar.com", "baz.com", "qux.com"]),
     "Data stored for sites");
--- a/browser/base/content/test/plugins/browser_pageInfo_plugins.js
+++ b/browser/base/content/test/plugins/browser_pageInfo_plugins.js
@@ -52,17 +52,17 @@ function finishTest() {
   executeSoon(finish);
 }
 
 function test() {
   waitForExplicitFinish();
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
   gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gTestPermissionString);
   gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gSecondTestPermissionString);
   doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart1a);
 }
 
 // The first test plugin is CtP and the second test plugin is enabled.
 function testPart1a() {
--- a/browser/base/content/test/plugins/browser_pluginCrashCommentAndURL.js
+++ b/browser/base/content/test/plugins/browser_pluginCrashCommentAndURL.js
@@ -14,17 +14,17 @@ add_task(async function() {
   // which CrashSubmit.jsm uses as a server override.
   let env = Components.classes["@mozilla.org/process/environment;1"]
                       .getService(Components.interfaces.nsIEnvironment);
   let noReport = env.get("MOZ_CRASHREPORTER_NO_REPORT");
   let serverUrl = env.get("MOZ_CRASHREPORTER_URL");
   env.set("MOZ_CRASHREPORTER_NO_REPORT", "");
   env.set("MOZ_CRASHREPORTER_URL", SERVER_URL);
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   // Crash immediately
   Services.prefs.setIntPref("dom.ipc.plugins.timeoutSecs", 0);
 
   registerCleanupFunction(async function() {
     Services.prefs.clearUserPref("dom.ipc.plugins.timeoutSecs");
     env.set("MOZ_CRASHREPORTER_NO_REPORT", noReport);
--- a/browser/base/content/test/plugins/browser_plugin_reloading.js
+++ b/browser/base/content/test/plugins/browser_plugin_reloading.js
@@ -17,17 +17,17 @@ add_task(async function() {
     resetBlocklist();
     gTestBrowser = null;
     gBrowser.removeCurrentTab();
     window.focus();
   });
 });
 
 add_task(async function() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
   updateAllTestPlugins(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
 
   // Prime the blocklist service, the remote service doesn't launch on startup.
--- a/browser/base/content/test/plugins/browser_pluginnotification.js
+++ b/browser/base/content/test/plugins/browser_pluginnotification.js
@@ -17,17 +17,17 @@ add_task(async function() {
     resetBlocklist();
     gTestBrowser = null;
     gBrowser.removeCurrentTab();
     window.focus();
   });
 });
 
 add_task(async function() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gTestBrowser = gBrowser.selectedBrowser;
 
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
   updateAllTestPlugins(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
 
   // Prime the blocklist service, the remote service doesn't launch on startup.
--- a/browser/base/content/test/plugins/browser_plugins_added_dynamically.js
+++ b/browser/base/content/test/plugins/browser_plugins_added_dynamically.js
@@ -16,17 +16,17 @@ add_task(async function() {
     window.focus();
     gTestBrowser = null;
   });
 });
 
 // "Activate" of a given type -> plugins of that type dynamically added should
 // automatically play.
 add_task(async function() {
-  let newTab = gBrowser.addTab();
+  let newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
 
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
   Services.prefs.setBoolPref("plugins.click_to_play", true);
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
--- a/browser/base/content/test/plugins/browser_private_clicktoplay.js
+++ b/browser/base/content/test/plugins/browser_private_clicktoplay.js
@@ -31,17 +31,17 @@ let createPrivateWindow = async function
 
 add_task(async function test() {
   registerCleanupFunction(function() {
     clearAllPluginPermissions();
     getTestPlugin().enabledState = Ci.nsIPluginTag.STATE_ENABLED;
     getTestPlugin("Second Test Plug-in").enabledState = Ci.nsIPluginTag.STATE_ENABLED;
   });
 
-  let newTab = gBrowser.addTab();
+  let newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
   let promise = BrowserTestUtils.browserLoaded(gTestBrowser);
 
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   getTestPlugin().enabledState = Ci.nsIPluginTag.STATE_CLICKTOPLAY;
   getTestPlugin("Second Test Plug-in").enabledState = Ci.nsIPluginTag.STATE_CLICKTOPLAY;
   await promise;
--- a/browser/base/content/test/popupNotifications/browser_popupNotification.js
+++ b/browser/base/content/test/popupNotifications/browser_popupNotification.js
@@ -104,17 +104,17 @@ var tests = [
       this.notification.remove();
       ok(this.notifyObj.removedCallbackTriggered, "removed callback triggered");
     }
   },
   // test opening a notification for a background browser
   // Note: test 4 to 6 share a tab.
   { id: "Test#4",
     async run() {
-      let tab = gBrowser.addTab("http://example.com/");
+      let tab = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
       await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
       isnot(gBrowser.selectedTab, tab, "new tab isn't selected");
       wrongBrowserNotificationObject.browser = gBrowser.getBrowserForTab(tab);
       let promiseTopic = promiseTopicObserved("PopupNotifications-backgroundShow");
       wrongBrowserNotification = showNotification(wrongBrowserNotificationObject);
       await promiseTopic;
       is(PopupNotifications.isPanelOpen, false, "panel isn't open");
       ok(!wrongBrowserNotificationObject.mainActionClicked, "main action wasn't clicked");
--- a/browser/base/content/test/popupNotifications/browser_reshow_in_background.js
+++ b/browser/base/content/test/popupNotifications/browser_reshow_in_background.js
@@ -4,20 +4,20 @@
  * Tests that when PopupNotifications for background tabs are reshown, they
  * don't show up in the foreground tab, but only in the background tab that
  * they belong to.
  */
 add_task(async function test_background_notifications_dont_reshow_in_foreground() {
   // Our initial tab will be A. Let's open two more tabs B and C, but keep
   // A selected. Then, we'll trigger a PopupNotification in C, and then make
   // it reshow.
-  let tabB = gBrowser.addTab("http://example.com/");
+  let tabB = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
   await BrowserTestUtils.browserLoaded(tabB.linkedBrowser);
 
-  let tabC = gBrowser.addTab("http://example.com/");
+  let tabC = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
   await BrowserTestUtils.browserLoaded(tabC.linkedBrowser);
 
   let seenEvents = [];
 
   let options = {
     dismissed: false,
     eventCallback(popupEvent) {
       seenEvents.push(popupEvent);
--- a/browser/base/content/test/siteIdentity/browser_bug1045809.js
+++ b/browser/base/content/test/siteIdentity/browser_bug1045809.js
@@ -12,17 +12,17 @@ add_task(async function() {
   });
 
   // Store original preferences so we can restore settings after testing
   origBlockActive = Services.prefs.getBoolPref(PREF_ACTIVE);
 
   // Make sure mixed content blocking is on
   Services.prefs.setBoolPref(PREF_ACTIVE, true);
 
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   // Test 1: mixed content must be blocked
   await promiseTabLoadEvent(tab, TEST_URL);
   await test1(gBrowser.getBrowserForTab(tab));
 
   await promiseTabLoadEvent(tab);
   // Test 2: mixed content must NOT be blocked
   await test2(gBrowser.getBrowserForTab(tab));
--- a/browser/base/content/test/siteIdentity/browser_bug435035.js
+++ b/browser/base/content/test/siteIdentity/browser_bug435035.js
@@ -1,14 +1,14 @@
 const TEST_URL = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com") + "test_bug435035.html";
 
 function test() {
   waitForExplicitFinish();
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
     is(document.getElementById("identity-box").className,
        "unknownIdentity mixedDisplayContent",
        "identity box has class name for mixed content");
 
     gBrowser.removeCurrentTab();
     finish();
   });
--- a/browser/base/content/test/siteIdentity/browser_bug822367.js
+++ b/browser/base/content/test/siteIdentity/browser_bug822367.js
@@ -11,17 +11,17 @@ const HTTPS_TEST_ROOT = getRootDirectory
 const HTTPS_TEST_ROOT_2 = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://test1.example.com");
 
 var gTestBrowser = null;
 
 add_task(async function test() {
   await SpecialPowers.pushPrefEnv({ set: [[ PREF_DISPLAY, true ],
                                           [ PREF_ACTIVE, true  ]] });
 
-  var newTab = gBrowser.addTab();
+  var newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
   newTab.linkedBrowser.stop()
 
   // Mixed Script Test
   var url = HTTPS_TEST_ROOT + "file_bug822367_1.html";
   BrowserTestUtils.loadURI(gTestBrowser, url);
   await BrowserTestUtils.browserLoaded(gTestBrowser);
--- a/browser/base/content/test/siteIdentity/browser_bug902156.js
+++ b/browser/base/content/test/siteIdentity/browser_bug902156.js
@@ -157,17 +157,17 @@ function test() {
   waitForExplicitFinish();
 
   // Store original preferences so we can restore settings after testing
   origBlockActive = Services.prefs.getBoolPref(PREF_ACTIVE);
 
   Services.prefs.setBoolPref(PREF_ACTIVE, true);
 
   // Not really sure what this is doing
-  var newTab = gBrowser.addTab();
+  var newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
   newTab.linkedBrowser.stop()
 
   // Starting Test Number 1:
   BrowserTestUtils.browserLoaded(gTestBrowser).then(test1A);
   var url = HTTPS_TEST_ROOT_1 + "file_bug902156_1.html";
   gTestBrowser.loadURI(url);
--- a/browser/base/content/test/siteIdentity/browser_csp_block_all_mixedcontent.js
+++ b/browser/base/content/test/siteIdentity/browser_csp_block_all_mixedcontent.js
@@ -27,17 +27,17 @@ function verifyUInotDegraded() {
     }
   );
   // clean up and finish test
   cleanUpAfterTests();
 }
 
 // ------------------------------------------------------
 function runTests() {
-  var newTab = gBrowser.addTab();
+  var newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
   newTab.linkedBrowser.stop();
 
   // Starting the test
   BrowserTestUtils.browserLoaded(gTestBrowser).then(verifyUInotDegraded);
   var url = PRE_PATH + "file_csp_block_all_mixedcontent.html";
   gTestBrowser.loadURI(url);
--- a/browser/base/content/test/siteIdentity/browser_insecureLoginForms.js
+++ b/browser/base/content/test/siteIdentity/browser_insecureLoginForms.js
@@ -22,17 +22,17 @@ add_task(async function test_simple() {
   });
 
   for (let [origin, expectWarning] of [
     ["http://example.com", true],
     ["http://127.0.0.1", false],
     ["https://example.com", false],
   ]) {
     let testUrlPath = origin + TEST_URL_PATH;
-    let tab = gBrowser.addTab(testUrlPath + "form_basic.html");
+    let tab = BrowserTestUtils.addTab(gBrowser, testUrlPath + "form_basic.html");
     let browser = tab.linkedBrowser;
     await Promise.all([
       BrowserTestUtils.switchTab(gBrowser, tab),
       BrowserTestUtils.browserLoaded(browser),
       // One event is triggered by pageshow and one by DOMFormHasPassword.
       waitForInsecureLoginFormsStateChange(browser, 2),
     ]);
 
@@ -83,17 +83,17 @@ add_task(async function test_simple() {
  */
 add_task(async function test_mixedcontent() {
   await SpecialPowers.pushPrefEnv({
     "set": [["security.mixed_content.block_active_content", false]],
   });
 
   // Load the page with the subframe in a new tab.
   let testUrlPath = "://example.com" + TEST_URL_PATH;
-  let tab = gBrowser.addTab("https" + testUrlPath + "insecure_test.html");
+  let tab = BrowserTestUtils.addTab(gBrowser, "https" + testUrlPath + "insecure_test.html");
   let browser = tab.linkedBrowser;
   await Promise.all([
     BrowserTestUtils.switchTab(gBrowser, tab),
     BrowserTestUtils.browserLoaded(browser),
     // Two events are triggered by pageshow and one by DOMFormHasPassword.
     waitForInsecureLoginFormsStateChange(browser, 3),
   ]);
 
--- a/browser/base/content/test/siteIdentity/browser_mcb_redirect.js
+++ b/browser/base/content/test/siteIdentity/browser_mcb_redirect.js
@@ -283,15 +283,15 @@ function test() {
   waitForExplicitFinish();
 
   // Store original preferences so we can restore settings after testing
   origBlockActive = Services.prefs.getBoolPref(PREF_ACTIVE);
   origBlockDisplay = Services.prefs.getBoolPref(PREF_DISPLAY);
   Services.prefs.setBoolPref(PREF_ACTIVE, true);
   Services.prefs.setBoolPref(PREF_DISPLAY, true);
 
-  var newTab = gBrowser.addTab();
+  var newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
   newTab.linkedBrowser.stop();
 
   executeSoon(test1);
 }
--- a/browser/base/content/test/social/browser_social_activation.js
+++ b/browser/base/content/test/social/browser_social_activation.js
@@ -234,17 +234,17 @@ var tests = {
           next();
         });
       });
     });
   },
 
   testAddonManagerDoubleInstall(next) {
     // Create a new tab and load about:addons
-    let addonsTab = gBrowser.addTab();
+    let addonsTab = BrowserTestUtils.addTab(gBrowser);
     gBrowser.selectedTab = addonsTab;
     BrowserOpenAddonsMgr("addons://list/service");
     gBrowser.selectedBrowser.addEventListener("load", function() {
       is(addonsTab.linkedBrowser.currentURI.spec, "about:addons", "about:addons should load into blank tab.");
 
       activateOneProvider(gProviders[0], true, function() {
         info("first activation completed");
         is(gBrowser.contentDocument.location.href, gProviders[0].origin + "/browser/browser/base/content/test/social/social_postActivation.html", "postActivationURL loaded");
--- a/browser/base/content/test/sync/browser_aboutAccounts.js
+++ b/browser/base/content/test/sync/browser_aboutAccounts.js
@@ -413,32 +413,32 @@ function promiseOneMessage(tab, messageN
     mm.addMessageListener(messageName, function onmessage(message) {
       mm.removeMessageListener(messageName, onmessage);
       resolve(message);
     });
   });
 }
 
 function promiseNewTabLoadEvent(aUrl) {
-  let tab = gBrowser.selectedTab = gBrowser.addTab(aUrl);
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, aUrl);
   let browser = tab.linkedBrowser;
   let mm = browser.messageManager;
 
   // give it an e10s-friendly content script to help with our tests,
   // and wait for it to tell us about the load.
   let promise = promiseOneMessage(tab, "test:document:load");
   mm.loadFrameScript(CHROME_BASE + "content_aboutAccounts.js", true);
   return promise.then(() => tab);
 }
 
 // Returns a promise which is resolved with the iframe's URL after a new
 // tab is created and the iframe in that tab loads.
 function promiseNewTabWithIframeLoadEvent(aUrl) {
   return new Promise(resolve => {
-    let tab = gBrowser.selectedTab = gBrowser.addTab(aUrl);
+    let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, aUrl);
     let browser = tab.linkedBrowser;
     let mm = browser.messageManager;
 
     // give it an e10s-friendly content script to help with our tests,
     // and wait for it to tell us about the iframe load.
     mm.addMessageListener("test:iframe:load", function onFrameLoad(message) {
       mm.removeMessageListener("test:iframe:load", onFrameLoad);
       resolve([tab, message.data.url]);
--- a/browser/base/content/test/tabPrompts/browser_closeTabSpecificPanels.js
+++ b/browser/base/content/test/tabPrompts/browser_closeTabSpecificPanels.js
@@ -3,18 +3,18 @@
 /*
  * This test creates multiple panels, one that has been tagged as specific to its tab's content
  * and one that isn't. When a tab loses focus, panel specific to that tab should close.
  * The non-specific panel should remain open.
  *
  */
 
 add_task(async function() {
-  let tab1 = gBrowser.addTab("http://mochi.test:8888/#0");
-  let tab2 = gBrowser.addTab("http://mochi.test:8888/#1");
+  let tab1 = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/#0");
+  let tab2 = BrowserTestUtils.addTab(gBrowser, "http://mochi.test:8888/#1");
   let specificPanel = document.createElement("panel");
   specificPanel.setAttribute("tabspecific", "true");
   let generalPanel = document.createElement("panel");
   let anchor = document.getElementById(CustomizableUI.AREA_NAVBAR);
 
   anchor.appendChild(specificPanel);
   anchor.appendChild(generalPanel);
   is(specificPanel.state, "closed", "specificPanel starts as closed");
--- a/browser/base/content/test/tabs/browser_navigatePinnedTab.js
+++ b/browser/base/content/test/tabs/browser_navigatePinnedTab.js
@@ -4,17 +4,17 @@
 "use strict";
 
 add_task(async function() {
   // Test that changing the URL in a pinned tab works correctly
 
   let TEST_LINK_INITIAL = "about:";
   let TEST_LINK_CHANGED = "about:support";
 
-  let appTab = gBrowser.addTab(TEST_LINK_INITIAL);
+  let appTab = BrowserTestUtils.addTab(gBrowser, TEST_LINK_INITIAL);
   let browser = appTab.linkedBrowser;
   await BrowserTestUtils.browserLoaded(browser);
 
   gBrowser.pinTab(appTab);
   is(appTab.pinned, true, "Tab was successfully pinned");
 
   let initialTabsNo = gBrowser.tabs.length;
 
--- a/browser/base/content/test/tabs/browser_tabSpinnerTypeProbe.js
+++ b/browser/base/content/test/tabs/browser_tabSpinnerTypeProbe.js
@@ -112,17 +112,17 @@ add_task(async function test_unseenOld_s
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: "http://example.com",
   }, async function(browser) {
     const NEWNESS_THRESHOLD = gBrowser._getSwitcher().NEWNESS_THRESHOLD;
 
     // First, create a new background tab, ensuring that it's in the same process
     // as the current one.
-    let bgTab = gBrowser.addTab("about:blank", {
+    let bgTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {
       sameProcessAsFrameLoader: browser.frameLoader,
       inBackground: true,
     });
 
     await BrowserTestUtils.browserLoaded(bgTab.linkedBrowser);
 
     // Now, let's fudge with the creationTime of the background tab so that
     // it seems old. We'll also add a fudge-factor to the NEWNESS_THRESHOLD of 100ms
@@ -154,17 +154,17 @@ add_task(async function test_unseenOld_s
  */
 add_task(async function test_unseenNew_spinner_type_probe() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: "http://example.com",
   }, async function(browser) {
     // First, create a new background tab, ensuring that it's in the same process
     // as the current one.
-    let bgTab = gBrowser.addTab("about:blank", {
+    let bgTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {
       sameProcessAsFrameLoader: browser.frameLoader,
       inBackground: true,
     });
 
     await BrowserTestUtils.browserLoaded(bgTab.linkedBrowser);
 
     // Now, let's fudge with the creationTime of the background tab so that
     // it seems very new (created 1 minute into the future).
--- a/browser/base/content/test/tabs/browser_tabSwitchPrintPreview.js
+++ b/browser/base/content/test/tabs/browser_tabSwitchPrintPreview.js
@@ -2,17 +2,17 @@ const kURL1 = "data:text/html,Should I s
 const kURL2 = "data:text/html,I shouldn't be here!";
 
 /**
  * Verify that if we open a new tab and try to make it the selected tab while
  * print preview is up, that doesn't happen.
  */
 add_task(async function() {
   await BrowserTestUtils.withNewTab(kURL1, async function(browser) {
-    let tab = gBrowser.addTab(kURL2);
+    let tab = BrowserTestUtils.addTab(gBrowser, kURL2);
     document.getElementById("cmd_printPreview").doCommand();
     gBrowser.selectedTab = tab;
     await BrowserTestUtils.waitForCondition(() => gInPrintPreviewMode, "should be in print preview mode");
     isnot(gBrowser.selectedTab, tab, "Selected tab should not be the tab we added");
     is(gBrowser.selectedTab, PrintPreviewListener._printPreviewTab, "Selected tab should be the print preview tab");
     gBrowser.selectedTab = tab;
     isnot(gBrowser.selectedTab, tab, "Selected tab should still not be the tab we added");
     is(gBrowser.selectedTab, PrintPreviewListener._printPreviewTab, "Selected tab should still be the print preview tab");
--- a/browser/base/content/test/urlbar/browser_autocomplete_edit_completed.js
+++ b/browser/base/content/test/urlbar/browser_autocomplete_edit_completed.js
@@ -5,17 +5,17 @@ add_task(async function() {
     { uri: makeURI("http://example.com/foo") },
     { uri: makeURI("http://example.com/foo/bar") },
   ]);
 
   registerCleanupFunction(async function() {
     await PlacesTestUtils.clearHistory();
   });
 
-  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   gURLBar.focus();
 
   await promiseAutocompleteResultPopup("http://example.com");
 
   let popup = gURLBar.popup;
   let list = popup.richlistbox;
   let initialIndex = list.selectedIndex;
 
--- a/browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js
+++ b/browser/base/content/test/urlbar/browser_bug1003461-switchtab-override.js
@@ -4,17 +4,17 @@
 
 add_task(async function test_switchtab_override() {
   let testURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
 
   info("Opening first tab");
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, testURL);
 
   info("Opening and selecting second tab");
-  let secondTab = gBrowser.selectedTab = gBrowser.addTab();
+  let secondTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   registerCleanupFunction(() => {
     try {
       gBrowser.removeTab(tab);
       gBrowser.removeTab(secondTab);
     } catch (ex) { /* tabs may have already been closed in case of failure */ }
   });
 
   info("Wait for autocomplete")
--- a/browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js
+++ b/browser/base/content/test/urlbar/browser_bug1024133-switchtab-override-keynav.js
@@ -4,17 +4,17 @@
 
 add_task(async function test_switchtab_override_keynav() {
   let testURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
 
   info("Opening first tab");
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, testURL);
 
   info("Opening and selecting second tab");
-  let secondTab = gBrowser.selectedTab = gBrowser.addTab();
+  let secondTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   registerCleanupFunction(() => {
     try {
       gBrowser.removeTab(tab);
       gBrowser.removeTab(secondTab);
     } catch (ex) { /* tabs may have already been closed in case of failure */ }
     return PlacesTestUtils.clearHistory();
   });
 
--- a/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js
+++ b/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js
@@ -1,15 +1,15 @@
 add_task(async function test_switchtab_decodeuri() {
   info("Opening first tab");
   const TEST_URL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html#test%7C1";
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL);
 
   info("Opening and selecting second tab");
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   info("Wait for autocomplete")
   await promiseAutocompleteResultPopup("dummy_page");
 
   info("Select autocomplete popup entry");
   EventUtils.synthesizeKey("VK_DOWN", {});
   ok(gURLBar.value.startsWith("moz-action:switchtab"), "switch to tab entry found");
 
--- a/browser/base/content/test/urlbar/browser_bug304198.js
+++ b/browser/base/content/test/urlbar/browser_bug304198.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 add_task(async function() {
   let charsToDelete, deletedURLTab, fullURLTab, partialURLTab, testPartialURL, testURL;
 
   charsToDelete = 5;
-  deletedURLTab = gBrowser.addTab();
-  fullURLTab = gBrowser.addTab();
-  partialURLTab = gBrowser.addTab();
+  deletedURLTab = BrowserTestUtils.addTab(gBrowser);
+  fullURLTab = BrowserTestUtils.addTab(gBrowser);
+  partialURLTab = BrowserTestUtils.addTab(gBrowser);
   testURL = "http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html";
 
   let loaded1 = BrowserTestUtils.browserLoaded(deletedURLTab.linkedBrowser, testURL);
   let loaded2 = BrowserTestUtils.browserLoaded(fullURLTab.linkedBrowser, testURL);
   let loaded3 = BrowserTestUtils.browserLoaded(partialURLTab.linkedBrowser, testURL);
   deletedURLTab.linkedBrowser.loadURI(testURL);
   fullURLTab.linkedBrowser.loadURI(testURL);
   partialURLTab.linkedBrowser.loadURI(testURL);
--- a/browser/base/content/test/urlbar/browser_bug556061.js
+++ b/browser/base/content/test/urlbar/browser_bug556061.js
@@ -84,14 +84,14 @@ var tests = [
     success() {
       is(gURLBar.value, testURL.substring(0, testURL.length - 10), "gURLBar.value has the correct value");
     }
   }
 ];
 
 function test() {
   waitForExplicitFinish();
-  testTab = gBrowser.addTab();
+  testTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = testTab;
 
   // Kick off the testing
   runNextTest();
 }
--- a/browser/base/content/test/urlbar/browser_bug562649.js
+++ b/browser/base/content/test/urlbar/browser_bug562649.js
@@ -3,17 +3,17 @@ function test() {
   window.browserDOMWindow.openURI(makeURI(URI),
                                   null,
                                   Ci.nsIBrowserDOMWindow.OPEN_NEWTAB,
                                   Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
 
   is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI");
   is(gURLBar.value, URI, "location bar value matches test URI");
 
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.removeCurrentTab({ skipPermitUnload: true });
   is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI after switching tabs");
   is(gURLBar.value, URI, "location bar value matches test URI after switching tabs");
 
   waitForExplicitFinish();
   BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
     is(gBrowser.userTypedValue, null, "userTypedValue is null as the page has loaded");
     is(gURLBar.value, URI, "location bar value matches test URI as the page has loaded");
--- a/browser/base/content/test/urlbar/browser_bug623155.js
+++ b/browser/base/content/test/urlbar/browser_bug623155.js
@@ -44,17 +44,17 @@ 8. End.
  */
 
 var gNewTab;
 
 function test() {
   waitForExplicitFinish();
 
   // Load a URI in the background.
-  gNewTab = gBrowser.addTab(REDIRECT_FROM + "#BG");
+  gNewTab = BrowserTestUtils.addTab(gBrowser, REDIRECT_FROM + "#BG");
   gBrowser.getBrowserForTab(gNewTab)
           .webProgress
           .addProgressListener(gWebProgressListener,
                                Components.interfaces.nsIWebProgress
                                                     .NOTIFY_LOCATION);
 }
 
 var gWebProgressListener = {
--- a/browser/base/content/test/urlbar/browser_locationBarCommand.js
+++ b/browser/base/content/test/urlbar/browser_locationBarCommand.js
@@ -180,17 +180,17 @@ function promiseLoadStarted() {
           resolve();
         }
       }
     });
   });
 }
 
 async function promiseOpenNewTab(url = "about:blank") {
-  let tab = gBrowser.addTab(url);
+  let tab = BrowserTestUtils.addTab(gBrowser, url);
   let tabSwitchPromise = promiseNewTabSwitched(tab);
   gBrowser.selectedTab = tab;
   await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
   await tabSwitchPromise;
   return tab;
 }
 
 function promiseNewTabSwitched() {
--- a/browser/base/content/test/urlbar/browser_locationBarExternalLoad.js
+++ b/browser/base/content/test/urlbar/browser_locationBarExternalLoad.js
@@ -24,17 +24,17 @@ function promiseNewTabSwitched() {
     gBrowser.addEventListener("TabSwitchDone", function() {
       executeSoon(resolve);
     }, {once: true});
   });
 }
 
 async function testURL(url, loadFunc, endFunc) {
   let tabSwitchedPromise = promiseNewTabSwitched();
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   let browser = gBrowser.selectedBrowser;
 
   let pageshowPromise = BrowserTestUtils.waitForContentEvent(browser, "pageshow");
 
   await tabSwitchedPromise;
   await pageshowPromise;
 
   let pagePrincipal = gBrowser.contentPrincipal;
--- a/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js
+++ b/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar.js
@@ -16,17 +16,17 @@ var gController = Cc["@mozilla.org/autoc
 
 var gTabCounter = 0;
 
 add_task(async function step_1() {
   info("Running step 1");
   let maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
   let promises = [];
   for (let i = 0; i < maxResults - 1; i++) {
-    let tab = gBrowser.addTab();
+    let tab = BrowserTestUtils.addTab(gBrowser);
     promises.push(loadTab(tab, TEST_URL_BASES[0] + (++gTabCounter)));
   }
 
   await Promise.all(promises);
   await ensure_opentabs_match_db();
 });
 
 add_task(async function step_2() {
@@ -51,40 +51,40 @@ add_task(async function step_3() {
     promises.push(loadTab(gBrowser.tabs[i], TEST_URL_BASES[0] + gTabCounter));
 
   await Promise.all(promises);
   await ensure_opentabs_match_db();
 });
 
 add_task(async function step_4() {
   info("Running step 4 - ensure we don't register subframes as open pages");
-  let tab = gBrowser.addTab();
+  let tab = BrowserTestUtils.addTab(gBrowser);
   tab.linkedBrowser.loadURI('data:text/html,<body><iframe src=""></iframe></body>');
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   await ContentTask.spawn(tab.linkedBrowser, null, async function() {
     let iframe_loaded = ContentTaskUtils.waitForEvent(content.document, "load", true);
     content.document.querySelector("iframe").src = "http://test2.example.org/";
     await iframe_loaded;
   });
 
   await ensure_opentabs_match_db();
 });
 
 add_task(async function step_5() {
   info("Running step 5 - remove tab immediately");
-  let tab = gBrowser.addTab("about:logo");
+  let tab = BrowserTestUtils.addTab(gBrowser, "about:logo");
   await BrowserTestUtils.removeTab(tab);
   await ensure_opentabs_match_db();
 });
 
 add_task(async function step_6() {
   info("Running step 6 - check swapBrowsersAndCloseOther preserves registered switch-to-tab result");
-  let tabToKeep = gBrowser.addTab();
-  let tab = gBrowser.addTab();
+  let tabToKeep = BrowserTestUtils.addTab(gBrowser);
+  let tab = BrowserTestUtils.addTab(gBrowser);
   tab.linkedBrowser.loadURI("about:mozilla");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   gBrowser.updateBrowserRemoteness(tabToKeep.linkedBrowser, tab.linkedBrowser.isRemoteBrowser);
   gBrowser.swapBrowsersAndCloseOther(tabToKeep, tab);
 
   await ensure_opentabs_match_db()
 
@@ -93,17 +93,17 @@ add_task(async function step_6() {
   await ensure_opentabs_match_db();
 });
 
 add_task(async function step_7() {
   info("Running step 7 - close all tabs");
 
   Services.prefs.clearUserPref("browser.sessionstore.restore_on_demand");
 
-  gBrowser.addTab("about:blank", {skipAnimation: true});
+  BrowserTestUtils.addTab(gBrowser, "about:blank", {skipAnimation: true});
   while (gBrowser.tabs.length > 1) {
     info("Removing tab: " + gBrowser.tabs[0].linkedBrowser.currentURI.spec);
     gBrowser.selectTabAtIndex(0);
     gBrowser.removeCurrentTab();
   }
 
   await ensure_opentabs_match_db();
 });
--- a/browser/base/content/test/urlbar/browser_urlbarAboutHomeLoading.js
+++ b/browser/base/content/test/urlbar/browser_urlbarAboutHomeLoading.js
@@ -4,17 +4,17 @@ const {SessionSaver} = Cu.import("resour
 const {TabStateFlusher} = Cu.import("resource:///modules/sessionstore/TabStateFlusher.jsm", {});
 
 /**
  * Test what happens if loading a URL that should clear the
  * location bar after a parent process URL.
  */
 add_task(async function clearURLBarAfterParentProcessURL() {
   let tab = await new Promise(resolve => {
-    gBrowser.selectedTab = gBrowser.addTab("about:preferences");
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:preferences");
     let newTabBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab);
     newTabBrowser.addEventListener("Initialized", function() {
       resolve(gBrowser.selectedTab);
     }, {capture: true, once: true});
   });
   document.getElementById("home-button").click();
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   is(gURLBar.value, "", "URL bar should be empty");
@@ -23,17 +23,17 @@ add_task(async function clearURLBarAfter
 });
 
 /**
  * Same as above, but open the tab without passing the URL immediately
  * which changes behaviour in tabbrowser.xml.
  */
 add_task(async function clearURLBarAfterParentProcessURLInExistingTab() {
   let tab = await new Promise(resolve => {
-    gBrowser.selectedTab = gBrowser.addTab();
+    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
     let newTabBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab);
     newTabBrowser.addEventListener("Initialized", function() {
       resolve(gBrowser.selectedTab);
     }, {capture: true, once: true});
     newTabBrowser.loadURI("about:preferences");
   });
   document.getElementById("home-button").click();
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
--- a/browser/base/content/test/urlbar/browser_urlbarCopying.js
+++ b/browser/base/content/test/urlbar/browser_urlbarCopying.js
@@ -10,17 +10,17 @@ function toUnicode(input) {
                     .createInstance(Ci.nsIScriptableUnicodeConverter);
   converter.charset = "UTF-8";
 
   return converter.ConvertToUnicode(input);
 }
 
 function test() {
 
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   registerCleanupFunction(function() {
     gBrowser.removeTab(tab);
     Services.prefs.clearUserPref(trimPref);
     Services.prefs.clearUserPref(phishyUserPassPref);
     Services.prefs.clearUserPref(decodeURLpref);
     URLBarSetURI();
   });
--- a/browser/base/content/test/urlbar/browser_urlbarEnter.js
+++ b/browser/base/content/test/urlbar/browser_urlbarEnter.js
@@ -3,17 +3,17 @@
 
 "use strict";
 
 const TEST_VALUE = "example.com/\xF7?\xF7";
 const START_VALUE = "example.com/%C3%B7?%C3%B7";
 
 add_task(async function() {
   info("Simple return keypress");
-  let tab = gBrowser.selectedTab = gBrowser.addTab(START_VALUE);
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, START_VALUE);
 
   gURLBar.focus();
   EventUtils.synthesizeKey("VK_RETURN", {});
   await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
   // Check url bar and selected tab.
   is(gURLBar.textValue, TEST_VALUE, "Urlbar should preserve the value on return keypress");
   is(gBrowser.selectedTab, tab, "New URL was loaded in the current tab");
--- a/browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js
+++ b/browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js
@@ -29,17 +29,17 @@ add_task(async function() {
   let visits = [];
   repeat(gMaxResults, i => {
     visits.push({
       uri: makeURI("http://example.com/autocomplete/?" + i),
     });
   });
   await PlacesTestUtils.addVisits(visits);
 
-  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await promiseAutoComplete("http://example.com/autocomplete/");
 
   let popup = gURLBar.popup;
   let results = popup.richlistbox.children;
   is(results.length, gMaxResults,
      "Should get gMaxResults=" + gMaxResults + " results");
 
   let initiallySelected = gURLBar.popup.richlistbox.selectedIndex;
--- a/browser/base/content/test/urlbar/browser_urlbarOneOffs.js
+++ b/browser/base/content/test/urlbar/browser_urlbarOneOffs.js
@@ -179,17 +179,17 @@ add_task(async function searchWith() {
                "Search with " + engineName,
                "First result's action text should be updated");
 
   await hidePopup();
 });
 
 // Clicks a one-off.
 add_task(async function oneOffClick() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   // We are explicitly using something that looks like a url, to make the test
   // stricter. Even if it looks like a url, we should search.
   let typedValue = "foo.bar";
   await promiseAutocompleteResultPopup(typedValue);
 
   assertState(0, -1, typedValue);
 
@@ -200,17 +200,17 @@ add_task(async function oneOffClick() {
   EventUtils.synthesizeMouseAtCenter(oneOffs[0], {});
   await resultsPromise;
 
   gBrowser.removeTab(gBrowser.selectedTab);
 });
 
 // Presses the Return key when a one-off is selected.
 add_task(async function oneOffReturn() {
-  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   // We are explicitly using something that looks like a url, to make the test
   // stricter. Even if it looks like a url, we should search.
   let typedValue = "foo.bar";
   await promiseAutocompleteResultPopup(typedValue, window, true);
 
   assertState(0, -1, typedValue);
 
--- a/browser/base/content/test/urlbar/browser_urlbarRevert.js
+++ b/browser/base/content/test/urlbar/browser_urlbarRevert.js
@@ -9,17 +9,17 @@ function test() {
           aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
         gBrowser.removeProgressListener(this);
         executeSoon(checkURLBarRevert);
       }
     }
   }
 
   gBrowser.addProgressListener(pageLoaded);
-  tab = gBrowser.addTab("http://example.com");
+  tab = BrowserTestUtils.addTab(gBrowser, "http://example.com");
   gBrowser.selectedTab = tab;
 }
 
 function checkURLBarRevert() {
   let originalValue = gURLBar.value;
 
   gBrowser.userTypedValue = "foobar";
   gBrowser.selectedTab = gBrowser.tabs[0];
--- a/browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js
+++ b/browser/base/content/test/urlbar/browser_urlbarSearchSingleWordNotification.js
@@ -53,72 +53,72 @@ async function runURLBarSearchTest({valu
 
   await Promise.all([
     docLoadPromise,
     promiseNotification(aWindow.gBrowser, "keyword-uri-fixup", expectNotification, valueToOpen)
   ]);
 }
 
 add_task(async function test_navigate_full_domain() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await runURLBarSearchTest({
     valueToOpen: "www.mozilla.org",
     expectSearch: false,
     expectNotification: false,
   });
   gBrowser.removeTab(tab);
 });
 
 add_task(async function test_navigate_decimal_ip() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await runURLBarSearchTest({
     valueToOpen: "1234",
     expectSearch: true,
     expectNotification: false,
   });
   gBrowser.removeTab(tab);
 });
 
 add_task(async function test_navigate_decimal_ip_with_path() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await runURLBarSearchTest({
     valueToOpen: "1234/12",
     expectSearch: true,
     expectNotification: false,
   });
   gBrowser.removeTab(tab);
 });
 
 add_task(async function test_navigate_large_number() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await runURLBarSearchTest({
     valueToOpen: "123456789012345",
     expectSearch: true,
     expectNotification: false
   });
   gBrowser.removeTab(tab);
 });
 
 add_task(async function test_navigate_small_hex_number() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await runURLBarSearchTest({
     valueToOpen: "0x1f00ffff",
     expectSearch: true,
     expectNotification: false
   });
   gBrowser.removeTab(tab);
 });
 
 add_task(async function test_navigate_large_hex_number() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await runURLBarSearchTest({
     valueToOpen: "0x7f0000017f000001",
     expectSearch: true,
     expectNotification: false
   });
   gBrowser.removeTab(tab);
 });
@@ -182,17 +182,17 @@ function get_test_function_for_localhost
   }
 }
 
 add_task(get_test_function_for_localhost_with_hostname("localhost"));
 add_task(get_test_function_for_localhost_with_hostname("localhost."));
 add_task(get_test_function_for_localhost_with_hostname("localhost", true));
 
 add_task(async function test_navigate_invalid_url() {
-  let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  let tab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   await runURLBarSearchTest({
     valueToOpen: "mozilla is awesome",
     expectSearch: true,
     expectNotification: false,
   });
   gBrowser.removeTab(tab);
 });
--- a/browser/base/content/test/urlbar/browser_urlbarStop.js
+++ b/browser/base/content/test/urlbar/browser_urlbarStop.js
@@ -1,23 +1,23 @@
 "use strict";
 
 const goodURL = "http://mochi.test:8888/";
 const badURL = "http://mochi.test:8888/whatever.html";
 
 add_task(async function() {
-  gBrowser.selectedTab = gBrowser.addTab(goodURL);
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, goodURL);
   await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
   is(gURLBar.textValue, gURLBar.trimValue(goodURL), "location bar reflects loaded page");
 
   await typeAndSubmitAndStop(badURL);
   is(gURLBar.textValue, gURLBar.trimValue(goodURL), "location bar reflects loaded page after stop()");
   gBrowser.removeCurrentTab();
 
-  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   is(gURLBar.textValue, "", "location bar is empty");
 
   await typeAndSubmitAndStop(badURL);
   is(gURLBar.textValue, gURLBar.trimValue(badURL), "location bar reflects stopped page in an empty tab");
   gBrowser.removeCurrentTab();
 });
 
 async function typeAndSubmitAndStop(url) {
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_anim.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_anim.js
@@ -35,17 +35,17 @@ var gTests = [
          "the tab has the attribute to show the " + aSharing + " icon");
       let icon =
         document.getAnonymousElementByAttribute(tab, "anonid", "sharing-icon");
       is(window.getComputedStyle(icon).display, "none",
          "the animated sharing icon of the tab is hidden");
 
       // After selecting a new tab, check the attribute is still there,
       // and the icon is now visible.
-      await BrowserTestUtils.switchTab(gBrowser, gBrowser.addTab());
+      await BrowserTestUtils.switchTab(gBrowser, BrowserTestUtils.addTab(gBrowser));
       is(gBrowser.selectedTab.getAttribute("sharing"), "",
          "the new tab doesn't have the 'sharing' attribute");
       is(tab.getAttribute("sharing"), aSharing,
          "the tab still has the 'sharing' attribute");
       isnot(window.getComputedStyle(icon).display, "none",
             "the animated sharing icon of the tab is now visible");
 
       // Ensure the icon disappears when selecting the tab.
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_tear_off_tab.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_tear_off_tab.js
@@ -58,12 +58,12 @@ var gTests = [
 
 ];
 
 add_task(async function test() {
   await SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", 1]]});
 
   // An empty tab where we can load the content script without leaving it
   // behind at the end of the test.
-  gBrowser.addTab();
+  BrowserTestUtils.addTab(gBrowser);
 
   await runTests(gTests);
 });
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_unprompted_access_tear_off_tab.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_unprompted_access_tear_off_tab.js
@@ -51,12 +51,12 @@ var gTests = [
 
 ];
 
 add_task(async function test() {
   await SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", 1]]});
 
   // An empty tab where we can load the content script without leaving it
   // behind at the end of the test.
-  gBrowser.addTab();
+  BrowserTestUtils.addTab(gBrowser);
 
   await runTests(gTests);
 });
--- a/browser/components/contextualidentity/test/browser/browser_aboutURLs.js
+++ b/browser/components/contextualidentity/test/browser/browser_aboutURLs.js
@@ -34,16 +34,16 @@ add_task(async function() {
     } catch (e) {
       // getService might have thrown if the component doesn't actually
       // implement nsIAboutModule
     }
   }
 
   for (let url of aboutURLs) {
     info("Loading about:" + url);
-    let tab = gBrowser.addTab("about:" + url, {userContextId: 1});
+    let tab = BrowserTestUtils.addTab(gBrowser, "about:" + url, {userContextId: 1});
     await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
     ok(true, "Done loading about:" + url);
 
     await BrowserTestUtils.removeTab(tab);
   }
 });
--- a/browser/components/contextualidentity/test/browser/browser_blobUrl.js
+++ b/browser/components/contextualidentity/test/browser/browser_blobUrl.js
@@ -8,33 +8,33 @@ const BASE_URI = "http://mochi.test:8888
 add_task(async function setup() {
   await SpecialPowers.pushPrefEnv({"set": [
     ["privacy.userContext.enabled", true]
   ]});
 });
 
 add_task(async function test() {
   info("Creating a tab with UCI = 1...");
-  let tab1 = gBrowser.addTab(BASE_URI, {userContextId: 1});
+  let tab1 = BrowserTestUtils.addTab(gBrowser, BASE_URI, {userContextId: 1});
   is(tab1.getAttribute("usercontextid"), 1, "New tab has UCI equal 1");
 
   let browser1 = gBrowser.getBrowserForTab(tab1);
   await BrowserTestUtils.browserLoaded(browser1);
 
   let blobURL;
 
   info("Creating a blob URL...");
   await ContentTask.spawn(browser1, null, function() {
     return Promise.resolve(content.window.URL.createObjectURL(new content.window.Blob([123])));
   }).then(newURL => { blobURL = newURL });
 
   info("Blob URL: " + blobURL);
 
   info("Creating a tab with UCI = 2...");
-  let tab2 = gBrowser.addTab(BASE_URI, {userContextId: 2});
+  let tab2 = BrowserTestUtils.addTab(gBrowser, BASE_URI, {userContextId: 2});
   is(tab2.getAttribute("usercontextid"), 2, "New tab has UCI equal 2");
 
   let browser2 = gBrowser.getBrowserForTab(tab2);
   await BrowserTestUtils.browserLoaded(browser2);
 
   await ContentTask.spawn(browser2, blobURL, function(url) {
     return new Promise(resolve => {
       var xhr = new content.window.XMLHttpRequest();
@@ -43,17 +43,17 @@ add_task(async function test() {
       xhr.open("GET", url);
       xhr.send();
     });
   }).then(status => {
     is(status, "SendErrored", "Using a blob URI from one user context id in another should not work");
   });
 
   info("Creating a tab with UCI = 1...");
-  let tab3 = gBrowser.addTab(BASE_URI, {userContextId: 1});
+  let tab3 = BrowserTestUtils.addTab(gBrowser, BASE_URI, {userContextId: 1});
   is(tab3.getAttribute("usercontextid"), 1, "New tab has UCI equal 1");
 
   let browser3 = gBrowser.getBrowserForTab(tab3);
   await BrowserTestUtils.browserLoaded(browser3);
 
   await ContentTask.spawn(browser3, blobURL, function(url) {
     return new Promise(resolve => {
       var xhr = new content.window.XMLHttpRequest();
--- a/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js
+++ b/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js
@@ -3,17 +3,17 @@ let { classes: Cc, interfaces: Ci } = Co
 const BASE_ORIGIN = "http://example.com";
 const URI = BASE_ORIGIN +
   "/browser/browser/components/contextualidentity/test/browser/empty_file.html";
 
 // opens `uri' in a new tab with the provided userContextId and focuses it.
 // returns the newly opened tab
 async function openTabInUserContext(uri, userContextId) {
   // open the tab in the correct userContextId
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // select tab and make sure its browser is focused
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/contextualidentity/test/browser/browser_count_and_remove.js
+++ b/browser/components/contextualidentity/test/browser/browser_count_and_remove.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/ContextualIdentityService.jsm");
 
 function openTabInUserContext(userContextId) {
-  let tab = gBrowser.addTab("about:blank", {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, "about:blank", {userContextId});
   gBrowser.selectedTab = tab;
 }
 
 add_task(async function setup() {
   // make sure userContext is enabled.
   await SpecialPowers.pushPrefEnv({"set": [
           ["privacy.userContext.enabled", true]
         ]});
--- a/browser/components/contextualidentity/test/browser/browser_eme.js
+++ b/browser/components/contextualidentity/test/browser/browser_eme.js
@@ -14,17 +14,17 @@ const TESTKEY = {
   sessionType: "persistent-license",
 };
 
 const USER_ID_DEFAULT = 0;
 const USER_ID_PERSONAL = 1;
 
 async function openTabInUserContext(uri, userContextId) {
   // Open the tab in the correct userContextId.
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // Select tab and make sure its browser is focused.
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/contextualidentity/test/browser/browser_favicon.js
+++ b/browser/components/contextualidentity/test/browser/browser_favicon.js
@@ -28,17 +28,17 @@ function getIconFile() {
         gFaviconData = NetUtil.readInputStreamToString(inputStream, size);
         resolve();
     });
   });
 }
 
 async function openTabInUserContext(uri, userContextId) {
   // open the tab in the correct userContextId
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // select tab and make sure its browser is focused
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js
@@ -21,17 +21,17 @@ const TEST_EME_KEY = {
 };
 
 //
 // Support functions.
 //
 
 async function openTabInUserContext(uri, userContextId) {
   // Open the tab in the correct userContextId.
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // Select tab and make sure its browser is focused.
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_cookie_getCookiesWithOriginAttributes.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_cookie_getCookiesWithOriginAttributes.js
@@ -13,17 +13,17 @@ const USER_CONTEXTS = [
 ];
 
 //
 // Support functions.
 //
 
 async function openTabInUserContext(uri, userContextId) {
   // Open the tab in the correct userContextId.
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // Select tab and make sure its browser is focused.
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
@@ -13,17 +13,17 @@ const USER_CONTEXTS = [
 ];
 
 //
 // Support functions.
 //
 
 async function openTabInUserContext(uri, userContextId) {
   // Open the tab in the correct userContextId.
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // Select tab and make sure its browser is focused.
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
@@ -51,17 +51,17 @@ function loadImagePageHandler(metadata, 
                 <img src='image.png'>\
                 </body>\
               </html>";
   response.bodyOutputStream.write(body, body.length);
 }
 
 async function openTabInUserContext(uri, userContextId) {
   // Open the tab in the correct userContextId.
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // Select tab and make sure its browser is focused.
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/contextualidentity/test/browser/browser_imageCache.js
+++ b/browser/components/contextualidentity/test/browser/browser_imageCache.js
@@ -34,17 +34,17 @@ add_task(async function setup() {
   // make sure userContext is enabled.
   await SpecialPowers.pushPrefEnv({"set": [["privacy.userContext.enabled", true]]});
 });
 
 // opens `uri' in a new tab with the provided userContextId and focuses it.
 // returns the newly opened tab
 async function openTabInUserContext(uri, userContextId) {
   // open the tab in the correct userContextId
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // select tab and make sure its browser is focused
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return tab;
--- a/browser/components/contextualidentity/test/browser/browser_middleClick.js
+++ b/browser/components/contextualidentity/test/browser/browser_middleClick.js
@@ -2,17 +2,17 @@
 
 const BASE_ORIGIN = "http://example.com";
 const URI = BASE_ORIGIN +
   "/browser/browser/components/contextualidentity/test/browser/empty_file.html";
 
 add_task(async function() {
   info("Opening a new container tab...");
 
-  let tab = gBrowser.addTab(URI, { userContextId: 1 });
+  let tab = BrowserTestUtils.addTab(gBrowser, URI, { userContextId: 1 });
   gBrowser.selectedTab = tab;
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
 
   info("Create a HTMLAnchorElement...");
   await ContentTask.spawn(browser, URI,
     function(uri) {
--- a/browser/components/contextualidentity/test/browser/browser_relatedTab.js
+++ b/browser/components/contextualidentity/test/browser/browser_relatedTab.js
@@ -1,31 +1,31 @@
 "use strict";
 
 /*
  * Bug 1325014 - Adding tab related to current tab inherits current tab's container usercontextid unless otherwise specified
  */
 
 add_task(async function() {
-  let tab = gBrowser.addTab("about:blank", {userContextId: 1});
+  let tab = BrowserTestUtils.addTab(gBrowser, "about:blank", {userContextId: 1});
 
   gBrowser.selectedTab = tab;
-  let relatedTab = gBrowser.addTab("about:blank", {relatedToCurrent: true});
+  let relatedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {relatedToCurrent: true});
   is(relatedTab.getAttribute("usercontextid"), 1, "Related tab (relatedToCurrent) inherits current tab's usercontextid");
   await BrowserTestUtils.removeTab(relatedTab);
 
   gBrowser.selectedTab = tab;
-  relatedTab = gBrowser.addTab("about:blank", {relatedToCurrent: true, userContextId: 2});
+  relatedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {relatedToCurrent: true, userContextId: 2});
   is(relatedTab.getAttribute("usercontextid"), 2, "Related tab (relatedToCurrent) with overridden usercontextid");
   await BrowserTestUtils.removeTab(relatedTab);
 
   gBrowser.selectedTab = tab;
-  relatedTab = gBrowser.addTab("about:blank", {referrerURI: gBrowser.currentURI});
+  relatedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {referrerURI: gBrowser.currentURI});
   is(relatedTab.getAttribute("usercontextid"), 1, "Related tab (referrer) inherits current tab's usercontextid");
   await BrowserTestUtils.removeTab(relatedTab);
 
   gBrowser.selectedTab = tab;
-  relatedTab = gBrowser.addTab("about:blank", {referrerURI: gBrowser.currentURI, userContextId: 2});
+  relatedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {referrerURI: gBrowser.currentURI, userContextId: 2});
   is(relatedTab.getAttribute("usercontextid"), 2, "Related tab (referrer) with overridden usercontextid");
   await BrowserTestUtils.removeTab(relatedTab);
 
   await BrowserTestUtils.removeTab(tab);
 });
--- a/browser/components/contextualidentity/test/browser/browser_restore_getCookiesWithOriginAttributes.js
+++ b/browser/components/contextualidentity/test/browser/browser_restore_getCookiesWithOriginAttributes.js
@@ -17,17 +17,17 @@ const DELETE_CONTEXT = 1;
 const COOKIE_NAME = "userContextId";
 
 //
 // Support functions.
 //
 
 async function openTabInUserContext(uri, userContextId) {
   // Open the tab in the correct userContextId.
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // Select tab and make sure its browser is focused.
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/contextualidentity/test/browser/browser_serviceworkers.js
+++ b/browser/components/contextualidentity/test/browser/browser_serviceworkers.js
@@ -7,17 +7,17 @@ const BASE_ORIGIN = "https://example.com
 const URI = BASE_ORIGIN +
   "/browser/browser/components/contextualidentity/test/browser/serviceworker.html";
 const NUM_USER_CONTEXTS = 3;
 
 // opens `uri' in a new tab with the provided userContextId and focuses it.
 // returns the newly opened tab
 function openTabInUserContext(uri, userContextId) {
   // open the tab in the correct userContextId
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // select tab and make sure its browser is focused
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   return tab;
 }
 
--- a/browser/components/contextualidentity/test/browser/browser_usercontext.js
+++ b/browser/components/contextualidentity/test/browser/browser_usercontext.js
@@ -11,17 +11,17 @@ const USER_CONTEXTS = [
 const BASE_URI = "http://mochi.test:8888/browser/browser/components/"
   + "contextualidentity/test/browser/file_reflect_cookie_into_title.html";
 
 
 // opens `uri' in a new tab with the provided userContextId and focuses it.
 // returns the newly opened tab
 function openTabInUserContext(uri, userContextId) {
   // open the tab in the correct userContextId
-  let tab = gBrowser.addTab(uri, {userContextId});
+  let tab = BrowserTestUtils.addTab(gBrowser, uri, {userContextId});
 
   // select tab and make sure its browser is focused
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   return tab;
 }
 
--- a/browser/components/contextualidentity/test/browser/browser_usercontextid_tabdrop.js
+++ b/browser/components/contextualidentity/test/browser/browser_usercontextid_tabdrop.js
@@ -2,17 +2,17 @@
 
 let EventUtils = {};
 Services.scriptloader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js", EventUtils);
 
 /**
  * Dragging an URL to a tab without userContextId set.
  */
 add_task(async function() {
-  let tab = gBrowser.addTab("http://example.com/");
+  let tab = BrowserTestUtils.addTab(gBrowser, "http://example.com/");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   let awaitDrop = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "drop");
   let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, "http://test1.example.com/");
 
   // A drop type of "link" onto an existing tab would normally trigger a
   // load in that same tab, but tabbrowser code in _getDragTargetTab treats
   // drops on the outer edges of a tab differently (loading a new tab
@@ -49,17 +49,17 @@ add_task(async function() {
   await BrowserTestUtils.removeTab(tab2);
 });
 
 /**
  * When dragging an URL to a new tab, the new tab should have the same
  * userContextId as the original tab.
  */
 add_task(async function() {
-  let tab = gBrowser.addTab("http://example.com/", {userContextId: 1});
+  let tab = BrowserTestUtils.addTab(gBrowser, "http://example.com/", {userContextId: 1});
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   let awaitDrop = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "drop");
   let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, "http://test1.example.com/");
 
   // A drop type of "link" onto an existing tab would normally trigger a
   // load in that same tab, but tabbrowser code in _getDragTargetTab treats
   // drops on the outer edges of a tab differently (loading a new tab
@@ -98,20 +98,20 @@ add_task(async function() {
 
 /**
  * When dragging a URL from one tab or link on a tab to an existing tab, the
  * existing tab should not change its userContextId.
  * Ex: if you drag a link from tab 1 with userContext 1 to tab 2 with
  * userContext 2, the link will open in tab 2 with userContext 2.
  */
 add_task(async function() {
-  let tab = gBrowser.addTab("http://example.com/", {userContextId: 1});
+  let tab = BrowserTestUtils.addTab(gBrowser, "http://example.com/", {userContextId: 1});
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
-  let tab2 = gBrowser.addTab("http://example.org/", {userContextId: 2});
+  let tab2 = BrowserTestUtils.addTab(gBrowser, "http://example.org/", {userContextId: 2});
   await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
 
   let awaitDrop = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "drop");
 
   EventUtils.synthesizeDrop(tab, tab2, [[{type: "text/plain", data: "http://test1.example.com/"}]], "link", window);
 
   await awaitDrop;
   Assert.equal(tab2.getAttribute("usercontextid"), 2);
--- a/browser/components/contextualidentity/test/browser/browser_windowName.js
+++ b/browser/components/contextualidentity/test/browser/browser_windowName.js
@@ -16,25 +16,25 @@ add_task(async function setup() {
   await SpecialPowers.pushPrefEnv({"set": [
     ["privacy.userContext.enabled", true],
     ["browser.link.open_newwindow", 3],
   ]});
 });
 
 add_task(async function test() {
   info("Creating first tab...");
-  let tab1 = gBrowser.addTab(BASE_URI + "?old", {userContextId: 1});
+  let tab1 = BrowserTestUtils.addTab(gBrowser, BASE_URI + "?old", {userContextId: 1});
   let browser1 = gBrowser.getBrowserForTab(tab1);
   await BrowserTestUtils.browserLoaded(browser1);
   await ContentTask.spawn(browser1, null, function(opts) {
     content.window.name = "tab-1";
   });
 
   info("Creating second tab...");
-  let tab2 = gBrowser.addTab(BASE_URI + "?old", {userContextId: 2});
+  let tab2 = BrowserTestUtils.addTab(gBrowser, BASE_URI + "?old", {userContextId: 2});
   let browser2 = gBrowser.getBrowserForTab(tab2);
   await BrowserTestUtils.browserLoaded(browser2);
   await ContentTask.spawn(browser2, null, function(opts) {
     content.window.name = "tab-2";
   });
 
   // Let's try to open a window from tab1 with a name 'tab-2'.
   info("Opening a window from the first tab...");
--- a/browser/components/contextualidentity/test/browser/browser_windowOpen.js
+++ b/browser/components/contextualidentity/test/browser/browser_windowOpen.js
@@ -11,17 +11,17 @@ add_task(async function setup() {
     ["privacy.userContext.enabled", true],
     ["browser.link.open_newwindow", 2],
   ]});
 });
 
 
 add_task(async function test() {
   info("Creating a tab with UCI = 1...");
-  let tab = gBrowser.addTab(BASE_URI, {userContextId: 1});
+  let tab = BrowserTestUtils.addTab(gBrowser, BASE_URI, {userContextId: 1});
   is(tab.getAttribute("usercontextid"), 1, "New tab has UCI equal 1");
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
 
   info("Opening a new window from this tab...");
   ContentTask.spawn(browser, BASE_URI, function(url) {
     content.window.newWindow = content.window.open(url, "_blank");
--- a/browser/components/customizableui/test/browser_1087303_button_preferences.js
+++ b/browser/components/customizableui/test/browser_1087303_button_preferences.js
@@ -21,17 +21,17 @@ add_task(async function() {
   await waitForPageLoad(newTab);
 
   let openedPage = gBrowser.currentURI.spec;
   is(openedPage, "about:preferences", "Preferences page was opened");
 });
 
 add_task(function asyncCleanup() {
   if (gBrowser.tabs.length == 1)
-    gBrowser.addTab("about:blank");
+    BrowserTestUtils.addTab(gBrowser, "about:blank");
 
   gBrowser.removeTab(gBrowser.selectedTab);
   info("Tabs were restored");
 });
 
 function waitForPageLoad(aTab) {
   return new Promise((resolve, reject) => {
 
--- a/browser/components/customizableui/test/browser_880164_customization_context_menus.js
+++ b/browser/components/customizableui/test/browser_880164_customization_context_menus.js
@@ -38,17 +38,17 @@ add_task(async function() {
   await hiddenPromise;
 });
 
 // Right-click on an empty bit of tabstrip should
 // show a context menu without options to move it,
 // but with tab-specific options instead.
 add_task(async function() {
   // ensure there are tabs to reload/bookmark:
-  let extraTab = gBrowser.selectedTab = gBrowser.addTab();
+  let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   await promiseTabLoadEvent(extraTab, "http://example.com/");
   let contextMenu = document.getElementById("toolbar-context-menu");
   let shownPromise = popupShown(contextMenu);
   let tabstrip = document.getElementById("tabbrowser-tabs");
   let rect = tabstrip.getBoundingClientRect();
   EventUtils.synthesizeMouse(tabstrip, rect.width - 2, 2, {type: "contextmenu", button: 2 });
   await shownPromise;
 
--- a/browser/components/customizableui/test/browser_934951_zoom_in_toolbar.js
+++ b/browser/components/customizableui/test/browser_934951_zoom_in_toolbar.js
@@ -4,19 +4,19 @@
 
 "use strict";
 
 const kTimeoutInMS = 20000;
 
 // Bug 934951 - Zoom controls percentage label doesn't update when it's in the toolbar and you navigate.
 add_task(async function() {
   CustomizableUI.addWidgetToArea("zoom-controls", CustomizableUI.AREA_NAVBAR);
-  let tab1 = gBrowser.addTab("about:mozilla");
+  let tab1 = BrowserTestUtils.addTab(gBrowser, "about:mozilla");
   await BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
-  let tab2 = gBrowser.addTab("about:robots");
+  let tab2 = BrowserTestUtils.addTab(gBrowser, "about:robots");
   await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
   gBrowser.selectedTab = tab1;
   let zoomResetButton = document.getElementById("zoom-reset-button");
 
   registerCleanupFunction(() => {
     info("Cleaning up.");
     CustomizableUI.reset();
     gBrowser.removeTab(tab2);
--- a/browser/components/customizableui/test/browser_947914_button_addons.js
+++ b/browser/components/customizableui/test/browser_947914_button_addons.js
@@ -23,12 +23,12 @@ add_task(async function() {
                                gBrowser.currentURI.spec == "about:addons");
 
   let addonsPage = gBrowser.selectedBrowser.contentWindow.document.
                             getElementById("addons-page");
   ok(addonsPage, "Add-ons page was opened");
 });
 
 add_task(async function asyncCleanup() {
-  gBrowser.addTab(initialLocation);
+  BrowserTestUtils.addTab(gBrowser, initialLocation);
   gBrowser.removeTab(gBrowser.selectedTab);
   info("Tabs were restored");
 });
--- a/browser/components/customizableui/test/browser_967000_button_feeds.js
+++ b/browser/components/customizableui/test/browser_967000_button_feeds.js
@@ -51,11 +51,11 @@ add_task(async function() {
 });
 
 add_task(async function asyncCleanup() {
   // reset the panel UI to the default state
   await resetCustomization();
   ok(CustomizableUI.inDefaultState, "The UI is in default state again.");
 
   // restore the initial location
-  gBrowser.addTab(initialLocation);
+  BrowserTestUtils.addTab(gBrowser, initialLocation);
   gBrowser.removeTab(newTab);
 });
--- a/browser/components/customizableui/test/browser_973641_button_addon.js
+++ b/browser/components/customizableui/test/browser_973641_button_addon.js
@@ -12,17 +12,17 @@ add_task(async function() {
 
   info("Check addon button functionality");
 
   // create mocked addon button on the navigation bar
   let widgetSpec = {
     id: kButton,
     type: "button",
     onClick() {
-      gBrowser.selectedTab = gBrowser.addTab("about:addons");
+      gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:addons");
     }
   };
   CustomizableUI.createWidget(widgetSpec);
   CustomizableUI.addWidgetToArea(kButton, CustomizableUI.AREA_NAVBAR);
 
   // check the button's functionality in navigation bar
   let addonButton = document.getElementById(kButton);
   let navBar = document.getElementById("nav-bar");
@@ -57,17 +57,17 @@ add_task(async function asyncCleanup() {
 
 function resetTabs() {
   // close all opened tabs
   while (gBrowser.tabs.length > 1) {
     gBrowser.removeTab(gBrowser.selectedTab);
   }
 
   // restore the initial tab
-  gBrowser.addTab(initialLocation);
+  BrowserTestUtils.addTab(gBrowser, initialLocation);
   gBrowser.removeTab(gBrowser.selectedTab);
 }
 
 async function checkButtonFunctionality(aButton) {
   aButton.click();
   await waitForCondition(() => gBrowser.currentURI &&
                                gBrowser.currentURI.spec == "about:addons");
 }
--- a/browser/components/customizableui/test/browser_synced_tabs_menu.js
+++ b/browser/components/customizableui/test/browser_synced_tabs_menu.js
@@ -120,17 +120,17 @@ function panelUIHide() {
 
 async function asyncCleanup() {
   Services.prefs.clearUserPref("identity.fxaccounts.remote.signup.uri");
   // reset the panel UI to the default state
   await resetCustomization();
   ok(CustomizableUI.inDefaultState, "The panel UI is in default state again.");
 
   // restore the tabs
-  gBrowser.addTab(initialLocation);
+  BrowserTestUtils.addTab(gBrowser, initialLocation);
   gBrowser.removeTab(newTab);
   UITour.tourBrowsersByWindow.delete(window);
 }
 
 // When Sync is not setup.
 add_task(async function() {
   document.getElementById("sync-reauth-state").hidden = true;
   document.getElementById("sync-setup-state").hidden = false;
--- a/browser/components/originattributes/test/browser/browser_favicon_firstParty.js
+++ b/browser/components/originattributes/test/browser/browser_favicon_firstParty.js
@@ -156,17 +156,17 @@ function waitOnFaviconLoaded(aFaviconURL
       },
     };
 
     PlacesUtils.history.addObserver(observer);
   });
 }
 
 async function openTab(aURL) {
-  let tab = gBrowser.addTab(aURL);
+  let tab = BrowserTestUtils.addTab(gBrowser, aURL);
 
   // Select tab and make sure its browser is focused.
   gBrowser.selectedTab = tab;
   tab.ownerGlobal.focus();
 
   let browser = gBrowser.getBrowserForTab(tab);
   await BrowserTestUtils.browserLoaded(browser);
   return {tab, browser};
--- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation.js
+++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation.js
@@ -9,17 +9,17 @@ add_task(async function setup() {
   });
 });
 
 /**
  * Test for the top-level document and child iframes should have the
  * firstPartyDomain attribute.
  */
 add_task(async function principal_test() {
-  let tab = gBrowser.addTab(BASE_URL + "test_firstParty.html");
+  let tab = BrowserTestUtils.addTab(gBrowser, BASE_URL + "test_firstParty.html");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser, true, function(url) {
     return url == BASE_URL + "test_firstParty.html";
   });
 
   await ContentTask.spawn(tab.linkedBrowser, { firstPartyDomain: BASE_DOMAIN }, async function(attrs) {
     info("document principal: " + content.document.nodePrincipal.origin);
     Assert.equal(docShell.getOriginAttributes().firstPartyDomain, "",
                  "top-level docShell shouldn't have firstPartyDomain attribute.");
@@ -39,17 +39,17 @@ add_task(async function principal_test()
   gBrowser.removeTab(tab);
 });
 
 /**
  * Test for the cookie jars of the top-level document and child iframe should be
  * isolated by firstPartyDomain.
  */
 add_task(async function cookie_test() {
-  let tab = gBrowser.addTab(BASE_URL + "test_firstParty_cookie.html");
+  let tab = BrowserTestUtils.addTab(gBrowser, BASE_URL + "test_firstParty_cookie.html");
   await BrowserTestUtils.browserLoaded(tab.linkedBrowser, true);
 
   let iter = Services.cookies.enumerator;
   let count = 0;
   while (iter.hasMoreElements()) {
     count++;
     let cookie = iter.getNext().QueryInterface(Ci.nsICookie2);
     Assert.equal(cookie.value, "foo", "Cookie value should be foo");
@@ -64,44 +64,44 @@ add_task(async function cookie_test() {
 });
 
 /**
  * Test for after redirect, the top-level document should update the firstPartyDomain
  * attribute. However if the redirect is happening on the iframe, the attribute
  * should remain the same.
  */
 add_task(async function redirect_test() {
-  let tab = gBrowser.addTab(BASE_URL + "test_firstPart