mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bee9457f0a
--HG-- rename : browser/base/content/test/Makefile.in => browser/base/content/test/general/Makefile.in rename : browser/base/content/test/POSTSearchEngine.xml => browser/base/content/test/general/POSTSearchEngine.xml rename : browser/base/content/test/alltabslistener.html => browser/base/content/test/general/alltabslistener.html rename : browser/base/content/test/app_bug575561.html => browser/base/content/test/general/app_bug575561.html rename : browser/base/content/test/app_subframe_bug575561.html => browser/base/content/test/general/app_subframe_bug575561.html rename : browser/base/content/test/audio.ogg => browser/base/content/test/general/audio.ogg rename : browser/base/content/test/authenticate.sjs => browser/base/content/test/general/authenticate.sjs rename : browser/base/content/test/blockNoPlugins.xml => browser/base/content/test/general/blockNoPlugins.xml rename : browser/base/content/test/blockPluginHard.xml => browser/base/content/test/general/blockPluginHard.xml rename : browser/base/content/test/blockPluginVulnerableNoUpdate.xml => browser/base/content/test/general/blockPluginVulnerableNoUpdate.xml rename : browser/base/content/test/blockPluginVulnerableUpdatable.xml => browser/base/content/test/general/blockPluginVulnerableUpdatable.xml rename : browser/base/content/test/browser_CTP_context_menu.js => browser/base/content/test/general/browser_CTP_context_menu.js rename : browser/base/content/test/browser_CTP_data_urls.js => browser/base/content/test/general/browser_CTP_data_urls.js rename : browser/base/content/test/browser_CTP_drag_drop.js => browser/base/content/test/general/browser_CTP_drag_drop.js rename : browser/base/content/test/browser_URLBarSetURI.js => browser/base/content/test/general/browser_URLBarSetURI.js rename : browser/base/content/test/browser_aboutHealthReport.js => browser/base/content/test/general/browser_aboutHealthReport.js rename : browser/base/content/test/browser_aboutHome.js => browser/base/content/test/general/browser_aboutHome.js rename : browser/base/content/test/browser_aboutSyncProgress.js => browser/base/content/test/general/browser_aboutSyncProgress.js rename : browser/base/content/test/browser_addKeywordSearch.js => browser/base/content/test/general/browser_addKeywordSearch.js rename : browser/base/content/test/browser_addon_bar.js => browser/base/content/test/general/browser_addon_bar.js rename : browser/base/content/test/browser_addon_bar_aomlistener.js => browser/base/content/test/general/browser_addon_bar_aomlistener.js rename : browser/base/content/test/browser_addon_bar_close_button.js => browser/base/content/test/general/browser_addon_bar_close_button.js rename : browser/base/content/test/browser_addon_bar_shortcut.js => browser/base/content/test/general/browser_addon_bar_shortcut.js rename : browser/base/content/test/browser_alltabslistener.js => browser/base/content/test/general/browser_alltabslistener.js rename : browser/base/content/test/browser_blob-channelname.js => browser/base/content/test/general/browser_blob-channelname.js rename : browser/base/content/test/browser_bookmark_titles.js => browser/base/content/test/general/browser_bookmark_titles.js rename : browser/base/content/test/browser_bug304198.js => browser/base/content/test/general/browser_bug304198.js rename : browser/base/content/test/browser_bug321000.js => browser/base/content/test/general/browser_bug321000.js rename : browser/base/content/test/browser_bug329212.js => browser/base/content/test/general/browser_bug329212.js rename : browser/base/content/test/browser_bug356571.js => browser/base/content/test/general/browser_bug356571.js rename : browser/base/content/test/browser_bug380960.js => browser/base/content/test/general/browser_bug380960.js rename : browser/base/content/test/browser_bug386835.js => browser/base/content/test/general/browser_bug386835.js rename : browser/base/content/test/browser_bug405137.js => browser/base/content/test/general/browser_bug405137.js rename : browser/base/content/test/browser_bug406216.js => browser/base/content/test/general/browser_bug406216.js rename : browser/base/content/test/browser_bug409481.js => browser/base/content/test/general/browser_bug409481.js rename : browser/base/content/test/browser_bug409624.js => browser/base/content/test/general/browser_bug409624.js rename : browser/base/content/test/browser_bug413915.js => browser/base/content/test/general/browser_bug413915.js rename : browser/base/content/test/browser_bug416661.js => browser/base/content/test/general/browser_bug416661.js rename : browser/base/content/test/browser_bug417483.js => browser/base/content/test/general/browser_bug417483.js rename : browser/base/content/test/browser_bug419612.js => browser/base/content/test/general/browser_bug419612.js rename : browser/base/content/test/browser_bug422590.js => browser/base/content/test/general/browser_bug422590.js rename : browser/base/content/test/browser_bug423833.js => browser/base/content/test/general/browser_bug423833.js rename : browser/base/content/test/browser_bug424101.js => browser/base/content/test/general/browser_bug424101.js rename : browser/base/content/test/browser_bug427559.js => browser/base/content/test/general/browser_bug427559.js rename : browser/base/content/test/browser_bug432599.js => browser/base/content/test/general/browser_bug432599.js rename : browser/base/content/test/browser_bug435035.js => browser/base/content/test/general/browser_bug435035.js rename : browser/base/content/test/browser_bug435325.js => browser/base/content/test/general/browser_bug435325.js rename : browser/base/content/test/browser_bug441778.js => browser/base/content/test/general/browser_bug441778.js rename : browser/base/content/test/browser_bug455852.js => browser/base/content/test/general/browser_bug455852.js rename : browser/base/content/test/browser_bug460146.js => browser/base/content/test/general/browser_bug460146.js rename : browser/base/content/test/browser_bug462289.js => browser/base/content/test/general/browser_bug462289.js rename : browser/base/content/test/browser_bug462673.js => browser/base/content/test/general/browser_bug462673.js rename : browser/base/content/test/browser_bug477014.js => browser/base/content/test/general/browser_bug477014.js rename : browser/base/content/test/browser_bug479408.js => browser/base/content/test/general/browser_bug479408.js rename : browser/base/content/test/browser_bug479408_sample.html => browser/base/content/test/general/browser_bug479408_sample.html rename : browser/base/content/test/browser_bug481560.js => browser/base/content/test/general/browser_bug481560.js rename : browser/base/content/test/browser_bug484315.js => browser/base/content/test/general/browser_bug484315.js rename : browser/base/content/test/browser_bug491431.js => browser/base/content/test/general/browser_bug491431.js rename : browser/base/content/test/browser_bug495058.js => browser/base/content/test/general/browser_bug495058.js rename : browser/base/content/test/browser_bug517902.js => browser/base/content/test/general/browser_bug517902.js rename : browser/base/content/test/browser_bug519216.js => browser/base/content/test/general/browser_bug519216.js rename : browser/base/content/test/browser_bug520538.js => browser/base/content/test/general/browser_bug520538.js rename : browser/base/content/test/browser_bug521216.js => browser/base/content/test/general/browser_bug521216.js rename : browser/base/content/test/browser_bug533232.js => browser/base/content/test/general/browser_bug533232.js rename : browser/base/content/test/browser_bug537013.js => browser/base/content/test/general/browser_bug537013.js rename : browser/base/content/test/browser_bug537474.js => browser/base/content/test/general/browser_bug537474.js rename : browser/base/content/test/browser_bug550565.js => browser/base/content/test/general/browser_bug550565.js rename : browser/base/content/test/browser_bug553455.js => browser/base/content/test/general/browser_bug553455.js rename : browser/base/content/test/browser_bug555224.js => browser/base/content/test/general/browser_bug555224.js rename : browser/base/content/test/browser_bug555767.js => browser/base/content/test/general/browser_bug555767.js rename : browser/base/content/test/browser_bug556061.js => browser/base/content/test/general/browser_bug556061.js rename : browser/base/content/test/browser_bug559991.js => browser/base/content/test/general/browser_bug559991.js rename : browser/base/content/test/browser_bug561623.js => browser/base/content/test/general/browser_bug561623.js rename : browser/base/content/test/browser_bug561636.js => browser/base/content/test/general/browser_bug561636.js rename : browser/base/content/test/browser_bug562649.js => browser/base/content/test/general/browser_bug562649.js rename : browser/base/content/test/browser_bug563588.js => browser/base/content/test/general/browser_bug563588.js rename : browser/base/content/test/browser_bug565575.js => browser/base/content/test/general/browser_bug565575.js rename : browser/base/content/test/browser_bug565667.js => browser/base/content/test/general/browser_bug565667.js rename : browser/base/content/test/browser_bug567306.js => browser/base/content/test/general/browser_bug567306.js rename : browser/base/content/test/browser_bug575561.js => browser/base/content/test/general/browser_bug575561.js rename : browser/base/content/test/browser_bug575830.js => browser/base/content/test/general/browser_bug575830.js rename : browser/base/content/test/browser_bug577121.js => browser/base/content/test/general/browser_bug577121.js rename : browser/base/content/test/browser_bug578534.js => browser/base/content/test/general/browser_bug578534.js rename : browser/base/content/test/browser_bug579872.js => browser/base/content/test/general/browser_bug579872.js rename : browser/base/content/test/browser_bug580638.js => browser/base/content/test/general/browser_bug580638.js rename : browser/base/content/test/browser_bug580956.js => browser/base/content/test/general/browser_bug580956.js rename : browser/base/content/test/browser_bug581242.js => browser/base/content/test/general/browser_bug581242.js rename : browser/base/content/test/browser_bug581253.js => browser/base/content/test/general/browser_bug581253.js rename : browser/base/content/test/browser_bug581947.js => browser/base/content/test/general/browser_bug581947.js rename : browser/base/content/test/browser_bug585558.js => browser/base/content/test/general/browser_bug585558.js rename : browser/base/content/test/browser_bug585785.js => browser/base/content/test/general/browser_bug585785.js rename : browser/base/content/test/browser_bug585830.js => browser/base/content/test/general/browser_bug585830.js rename : browser/base/content/test/browser_bug590206.js => browser/base/content/test/general/browser_bug590206.js rename : browser/base/content/test/browser_bug592338.js => browser/base/content/test/general/browser_bug592338.js rename : browser/base/content/test/browser_bug594131.js => browser/base/content/test/general/browser_bug594131.js rename : browser/base/content/test/browser_bug595507.js => browser/base/content/test/general/browser_bug595507.js rename : browser/base/content/test/browser_bug596687.js => browser/base/content/test/general/browser_bug596687.js rename : browser/base/content/test/browser_bug597218.js => browser/base/content/test/general/browser_bug597218.js rename : browser/base/content/test/browser_bug598923.js => browser/base/content/test/general/browser_bug598923.js rename : browser/base/content/test/browser_bug599325.js => browser/base/content/test/general/browser_bug599325.js rename : browser/base/content/test/browser_bug609700.js => browser/base/content/test/general/browser_bug609700.js rename : browser/base/content/test/browser_bug616836.js => browser/base/content/test/general/browser_bug616836.js rename : browser/base/content/test/browser_bug623155.js => browser/base/content/test/general/browser_bug623155.js rename : browser/base/content/test/browser_bug623893.js => browser/base/content/test/general/browser_bug623893.js rename : browser/base/content/test/browser_bug624734.js => browser/base/content/test/general/browser_bug624734.js rename : browser/base/content/test/browser_bug647886.js => browser/base/content/test/general/browser_bug647886.js rename : browser/base/content/test/browser_bug655584.js => browser/base/content/test/general/browser_bug655584.js rename : browser/base/content/test/browser_bug664672.js => browser/base/content/test/general/browser_bug664672.js rename : browser/base/content/test/browser_bug676619.js => browser/base/content/test/general/browser_bug676619.js rename : browser/base/content/test/browser_bug678392-1.html => browser/base/content/test/general/browser_bug678392-1.html rename : browser/base/content/test/browser_bug678392-2.html => browser/base/content/test/general/browser_bug678392-2.html rename : browser/base/content/test/browser_bug678392.js => browser/base/content/test/general/browser_bug678392.js rename : browser/base/content/test/browser_bug710878.js => browser/base/content/test/general/browser_bug710878.js rename : browser/base/content/test/browser_bug719271.js => browser/base/content/test/general/browser_bug719271.js rename : browser/base/content/test/browser_bug724239.js => browser/base/content/test/general/browser_bug724239.js rename : browser/base/content/test/browser_bug734076.js => browser/base/content/test/general/browser_bug734076.js rename : browser/base/content/test/browser_bug735471.js => browser/base/content/test/general/browser_bug735471.js rename : browser/base/content/test/browser_bug743421.js => browser/base/content/test/general/browser_bug743421.js rename : browser/base/content/test/browser_bug744745.js => browser/base/content/test/general/browser_bug744745.js rename : browser/base/content/test/browser_bug749738.js => browser/base/content/test/general/browser_bug749738.js rename : browser/base/content/test/browser_bug752516.js => browser/base/content/test/general/browser_bug752516.js rename : browser/base/content/test/browser_bug763468_perwindowpb.js => browser/base/content/test/general/browser_bug763468_perwindowpb.js rename : browser/base/content/test/browser_bug767836_perwindowpb.js => browser/base/content/test/general/browser_bug767836_perwindowpb.js rename : browser/base/content/test/browser_bug771331.js => browser/base/content/test/general/browser_bug771331.js rename : browser/base/content/test/browser_bug783614.js => browser/base/content/test/general/browser_bug783614.js rename : browser/base/content/test/browser_bug787619.js => browser/base/content/test/general/browser_bug787619.js rename : browser/base/content/test/browser_bug797677.js => browser/base/content/test/general/browser_bug797677.js rename : browser/base/content/test/browser_bug812562.js => browser/base/content/test/general/browser_bug812562.js rename : browser/base/content/test/browser_bug816527.js => browser/base/content/test/general/browser_bug816527.js rename : browser/base/content/test/browser_bug817947.js => browser/base/content/test/general/browser_bug817947.js rename : browser/base/content/test/browser_bug818118.js => browser/base/content/test/general/browser_bug818118.js rename : browser/base/content/test/browser_bug820497.js => browser/base/content/test/general/browser_bug820497.js rename : browser/base/content/test/browser_bug822367.js => browser/base/content/test/general/browser_bug822367.js rename : browser/base/content/test/browser_bug832435.js => browser/base/content/test/general/browser_bug832435.js rename : browser/base/content/test/browser_bug839103.js => browser/base/content/test/general/browser_bug839103.js rename : browser/base/content/test/browser_bug880101.js => browser/base/content/test/general/browser_bug880101.js rename : browser/base/content/test/browser_bug882977.js => browser/base/content/test/general/browser_bug882977.js rename : browser/base/content/test/browser_bug887515.js => browser/base/content/test/general/browser_bug887515.js rename : browser/base/content/test/browser_bug902156.js => browser/base/content/test/general/browser_bug902156.js rename : browser/base/content/test/browser_canonizeURL.js => browser/base/content/test/general/browser_canonizeURL.js rename : browser/base/content/test/browser_clearplugindata.html => browser/base/content/test/general/browser_clearplugindata.html rename : browser/base/content/test/browser_clearplugindata.js => browser/base/content/test/general/browser_clearplugindata.js rename : browser/base/content/test/browser_clearplugindata_noage.html => browser/base/content/test/general/browser_clearplugindata_noage.html rename : browser/base/content/test/browser_contentAreaClick.js => browser/base/content/test/general/browser_contentAreaClick.js rename : browser/base/content/test/browser_contextSearchTabPosition.js => browser/base/content/test/general/browser_contextSearchTabPosition.js rename : browser/base/content/test/browser_ctrlTab.js => browser/base/content/test/general/browser_ctrlTab.js rename : browser/base/content/test/browser_customize.js => browser/base/content/test/general/browser_customize.js rename : browser/base/content/test/browser_customize_popupNotification.js => browser/base/content/test/general/browser_customize_popupNotification.js rename : browser/base/content/test/browser_datareporting_notification.js => browser/base/content/test/general/browser_datareporting_notification.js rename : browser/base/content/test/browser_disablechrome.js => browser/base/content/test/general/browser_disablechrome.js rename : browser/base/content/test/browser_discovery.js => browser/base/content/test/general/browser_discovery.js rename : browser/base/content/test/browser_drag.js => browser/base/content/test/general/browser_drag.js rename : browser/base/content/test/browser_duplicateIDs.js => browser/base/content/test/general/browser_duplicateIDs.js rename : browser/base/content/test/browser_findbarClose.js => browser/base/content/test/general/browser_findbarClose.js rename : browser/base/content/test/browser_fullscreen-window-open.js => browser/base/content/test/general/browser_fullscreen-window-open.js rename : browser/base/content/test/browser_gestureSupport.js => browser/base/content/test/general/browser_gestureSupport.js rename : browser/base/content/test/browser_getshortcutoruri.js => browser/base/content/test/general/browser_getshortcutoruri.js rename : browser/base/content/test/browser_hide_removing.js => browser/base/content/test/general/browser_hide_removing.js rename : browser/base/content/test/browser_homeDrop.js => browser/base/content/test/general/browser_homeDrop.js rename : browser/base/content/test/browser_identity_UI.js => browser/base/content/test/general/browser_identity_UI.js rename : browser/base/content/test/browser_keywordBookmarklets.js => browser/base/content/test/general/browser_keywordBookmarklets.js rename : browser/base/content/test/browser_keywordSearch.js => browser/base/content/test/general/browser_keywordSearch.js rename : browser/base/content/test/browser_keywordSearch_postData.js => browser/base/content/test/general/browser_keywordSearch_postData.js rename : browser/base/content/test/browser_lastAccessedTab.js => browser/base/content/test/general/browser_lastAccessedTab.js rename : browser/base/content/test/browser_locationBarCommand.js => browser/base/content/test/general/browser_locationBarCommand.js rename : browser/base/content/test/browser_locationBarExternalLoad.js => browser/base/content/test/general/browser_locationBarExternalLoad.js rename : browser/base/content/test/browser_middleMouse_inherit.js => browser/base/content/test/general/browser_middleMouse_inherit.js rename : browser/base/content/test/browser_minimize.js => browser/base/content/test/general/browser_minimize.js rename : browser/base/content/test/browser_mixedcontent_securityflags.js => browser/base/content/test/general/browser_mixedcontent_securityflags.js rename : browser/base/content/test/browser_offlineQuotaNotification.js => browser/base/content/test/general/browser_offlineQuotaNotification.js rename : browser/base/content/test/browser_overflowScroll.js => browser/base/content/test/general/browser_overflowScroll.js rename : browser/base/content/test/browser_pageInfo.js => browser/base/content/test/general/browser_pageInfo.js rename : browser/base/content/test/browser_pageInfo_plugins.js => browser/base/content/test/general/browser_pageInfo_plugins.js rename : browser/base/content/test/browser_page_style_menu.js => browser/base/content/test/general/browser_page_style_menu.js rename : browser/base/content/test/browser_pinnedTabs.js => browser/base/content/test/general/browser_pinnedTabs.js rename : browser/base/content/test/browser_plainTextLinks.js => browser/base/content/test/general/browser_plainTextLinks.js rename : browser/base/content/test/browser_pluginCrashCommentAndURL.js => browser/base/content/test/general/browser_pluginCrashCommentAndURL.js rename : browser/base/content/test/browser_pluginnotification.js => browser/base/content/test/general/browser_pluginnotification.js rename : browser/base/content/test/browser_pluginplaypreview.js => browser/base/content/test/general/browser_pluginplaypreview.js rename : browser/base/content/test/browser_pluginplaypreview2.js => browser/base/content/test/general/browser_pluginplaypreview2.js rename : browser/base/content/test/browser_plugins_added_dynamically.js => browser/base/content/test/general/browser_plugins_added_dynamically.js rename : browser/base/content/test/browser_popupNotification.js => browser/base/content/test/general/browser_popupNotification.js rename : browser/base/content/test/browser_popupUI.js => browser/base/content/test/general/browser_popupUI.js rename : browser/base/content/test/browser_private_browsing_window.js => browser/base/content/test/general/browser_private_browsing_window.js rename : browser/base/content/test/browser_private_no_prompt.js => browser/base/content/test/general/browser_private_no_prompt.js rename : browser/base/content/test/browser_relatedTabs.js => browser/base/content/test/general/browser_relatedTabs.js rename : browser/base/content/test/browser_removeTabsToTheEnd.js => browser/base/content/test/general/browser_removeTabsToTheEnd.js rename : browser/base/content/test/browser_sanitize-download-history.js => browser/base/content/test/general/browser_sanitize-download-history.js rename : browser/base/content/test/browser_sanitize-passwordDisabledHosts.js => browser/base/content/test/general/browser_sanitize-passwordDisabledHosts.js rename : browser/base/content/test/browser_sanitize-sitepermissions.js => browser/base/content/test/general/browser_sanitize-sitepermissions.js rename : browser/base/content/test/browser_sanitize-timespans.js => browser/base/content/test/general/browser_sanitize-timespans.js rename : browser/base/content/test/browser_sanitizeDialog.js => browser/base/content/test/general/browser_sanitizeDialog.js rename : browser/base/content/test/browser_sanitizeDialog_treeView.js => browser/base/content/test/general/browser_sanitizeDialog_treeView.js rename : browser/base/content/test/browser_save_link-perwindowpb.js => browser/base/content/test/general/browser_save_link-perwindowpb.js rename : browser/base/content/test/browser_save_private_link_perwindowpb.js => browser/base/content/test/general/browser_save_private_link_perwindowpb.js rename : browser/base/content/test/browser_save_video.js => browser/base/content/test/general/browser_save_video.js rename : browser/base/content/test/browser_scope.js => browser/base/content/test/general/browser_scope.js rename : browser/base/content/test/browser_selectTabAtIndex.js => browser/base/content/test/general/browser_selectTabAtIndex.js rename : browser/base/content/test/browser_tabDrop.js => browser/base/content/test/general/browser_tabDrop.js rename : browser/base/content/test/browser_tabMatchesInAwesomebar_perwindowpb.js => browser/base/content/test/general/browser_tabMatchesInAwesomebar_perwindowpb.js rename : browser/base/content/test/browser_tab_drag_drop_perwindow.js => browser/base/content/test/general/browser_tab_drag_drop_perwindow.js rename : browser/base/content/test/browser_tab_dragdrop.js => browser/base/content/test/general/browser_tab_dragdrop.js rename : browser/base/content/test/browser_tab_dragdrop2.js => browser/base/content/test/general/browser_tab_dragdrop2.js rename : browser/base/content/test/browser_tab_dragdrop2_frame1.xul => browser/base/content/test/general/browser_tab_dragdrop2_frame1.xul rename : browser/base/content/test/browser_tabfocus.js => browser/base/content/test/general/browser_tabfocus.js rename : browser/base/content/test/browser_tabopen_reflows.js => browser/base/content/test/general/browser_tabopen_reflows.js rename : browser/base/content/test/browser_tabs_isActive.js => browser/base/content/test/general/browser_tabs_isActive.js rename : browser/base/content/test/browser_tabs_owner.js => browser/base/content/test/general/browser_tabs_owner.js rename : browser/base/content/test/browser_typeAheadFind.js => browser/base/content/test/general/browser_typeAheadFind.js rename : browser/base/content/test/browser_unloaddialogs.js => browser/base/content/test/general/browser_unloaddialogs.js rename : browser/base/content/test/browser_urlHighlight.js => browser/base/content/test/general/browser_urlHighlight.js rename : browser/base/content/test/browser_urlbarAutoFillTrimURLs.js => browser/base/content/test/general/browser_urlbarAutoFillTrimURLs.js rename : browser/base/content/test/browser_urlbarCopying.js => browser/base/content/test/general/browser_urlbarCopying.js rename : browser/base/content/test/browser_urlbarEnter.js => browser/base/content/test/general/browser_urlbarEnter.js rename : browser/base/content/test/browser_urlbarRevert.js => browser/base/content/test/general/browser_urlbarRevert.js rename : browser/base/content/test/browser_urlbarStop.js => browser/base/content/test/general/browser_urlbarStop.js rename : browser/base/content/test/browser_urlbarTrimURLs.js => browser/base/content/test/general/browser_urlbarTrimURLs.js rename : browser/base/content/test/browser_urlbar_search_healthreport.js => browser/base/content/test/general/browser_urlbar_search_healthreport.js rename : browser/base/content/test/browser_utilityOverlay.js => browser/base/content/test/general/browser_utilityOverlay.js rename : browser/base/content/test/browser_visibleFindSelection.js => browser/base/content/test/general/browser_visibleFindSelection.js rename : browser/base/content/test/browser_visibleTabs.js => browser/base/content/test/general/browser_visibleTabs.js rename : browser/base/content/test/browser_visibleTabs_bookmarkAllPages.js => browser/base/content/test/general/browser_visibleTabs_bookmarkAllPages.js rename : browser/base/content/test/browser_visibleTabs_bookmarkAllTabs.js => browser/base/content/test/general/browser_visibleTabs_bookmarkAllTabs.js rename : browser/base/content/test/browser_visibleTabs_contextMenu.js => browser/base/content/test/general/browser_visibleTabs_contextMenu.js rename : browser/base/content/test/browser_visibleTabs_tabPreview.js => browser/base/content/test/general/browser_visibleTabs_tabPreview.js rename : browser/base/content/test/browser_wyciwyg_urlbarCopying.js => browser/base/content/test/general/browser_wyciwyg_urlbarCopying.js rename : browser/base/content/test/browser_zbug569342.js => browser/base/content/test/general/browser_zbug569342.js rename : browser/base/content/test/bug364677-data.xml => browser/base/content/test/general/bug364677-data.xml rename : browser/base/content/test/bug364677-data.xml^headers^ => browser/base/content/test/general/bug364677-data.xml^headers^ rename : browser/base/content/test/bug395533-data.txt => browser/base/content/test/general/bug395533-data.txt rename : browser/base/content/test/bug564387.html => browser/base/content/test/general/bug564387.html rename : browser/base/content/test/bug564387_video1.ogv => browser/base/content/test/general/bug564387_video1.ogv rename : browser/base/content/test/bug564387_video1.ogv^headers^ => browser/base/content/test/general/bug564387_video1.ogv^headers^ rename : browser/base/content/test/bug592338.html => browser/base/content/test/general/bug592338.html rename : browser/base/content/test/bug792517-2.html => browser/base/content/test/general/bug792517-2.html rename : browser/base/content/test/bug792517.html => browser/base/content/test/general/bug792517.html rename : browser/base/content/test/bug792517.sjs => browser/base/content/test/general/bug792517.sjs rename : browser/base/content/test/bug839103.css => browser/base/content/test/general/bug839103.css rename : browser/base/content/test/contextmenu_common.js => browser/base/content/test/general/contextmenu_common.js rename : browser/base/content/test/ctxmenu-image.png => browser/base/content/test/general/ctxmenu-image.png rename : browser/base/content/test/disablechrome.html => browser/base/content/test/general/disablechrome.html rename : browser/base/content/test/discovery.html => browser/base/content/test/general/discovery.html rename : browser/base/content/test/domplate_test.js => browser/base/content/test/general/domplate_test.js rename : browser/base/content/test/download_page.html => browser/base/content/test/general/download_page.html rename : browser/base/content/test/dummy_page.html => browser/base/content/test/general/dummy_page.html rename : browser/base/content/test/feed_discovery.html => browser/base/content/test/general/feed_discovery.html rename : browser/base/content/test/feed_tab.html => browser/base/content/test/general/feed_tab.html rename : browser/base/content/test/file_bug550565_favicon.ico => browser/base/content/test/general/file_bug550565_favicon.ico rename : browser/base/content/test/file_bug550565_popup.html => browser/base/content/test/general/file_bug550565_popup.html rename : browser/base/content/test/file_bug822367_1.html => browser/base/content/test/general/file_bug822367_1.html rename : browser/base/content/test/file_bug822367_1.js => browser/base/content/test/general/file_bug822367_1.js rename : browser/base/content/test/file_bug822367_2.html => browser/base/content/test/general/file_bug822367_2.html rename : browser/base/content/test/file_bug822367_3.html => browser/base/content/test/general/file_bug822367_3.html rename : browser/base/content/test/file_bug822367_4.html => browser/base/content/test/general/file_bug822367_4.html rename : browser/base/content/test/file_bug822367_4.js => browser/base/content/test/general/file_bug822367_4.js rename : browser/base/content/test/file_bug822367_4B.html => browser/base/content/test/general/file_bug822367_4B.html rename : browser/base/content/test/file_bug822367_5.html => browser/base/content/test/general/file_bug822367_5.html rename : browser/base/content/test/file_bug822367_6.html => browser/base/content/test/general/file_bug822367_6.html rename : browser/base/content/test/file_bug902156.js => browser/base/content/test/general/file_bug902156.js rename : browser/base/content/test/file_bug902156_1.html => browser/base/content/test/general/file_bug902156_1.html rename : browser/base/content/test/file_bug902156_2.html => browser/base/content/test/general/file_bug902156_2.html rename : browser/base/content/test/file_bug902156_3.html => browser/base/content/test/general/file_bug902156_3.html rename : browser/base/content/test/file_fullscreen-window-open.html => browser/base/content/test/general/file_fullscreen-window-open.html rename : browser/base/content/test/gZipOfflineChild.cacheManifest => browser/base/content/test/general/gZipOfflineChild.cacheManifest rename : browser/base/content/test/gZipOfflineChild.cacheManifest^headers^ => browser/base/content/test/general/gZipOfflineChild.cacheManifest^headers^ rename : browser/base/content/test/gZipOfflineChild.html => browser/base/content/test/general/gZipOfflineChild.html rename : browser/base/content/test/gZipOfflineChild.html^headers^ => browser/base/content/test/general/gZipOfflineChild.html^headers^ rename : browser/base/content/test/gZipOfflineChild_uncompressed.html => browser/base/content/test/general/gZipOfflineChild_uncompressed.html rename : browser/base/content/test/head.js => browser/base/content/test/general/head.js rename : browser/base/content/test/head_plain.js => browser/base/content/test/general/head_plain.js rename : browser/base/content/test/healthreport_testRemoteCommands.html => browser/base/content/test/general/healthreport_testRemoteCommands.html rename : browser/base/content/test/newtab/moz.build => browser/base/content/test/general/moz.build rename : browser/base/content/test/moz.png => browser/base/content/test/general/moz.png rename : browser/base/content/test/offlineByDefault.js => browser/base/content/test/general/offlineByDefault.js rename : browser/base/content/test/offlineChild.cacheManifest => browser/base/content/test/general/offlineChild.cacheManifest rename : browser/base/content/test/offlineChild.cacheManifest^headers^ => browser/base/content/test/general/offlineChild.cacheManifest^headers^ rename : browser/base/content/test/offlineChild.html => browser/base/content/test/general/offlineChild.html rename : browser/base/content/test/offlineChild2.cacheManifest => browser/base/content/test/general/offlineChild2.cacheManifest rename : browser/base/content/test/offlineChild2.cacheManifest^headers^ => browser/base/content/test/general/offlineChild2.cacheManifest^headers^ rename : browser/base/content/test/offlineChild2.html => browser/base/content/test/general/offlineChild2.html rename : browser/base/content/test/offlineEvent.cacheManifest => browser/base/content/test/general/offlineEvent.cacheManifest rename : browser/base/content/test/offlineEvent.cacheManifest^headers^ => browser/base/content/test/general/offlineEvent.cacheManifest^headers^ rename : browser/base/content/test/offlineEvent.html => browser/base/content/test/general/offlineEvent.html rename : browser/base/content/test/offlineQuotaNotification.cacheManifest => browser/base/content/test/general/offlineQuotaNotification.cacheManifest rename : browser/base/content/test/offlineQuotaNotification.html => browser/base/content/test/general/offlineQuotaNotification.html rename : browser/base/content/test/page_style_sample.html => browser/base/content/test/general/page_style_sample.html rename : browser/base/content/test/pluginCrashCommentAndURL.html => browser/base/content/test/general/pluginCrashCommentAndURL.html rename : browser/base/content/test/plugin_add_dynamically.html => browser/base/content/test/general/plugin_add_dynamically.html rename : browser/base/content/test/plugin_alternate_content.html => browser/base/content/test/general/plugin_alternate_content.html rename : browser/base/content/test/plugin_both.html => browser/base/content/test/general/plugin_both.html rename : browser/base/content/test/plugin_both2.html => browser/base/content/test/general/plugin_both2.html rename : browser/base/content/test/plugin_bug744745.html => browser/base/content/test/general/plugin_bug744745.html rename : browser/base/content/test/plugin_bug749455.html => browser/base/content/test/general/plugin_bug749455.html rename : browser/base/content/test/plugin_bug752516.html => browser/base/content/test/general/plugin_bug752516.html rename : browser/base/content/test/plugin_bug787619.html => browser/base/content/test/general/plugin_bug787619.html rename : browser/base/content/test/plugin_bug797677.html => browser/base/content/test/general/plugin_bug797677.html rename : browser/base/content/test/plugin_bug820497.html => browser/base/content/test/general/plugin_bug820497.html rename : browser/base/content/test/plugin_clickToPlayAllow.html => browser/base/content/test/general/plugin_clickToPlayAllow.html rename : browser/base/content/test/plugin_clickToPlayDeny.html => browser/base/content/test/general/plugin_clickToPlayDeny.html rename : browser/base/content/test/plugin_data_url.html => browser/base/content/test/general/plugin_data_url.html rename : browser/base/content/test/plugin_hidden_to_visible.html => browser/base/content/test/general/plugin_hidden_to_visible.html rename : browser/base/content/test/plugin_test.html => browser/base/content/test/general/plugin_test.html rename : browser/base/content/test/plugin_test2.html => browser/base/content/test/general/plugin_test2.html rename : browser/base/content/test/plugin_test3.html => browser/base/content/test/general/plugin_test3.html rename : browser/base/content/test/plugin_two_types.html => browser/base/content/test/general/plugin_two_types.html rename : browser/base/content/test/plugin_unknown.html => browser/base/content/test/general/plugin_unknown.html rename : browser/base/content/test/print_postdata.sjs => browser/base/content/test/general/print_postdata.sjs rename : browser/base/content/test/privateBrowsingMode.js => browser/base/content/test/general/privateBrowsingMode.js rename : browser/base/content/test/redirect_bug623155.sjs => browser/base/content/test/general/redirect_bug623155.sjs rename : browser/base/content/test/subtst_contextmenu.html => browser/base/content/test/general/subtst_contextmenu.html rename : browser/base/content/test/test-mixedcontent-securityerrors.html => browser/base/content/test/general/test-mixedcontent-securityerrors.html rename : browser/base/content/test/test_bug364677.html => browser/base/content/test/general/test_bug364677.html rename : browser/base/content/test/test_bug395533.html => browser/base/content/test/general/test_bug395533.html rename : browser/base/content/test/test_bug435035.html => browser/base/content/test/general/test_bug435035.html rename : browser/base/content/test/test_bug452451.html => browser/base/content/test/general/test_bug452451.html rename : browser/base/content/test/test_bug462673.html => browser/base/content/test/general/test_bug462673.html rename : browser/base/content/test/test_bug628179.html => browser/base/content/test/general/test_bug628179.html rename : browser/base/content/test/test_bug839103.html => browser/base/content/test/general/test_bug839103.html rename : browser/base/content/test/test_contextmenu.html => browser/base/content/test/general/test_contextmenu.html rename : browser/base/content/test/test_contextmenu_input.html => browser/base/content/test/general/test_contextmenu_input.html rename : browser/base/content/test/test_feed_discovery.html => browser/base/content/test/general/test_feed_discovery.html rename : browser/base/content/test/test_offlineNotification.html => browser/base/content/test/general/test_offlineNotification.html rename : browser/base/content/test/test_offline_gzip.html => browser/base/content/test/general/test_offline_gzip.html rename : browser/base/content/test/test_wyciwyg_copying.html => browser/base/content/test/general/test_wyciwyg_copying.html rename : browser/base/content/test/title_test.svg => browser/base/content/test/general/title_test.svg rename : browser/base/content/test/video.ogg => browser/base/content/test/general/video.ogg rename : browser/base/content/test/zoom_test.html => browser/base/content/test/general/zoom_test.html
1111 lines
34 KiB
JavaScript
1111 lines
34 KiB
JavaScript
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim:set ts=2 sw=2 sts=2 et: */
|
|
/* 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/. */
|
|
|
|
/**
|
|
* Tests the sanitize dialog (a.k.a. the clear recent history dialog).
|
|
* See bug 480169.
|
|
*
|
|
* The purpose of this test is not to fully flex the sanitize timespan code;
|
|
* browser/base/content/test/general/browser_sanitize-timespans.js does that. This
|
|
* test checks the UI of the dialog and makes sure it's correctly connected to
|
|
* the sanitize timespan code.
|
|
*
|
|
* Some of this code, especially the history creation parts, was taken from
|
|
* browser/base/content/test/general/browser_sanitize-timespans.js.
|
|
*/
|
|
|
|
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
|
|
"resource://gre/modules/FormHistory.jsm");
|
|
XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
|
|
"resource://gre/modules/Downloads.jsm");
|
|
|
|
let tempScope = {};
|
|
Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
|
|
.loadSubScript("chrome://browser/content/sanitize.js", tempScope);
|
|
let Sanitizer = tempScope.Sanitizer;
|
|
|
|
const kMsecPerMin = 60 * 1000;
|
|
const kUsecPerMin = 60 * 1000000;
|
|
|
|
let formEntries, downloadIDs, olderDownloadIDs;
|
|
|
|
// Add tests here. Each is a function that's called by doNextTest().
|
|
var gAllTests = [
|
|
|
|
/**
|
|
* Initializes the dialog to its default state.
|
|
*/
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
// Select "Last Hour"
|
|
this.selectDuration(Sanitizer.TIMESPAN_HOUR);
|
|
// Hide details
|
|
if (!this.getItemList().collapsed)
|
|
this.toggleDetails();
|
|
this.acceptDialog();
|
|
};
|
|
wh.open();
|
|
},
|
|
|
|
/**
|
|
* Cancels the dialog, makes sure history not cleared.
|
|
*/
|
|
function () {
|
|
// Add history (within the past hour)
|
|
let uris = [];
|
|
let places = [];
|
|
let pURI;
|
|
for (let i = 0; i < 30; i++) {
|
|
pURI = makeURI("http://" + i + "-minutes-ago.com/");
|
|
places.push({uri: pURI, visitDate: visitTimeForMinutesAgo(i)});
|
|
uris.push(pURI);
|
|
}
|
|
|
|
addVisits(places, function() {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
this.selectDuration(Sanitizer.TIMESPAN_HOUR);
|
|
this.checkPrefCheckbox("history", false);
|
|
this.checkDetails(false);
|
|
|
|
// Show details
|
|
this.toggleDetails();
|
|
this.checkDetails(true);
|
|
|
|
// Hide details
|
|
this.toggleDetails();
|
|
this.checkDetails(false);
|
|
this.cancelDialog();
|
|
};
|
|
wh.onunload = function () {
|
|
yield promiseHistoryClearedState(uris, false);
|
|
yield blankSlate();
|
|
yield promiseHistoryClearedState(uris, true);
|
|
};
|
|
wh.open();
|
|
});
|
|
},
|
|
|
|
function () {
|
|
// Add downloads (within the past hour).
|
|
Task.spawn(function () {
|
|
downloadIDs = [];
|
|
for (let i = 0; i < 5; i++) {
|
|
yield addDownloadWithMinutesAgo(downloadIDs, i);
|
|
}
|
|
// Add downloads (over an hour ago).
|
|
olderDownloadIDs = [];
|
|
for (let i = 0; i < 5; i++) {
|
|
yield addDownloadWithMinutesAgo(olderDownloadIDs, 61 + i);
|
|
}
|
|
|
|
doNextTest();
|
|
}).then(null, Components.utils.reportError);
|
|
},
|
|
|
|
/**
|
|
* Ensures that the combined history-downloads checkbox clears both history
|
|
* visits and downloads when checked; the dialog respects simple timespan.
|
|
*/
|
|
function () {
|
|
// Add history (within the past hour).
|
|
let uris = [];
|
|
let places = [];
|
|
let pURI;
|
|
for (let i = 0; i < 30; i++) {
|
|
pURI = makeURI("http://" + i + "-minutes-ago.com/");
|
|
places.push({uri: pURI, visitDate: visitTimeForMinutesAgo(i)});
|
|
uris.push(pURI);
|
|
}
|
|
// Add history (over an hour ago).
|
|
let olderURIs = [];
|
|
for (let i = 0; i < 5; i++) {
|
|
pURI = makeURI("http://" + (61 + i) + "-minutes-ago.com/");
|
|
places.push({uri: pURI, visitDate: visitTimeForMinutesAgo(61 + i)});
|
|
olderURIs.push(pURI);
|
|
}
|
|
|
|
addVisits(places, function() {
|
|
let totalHistoryVisits = uris.length + olderURIs.length;
|
|
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
this.selectDuration(Sanitizer.TIMESPAN_HOUR);
|
|
this.checkPrefCheckbox("history", true);
|
|
this.acceptDialog();
|
|
|
|
intPrefIs("sanitize.timeSpan", Sanitizer.TIMESPAN_HOUR,
|
|
"timeSpan pref should be hour after accepting dialog with " +
|
|
"hour selected");
|
|
boolPrefIs("cpd.history", true,
|
|
"history pref should be true after accepting dialog with " +
|
|
"history checkbox checked");
|
|
boolPrefIs("cpd.downloads", true,
|
|
"downloads pref should be true after accepting dialog with " +
|
|
"history checkbox checked");
|
|
};
|
|
wh.onunload = function () {
|
|
// History visits and downloads within one hour should be cleared.
|
|
yield promiseHistoryClearedState(uris, true);
|
|
yield ensureDownloadsClearedState(downloadIDs, true);
|
|
|
|
// Visits and downloads > 1 hour should still exist.
|
|
yield promiseHistoryClearedState(olderURIs, false);
|
|
yield ensureDownloadsClearedState(olderDownloadIDs, false);
|
|
|
|
// OK, done, cleanup after ourselves.
|
|
yield blankSlate();
|
|
yield promiseHistoryClearedState(olderURIs, true);
|
|
yield ensureDownloadsClearedState(olderDownloadIDs, true);
|
|
};
|
|
wh.open();
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Add form history entries for the next test.
|
|
*/
|
|
function () {
|
|
formEntries = [];
|
|
|
|
let iter = function() {
|
|
for (let i = 0; i < 5; i++) {
|
|
formEntries.push(addFormEntryWithMinutesAgo(iter, i));
|
|
yield undefined;
|
|
}
|
|
doNextTest();
|
|
}();
|
|
|
|
iter.next();
|
|
},
|
|
|
|
function () {
|
|
// Add downloads (within the past hour).
|
|
Task.spawn(function () {
|
|
downloadIDs = [];
|
|
for (let i = 0; i < 5; i++) {
|
|
yield addDownloadWithMinutesAgo(downloadIDs, i);
|
|
}
|
|
|
|
doNextTest();
|
|
}).then(null, Components.utils.reportError);
|
|
},
|
|
|
|
/**
|
|
* Ensures that the combined history-downloads checkbox removes neither
|
|
* history visits nor downloads when not checked.
|
|
*/
|
|
function () {
|
|
// Add history, downloads, form entries (within the past hour).
|
|
let uris = [];
|
|
let places = [];
|
|
let pURI;
|
|
for (let i = 0; i < 5; i++) {
|
|
pURI = makeURI("http://" + i + "-minutes-ago.com/");
|
|
places.push({uri: pURI, visitDate: visitTimeForMinutesAgo(i)});
|
|
uris.push(pURI);
|
|
}
|
|
|
|
addVisits(places, function() {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
is(this.isWarningPanelVisible(), false,
|
|
"Warning panel should be hidden after previously accepting dialog " +
|
|
"with a predefined timespan");
|
|
this.selectDuration(Sanitizer.TIMESPAN_HOUR);
|
|
|
|
// Remove only form entries, leave history (including downloads).
|
|
this.checkPrefCheckbox("history", false);
|
|
this.checkPrefCheckbox("formdata", true);
|
|
this.acceptDialog();
|
|
|
|
intPrefIs("sanitize.timeSpan", Sanitizer.TIMESPAN_HOUR,
|
|
"timeSpan pref should be hour after accepting dialog with " +
|
|
"hour selected");
|
|
boolPrefIs("cpd.history", false,
|
|
"history pref should be false after accepting dialog with " +
|
|
"history checkbox unchecked");
|
|
boolPrefIs("cpd.downloads", false,
|
|
"downloads pref should be false after accepting dialog with " +
|
|
"history checkbox unchecked");
|
|
};
|
|
wh.onunload = function () {
|
|
// Of the three only form entries should be cleared.
|
|
yield promiseHistoryClearedState(uris, false);
|
|
yield ensureDownloadsClearedState(downloadIDs, false);
|
|
|
|
formEntries.forEach(function (entry) {
|
|
let exists = yield formNameExists(entry);
|
|
is(exists, false, "form entry " + entry + " should no longer exist");
|
|
});
|
|
|
|
// OK, done, cleanup after ourselves.
|
|
yield blankSlate();
|
|
yield promiseHistoryClearedState(uris, true);
|
|
yield ensureDownloadsClearedState(downloadIDs, true);
|
|
};
|
|
wh.open();
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Ensures that the "Everything" duration option works.
|
|
*/
|
|
function () {
|
|
// Add history.
|
|
let uris = [];
|
|
let places = [];
|
|
let pURI;
|
|
// within past hour, within past two hours, within past four hours and
|
|
// outside past four hours
|
|
[10, 70, 130, 250].forEach(function(aValue) {
|
|
pURI = makeURI("http://" + aValue + "-minutes-ago.com/");
|
|
places.push({uri: pURI, visitDate: visitTimeForMinutesAgo(aValue)});
|
|
uris.push(pURI);
|
|
});
|
|
addVisits(places, function() {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
is(this.isWarningPanelVisible(), false,
|
|
"Warning panel should be hidden after previously accepting dialog " +
|
|
"with a predefined timespan");
|
|
this.selectDuration(Sanitizer.TIMESPAN_EVERYTHING);
|
|
this.checkPrefCheckbox("history", true);
|
|
this.checkDetails(true);
|
|
|
|
// Hide details
|
|
this.toggleDetails();
|
|
this.checkDetails(false);
|
|
|
|
// Show details
|
|
this.toggleDetails();
|
|
this.checkDetails(true);
|
|
|
|
this.acceptDialog();
|
|
|
|
intPrefIs("sanitize.timeSpan", Sanitizer.TIMESPAN_EVERYTHING,
|
|
"timeSpan pref should be everything after accepting dialog " +
|
|
"with everything selected");
|
|
};
|
|
wh.onunload = function () {
|
|
yield promiseHistoryClearedState(uris, true);
|
|
};
|
|
wh.open();
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Ensures that the "Everything" warning is visible on dialog open after
|
|
* the previous test.
|
|
*/
|
|
function () {
|
|
// Add history.
|
|
let uris = [];
|
|
let places = [];
|
|
let pURI;
|
|
// within past hour, within past two hours, within past four hours and
|
|
// outside past four hours
|
|
[10, 70, 130, 250].forEach(function(aValue) {
|
|
pURI = makeURI("http://" + aValue + "-minutes-ago.com/");
|
|
places.push({uri: pURI, visitDate: visitTimeForMinutesAgo(aValue)});
|
|
uris.push(pURI);
|
|
});
|
|
addVisits(places, function() {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
is(this.isWarningPanelVisible(), true,
|
|
"Warning panel should be visible after previously accepting dialog " +
|
|
"with clearing everything");
|
|
this.selectDuration(Sanitizer.TIMESPAN_EVERYTHING);
|
|
this.checkPrefCheckbox("history", true);
|
|
this.acceptDialog();
|
|
|
|
intPrefIs("sanitize.timeSpan", Sanitizer.TIMESPAN_EVERYTHING,
|
|
"timeSpan pref should be everything after accepting dialog " +
|
|
"with everything selected");
|
|
};
|
|
wh.onunload = function () {
|
|
yield promiseHistoryClearedState(uris, true);
|
|
};
|
|
wh.open();
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Add form history entry for the next test.
|
|
*/
|
|
function () {
|
|
let iter = function() {
|
|
formEntries = [ addFormEntryWithMinutesAgo(iter, 10) ];
|
|
yield undefined;
|
|
doNextTest();
|
|
}();
|
|
|
|
iter.next();
|
|
},
|
|
|
|
/**
|
|
* The next three tests checks that when a certain history item cannot be
|
|
* cleared then the checkbox should be both disabled and unchecked.
|
|
* In addition, we ensure that this behavior does not modify the preferences.
|
|
*/
|
|
function () {
|
|
// Add history.
|
|
let pURI = makeURI("http://" + 10 + "-minutes-ago.com/");
|
|
addVisits({uri: pURI, visitDate: visitTimeForMinutesAgo(10)}, function() {
|
|
let uris = [ pURI ];
|
|
|
|
let wh = new WindowHelper();
|
|
wh.onload = function() {
|
|
// Check that the relevant checkboxes are enabled
|
|
var cb = this.win.document.querySelectorAll(
|
|
"#itemList > [preference='privacy.cpd.formdata']");
|
|
ok(cb.length == 1 && !cb[0].disabled, "There is formdata, checkbox to " +
|
|
"clear formdata should be enabled.");
|
|
|
|
var cb = this.win.document.querySelectorAll(
|
|
"#itemList > [preference='privacy.cpd.history']");
|
|
ok(cb.length == 1 && !cb[0].disabled, "There is history, checkbox to " +
|
|
"clear history should be enabled.");
|
|
|
|
this.checkAllCheckboxes();
|
|
this.acceptDialog();
|
|
};
|
|
wh.onunload = function () {
|
|
yield promiseHistoryClearedState(uris, true);
|
|
|
|
let exists = yield formNameExists(formEntries[0]);
|
|
is(exists, false, "form entry " + formEntries[0] + " should no longer exist");
|
|
};
|
|
wh.open();
|
|
});
|
|
},
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function() {
|
|
boolPrefIs("cpd.history", true,
|
|
"history pref should be true after accepting dialog with " +
|
|
"history checkbox checked");
|
|
boolPrefIs("cpd.formdata", true,
|
|
"formdata pref should be true after accepting dialog with " +
|
|
"formdata checkbox checked");
|
|
|
|
|
|
// Even though the formdata pref is true, because there is no history
|
|
// left to clear, the checkbox will be disabled.
|
|
var cb = this.win.document.querySelectorAll(
|
|
"#itemList > [preference='privacy.cpd.formdata']");
|
|
ok(cb.length == 1 && cb[0].disabled && !cb[0].checked,
|
|
"There is no formdata history, checkbox should be disabled and be " +
|
|
"cleared to reduce user confusion (bug 497664).");
|
|
|
|
var cb = this.win.document.querySelectorAll(
|
|
"#itemList > [preference='privacy.cpd.history']");
|
|
ok(cb.length == 1 && !cb[0].disabled && cb[0].checked,
|
|
"There is no history, but history checkbox should always be enabled " +
|
|
"and will be checked from previous preference.");
|
|
|
|
this.acceptDialog();
|
|
}
|
|
wh.open();
|
|
},
|
|
|
|
/**
|
|
* Add form history entry for the next test.
|
|
*/
|
|
function () {
|
|
let iter = function() {
|
|
formEntries = [ addFormEntryWithMinutesAgo(iter, 10) ];
|
|
yield undefined;
|
|
doNextTest();
|
|
}();
|
|
|
|
iter.next();
|
|
},
|
|
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function() {
|
|
boolPrefIs("cpd.formdata", true,
|
|
"formdata pref should persist previous value after accepting " +
|
|
"dialog where you could not clear formdata.");
|
|
|
|
var cb = this.win.document.querySelectorAll(
|
|
"#itemList > [preference='privacy.cpd.formdata']");
|
|
ok(cb.length == 1 && !cb[0].disabled && cb[0].checked,
|
|
"There exists formEntries so the checkbox should be in sync with " +
|
|
"the pref.");
|
|
|
|
this.acceptDialog();
|
|
};
|
|
wh.onunload = function () {
|
|
let exists = yield formNameExists(formEntries[0]);
|
|
is(exists, false, "form entry " + formEntries[0] + " should no longer exist");
|
|
};
|
|
wh.open();
|
|
},
|
|
|
|
|
|
/**
|
|
* These next six tests together ensure that toggling details persists
|
|
* across dialog openings.
|
|
*/
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
// Check all items and select "Everything"
|
|
this.checkAllCheckboxes();
|
|
this.selectDuration(Sanitizer.TIMESPAN_EVERYTHING);
|
|
|
|
// Hide details
|
|
this.toggleDetails();
|
|
this.checkDetails(false);
|
|
this.acceptDialog();
|
|
};
|
|
wh.open();
|
|
},
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
// Details should remain closed because all items are checked.
|
|
this.checkDetails(false);
|
|
|
|
// Uncheck history.
|
|
this.checkPrefCheckbox("history", false);
|
|
this.acceptDialog();
|
|
};
|
|
wh.open();
|
|
},
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
// Details should be open because not all items are checked.
|
|
this.checkDetails(true);
|
|
|
|
// Modify the Site Preferences item state (bug 527820)
|
|
this.checkAllCheckboxes();
|
|
this.checkPrefCheckbox("siteSettings", false);
|
|
this.acceptDialog();
|
|
};
|
|
wh.open();
|
|
},
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
// Details should be open because not all items are checked.
|
|
this.checkDetails(true);
|
|
|
|
// Hide details
|
|
this.toggleDetails();
|
|
this.checkDetails(false);
|
|
this.cancelDialog();
|
|
};
|
|
wh.open();
|
|
},
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
// Details should be open because not all items are checked.
|
|
this.checkDetails(true);
|
|
|
|
// Select another duration
|
|
this.selectDuration(Sanitizer.TIMESPAN_HOUR);
|
|
// Hide details
|
|
this.toggleDetails();
|
|
this.checkDetails(false);
|
|
this.acceptDialog();
|
|
};
|
|
wh.open();
|
|
},
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
// Details should not be open because "Last Hour" is selected
|
|
this.checkDetails(false);
|
|
|
|
this.cancelDialog();
|
|
};
|
|
wh.open();
|
|
},
|
|
function () {
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
// Details should have remained closed
|
|
this.checkDetails(false);
|
|
|
|
// Show details
|
|
this.toggleDetails();
|
|
this.checkDetails(true);
|
|
this.cancelDialog();
|
|
};
|
|
wh.open();
|
|
},
|
|
function () {
|
|
// Test for offline cache deletion
|
|
|
|
// Prepare stuff, we will work with www.example.com
|
|
var URL = "http://www.example.com";
|
|
|
|
var ios = Cc["@mozilla.org/network/io-service;1"]
|
|
.getService(Ci.nsIIOService);
|
|
var URI = ios.newURI(URL, null, null);
|
|
|
|
var sm = Cc["@mozilla.org/scriptsecuritymanager;1"]
|
|
.getService(Ci.nsIScriptSecurityManager);
|
|
var principal = sm.getNoAppCodebasePrincipal(URI);
|
|
|
|
// Give www.example.com privileges to store offline data
|
|
var pm = Cc["@mozilla.org/permissionmanager;1"]
|
|
.getService(Ci.nsIPermissionManager);
|
|
pm.addFromPrincipal(principal, "offline-app", Ci.nsIPermissionManager.ALLOW_ACTION);
|
|
pm.addFromPrincipal(principal, "offline-app", Ci.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
|
|
|
|
// Store something to the offline cache
|
|
const nsICache = Components.interfaces.nsICache;
|
|
var cs = Components.classes["@mozilla.org/network/cache-service;1"]
|
|
.getService(Components.interfaces.nsICacheService);
|
|
var session = cs.createSession(URL + "/manifest", nsICache.STORE_OFFLINE, nsICache.STREAM_BASED);
|
|
|
|
// Open the dialog
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
this.selectDuration(Sanitizer.TIMESPAN_EVERYTHING);
|
|
// Show details
|
|
this.toggleDetails();
|
|
// Clear only offlineApps
|
|
this.uncheckAllCheckboxes();
|
|
this.checkPrefCheckbox("offlineApps", true);
|
|
this.acceptDialog();
|
|
|
|
// Check if the cache has been deleted
|
|
var size = -1;
|
|
var visitor = {
|
|
visitDevice: function (deviceID, deviceInfo)
|
|
{
|
|
if (deviceID == "offline")
|
|
size = deviceInfo.totalSize;
|
|
|
|
// Do not enumerate entries
|
|
return false;
|
|
},
|
|
|
|
visitEntry: function (deviceID, entryInfo)
|
|
{
|
|
// Do not enumerate entries.
|
|
return false;
|
|
}
|
|
};
|
|
cs.visitEntries(visitor);
|
|
is(size, 0, "offline application cache entries evicted");
|
|
};
|
|
|
|
var cacheListener = {
|
|
onCacheEntryAvailable: function (entry, access, status) {
|
|
is(status, Cr.NS_OK);
|
|
var stream = entry.openOutputStream(0);
|
|
var content = "content";
|
|
stream.write(content, content.length);
|
|
stream.close();
|
|
entry.close();
|
|
wh.open();
|
|
}
|
|
};
|
|
|
|
session.asyncOpenCacheEntry(URL, nsICache.ACCESS_READ_WRITE, cacheListener);
|
|
},
|
|
function () {
|
|
// Test for offline apps permission deletion
|
|
|
|
// Prepare stuff, we will work with www.example.com
|
|
var URL = "http://www.example.com";
|
|
|
|
var ios = Cc["@mozilla.org/network/io-service;1"]
|
|
.getService(Ci.nsIIOService);
|
|
var URI = ios.newURI(URL, null, null);
|
|
|
|
var sm = Cc["@mozilla.org/scriptsecuritymanager;1"]
|
|
.getService(Ci.nsIScriptSecurityManager);
|
|
var principal = sm.getNoAppCodebasePrincipal(URI);
|
|
|
|
// Open the dialog
|
|
let wh = new WindowHelper();
|
|
wh.onload = function () {
|
|
this.selectDuration(Sanitizer.TIMESPAN_EVERYTHING);
|
|
// Show details
|
|
this.toggleDetails();
|
|
// Clear only offlineApps
|
|
this.uncheckAllCheckboxes();
|
|
this.checkPrefCheckbox("siteSettings", true);
|
|
this.acceptDialog();
|
|
|
|
// Check all has been deleted (privileges, data, cache)
|
|
var pm = Cc["@mozilla.org/permissionmanager;1"]
|
|
.getService(Ci.nsIPermissionManager);
|
|
is(pm.testPermissionFromPrincipal(principal, "offline-app"), 0, "offline-app permissions removed");
|
|
};
|
|
wh.open();
|
|
}
|
|
];
|
|
|
|
// Index in gAllTests of the test currently being run. Incremented for each
|
|
// test run. See doNextTest().
|
|
var gCurrTest = 0;
|
|
|
|
let now_mSec = Date.now();
|
|
let now_uSec = now_mSec * 1000;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
/**
|
|
* This wraps the dialog and provides some convenience methods for interacting
|
|
* with it.
|
|
*
|
|
* @param aWin
|
|
* The dialog's nsIDOMWindow
|
|
*/
|
|
function WindowHelper(aWin) {
|
|
this.win = aWin;
|
|
}
|
|
|
|
WindowHelper.prototype = {
|
|
/**
|
|
* "Presses" the dialog's OK button.
|
|
*/
|
|
acceptDialog: function () {
|
|
is(this.win.document.documentElement.getButton("accept").disabled, false,
|
|
"Dialog's OK button should not be disabled");
|
|
this.win.document.documentElement.acceptDialog();
|
|
},
|
|
|
|
/**
|
|
* "Presses" the dialog's Cancel button.
|
|
*/
|
|
cancelDialog: function () {
|
|
this.win.document.documentElement.cancelDialog();
|
|
},
|
|
|
|
/**
|
|
* Ensures that the details progressive disclosure button and the item list
|
|
* hidden by it match up. Also makes sure the height of the dialog is
|
|
* sufficient for the item list and warning panel.
|
|
*
|
|
* @param aShouldBeShown
|
|
* True if you expect the details to be shown and false if hidden
|
|
*/
|
|
checkDetails: function (aShouldBeShown) {
|
|
let button = this.getDetailsButton();
|
|
let list = this.getItemList();
|
|
let hidden = list.hidden || list.collapsed;
|
|
is(hidden, !aShouldBeShown,
|
|
"Details should be " + (aShouldBeShown ? "shown" : "hidden") +
|
|
" but were actually " + (hidden ? "hidden" : "shown"));
|
|
let dir = hidden ? "down" : "up";
|
|
is(button.className, "expander-" + dir,
|
|
"Details button should be " + dir + " because item list is " +
|
|
(hidden ? "" : "not ") + "hidden");
|
|
let height = 0;
|
|
if (!hidden) {
|
|
ok(list.boxObject.height > 30, "listbox has sufficient size")
|
|
height += list.boxObject.height;
|
|
}
|
|
if (this.isWarningPanelVisible())
|
|
height += this.getWarningPanel().boxObject.height;
|
|
ok(height < this.win.innerHeight,
|
|
"Window should be tall enough to fit warning panel and item list");
|
|
},
|
|
|
|
/**
|
|
* (Un)checks a history scope checkbox (browser & download history,
|
|
* form history, etc.).
|
|
*
|
|
* @param aPrefName
|
|
* The final portion of the checkbox's privacy.cpd.* preference name
|
|
* @param aCheckState
|
|
* True if the checkbox should be checked, false otherwise
|
|
*/
|
|
checkPrefCheckbox: function (aPrefName, aCheckState) {
|
|
var pref = "privacy.cpd." + aPrefName;
|
|
var cb = this.win.document.querySelectorAll(
|
|
"#itemList > [preference='" + pref + "']");
|
|
is(cb.length, 1, "found checkbox for " + pref + " preference");
|
|
if (cb[0].checked != aCheckState)
|
|
cb[0].click();
|
|
},
|
|
|
|
/**
|
|
* Makes sure all the checkboxes are checked.
|
|
*/
|
|
_checkAllCheckboxesCustom: function (check) {
|
|
var cb = this.win.document.querySelectorAll("#itemList > [preference]");
|
|
ok(cb.length > 1, "found checkboxes for preferences");
|
|
for (var i = 0; i < cb.length; ++i) {
|
|
var pref = this.win.document.getElementById(cb[i].getAttribute("preference"));
|
|
if (!!pref.value ^ check)
|
|
cb[i].click();
|
|
}
|
|
},
|
|
|
|
checkAllCheckboxes: function () {
|
|
this._checkAllCheckboxesCustom(true);
|
|
},
|
|
|
|
uncheckAllCheckboxes: function () {
|
|
this._checkAllCheckboxesCustom(false);
|
|
},
|
|
|
|
/**
|
|
* @return The details progressive disclosure button
|
|
*/
|
|
getDetailsButton: function () {
|
|
return this.win.document.getElementById("detailsExpander");
|
|
},
|
|
|
|
/**
|
|
* @return The dialog's duration dropdown
|
|
*/
|
|
getDurationDropdown: function () {
|
|
return this.win.document.getElementById("sanitizeDurationChoice");
|
|
},
|
|
|
|
/**
|
|
* @return The item list hidden by the details progressive disclosure button
|
|
*/
|
|
getItemList: function () {
|
|
return this.win.document.getElementById("itemList");
|
|
},
|
|
|
|
/**
|
|
* @return The clear-everything warning box
|
|
*/
|
|
getWarningPanel: function () {
|
|
return this.win.document.getElementById("sanitizeEverythingWarningBox");
|
|
},
|
|
|
|
/**
|
|
* @return True if the "Everything" warning panel is visible (as opposed to
|
|
* the tree)
|
|
*/
|
|
isWarningPanelVisible: function () {
|
|
return !this.getWarningPanel().hidden;
|
|
},
|
|
|
|
/**
|
|
* Opens the clear recent history dialog. Before calling this, set
|
|
* this.onload to a function to execute onload. It should close the dialog
|
|
* when done so that the tests may continue. Set this.onunload to a function
|
|
* to execute onunload. this.onunload is optional. If it returns true, the
|
|
* caller is expected to call waitForAsyncUpdates at some point; if false is
|
|
* returned, waitForAsyncUpdates is called automatically.
|
|
*/
|
|
open: function () {
|
|
let wh = this;
|
|
|
|
function windowObserver(aSubject, aTopic, aData) {
|
|
if (aTopic != "domwindowopened")
|
|
return;
|
|
|
|
Services.ww.unregisterNotification(windowObserver);
|
|
|
|
var loaded = false;
|
|
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
|
|
|
win.addEventListener("load", function onload(event) {
|
|
win.removeEventListener("load", onload, false);
|
|
|
|
if (win.name !== "SanitizeDialog")
|
|
return;
|
|
|
|
wh.win = win;
|
|
loaded = true;
|
|
|
|
executeSoon(function () {
|
|
// Some exceptions that reach here don't reach the test harness, but
|
|
// ok()/is() do...
|
|
try {
|
|
wh.onload();
|
|
}
|
|
catch (exc) {
|
|
win.close();
|
|
ok(false, "Unexpected exception: " + exc + "\n" + exc.stack);
|
|
finish();
|
|
}
|
|
});
|
|
}, false);
|
|
|
|
win.addEventListener("unload", function onunload(event) {
|
|
if (win.name !== "SanitizeDialog") {
|
|
win.removeEventListener("unload", onunload, false);
|
|
return;
|
|
}
|
|
|
|
// Why is unload fired before load?
|
|
if (!loaded)
|
|
return;
|
|
|
|
win.removeEventListener("unload", onunload, false);
|
|
wh.win = win;
|
|
|
|
executeSoon(function () {
|
|
// Some exceptions that reach here don't reach the test harness, but
|
|
// ok()/is() do...
|
|
try {
|
|
if (wh.onunload) {
|
|
Task.spawn(wh.onunload).then(function() {
|
|
waitForAsyncUpdates(doNextTest);
|
|
}).then(null, Components.utils.reportError);
|
|
} else {
|
|
waitForAsyncUpdates(doNextTest);
|
|
}
|
|
}
|
|
catch (exc) {
|
|
win.close();
|
|
ok(false, "Unexpected exception: " + exc + "\n" + exc.stack);
|
|
finish();
|
|
}
|
|
});
|
|
}, false);
|
|
}
|
|
Services.ww.registerNotification(windowObserver);
|
|
Services.ww.openWindow(null,
|
|
"chrome://browser/content/sanitize.xul",
|
|
"SanitizeDialog",
|
|
"chrome,titlebar,dialog,centerscreen,modal",
|
|
null);
|
|
},
|
|
|
|
/**
|
|
* Selects a duration in the duration dropdown.
|
|
*
|
|
* @param aDurVal
|
|
* One of the Sanitizer.TIMESPAN_* values
|
|
*/
|
|
selectDuration: function (aDurVal) {
|
|
this.getDurationDropdown().value = aDurVal;
|
|
if (aDurVal === Sanitizer.TIMESPAN_EVERYTHING) {
|
|
is(this.isWarningPanelVisible(), true,
|
|
"Warning panel should be visible for TIMESPAN_EVERYTHING");
|
|
}
|
|
else {
|
|
is(this.isWarningPanelVisible(), false,
|
|
"Warning panel should not be visible for non-TIMESPAN_EVERYTHING");
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Toggles the details progressive disclosure button.
|
|
*/
|
|
toggleDetails: function () {
|
|
this.getDetailsButton().click();
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Adds a download to history.
|
|
*
|
|
* @param aMinutesAgo
|
|
* The download will be downloaded this many minutes ago
|
|
*/
|
|
function addDownloadWithMinutesAgo(aExpectedPathList, aMinutesAgo) {
|
|
let publicList = yield Downloads.getList(Downloads.PUBLIC);
|
|
|
|
let name = "fakefile-" + aMinutesAgo + "-minutes-ago";
|
|
let download = yield Downloads.createDownload({
|
|
source: "https://bugzilla.mozilla.org/show_bug.cgi?id=480169",
|
|
target: name
|
|
});
|
|
download.startTime = new Date(now_mSec - (aMinutesAgo * kMsecPerMin));
|
|
download.canceled = true;
|
|
publicList.add(download);
|
|
|
|
ok((yield downloadExists(name)),
|
|
"Sanity check: download " + name +
|
|
" should exist after creating it");
|
|
|
|
aExpectedPathList.push(name);
|
|
}
|
|
|
|
/**
|
|
* Adds a form entry to history.
|
|
*
|
|
* @param aMinutesAgo
|
|
* The entry will be added this many minutes ago
|
|
*/
|
|
function addFormEntryWithMinutesAgo(then, aMinutesAgo) {
|
|
let name = aMinutesAgo + "-minutes-ago";
|
|
|
|
// Artifically age the entry to the proper vintage.
|
|
let timestamp = now_uSec - (aMinutesAgo * kUsecPerMin);
|
|
|
|
FormHistory.update({ op: "add", fieldname: name, value: "dummy", firstUsed: timestamp },
|
|
{ handleError: function (error) {
|
|
do_throw("Error occurred updating form history: " + error);
|
|
},
|
|
handleCompletion: function (reason) { then.next(); }
|
|
});
|
|
return name;
|
|
}
|
|
|
|
/**
|
|
* Checks if a form entry exists.
|
|
*/
|
|
function formNameExists(name)
|
|
{
|
|
let deferred = Promise.defer();
|
|
|
|
let count = 0;
|
|
FormHistory.count({ fieldname: name },
|
|
{ handleResult: function (result) count = result,
|
|
handleError: function (error) {
|
|
do_throw("Error occurred searching form history: " + error);
|
|
deferred.reject(error);
|
|
},
|
|
handleCompletion: function (reason) {
|
|
if (!reason) deferred.resolve(count);
|
|
}
|
|
});
|
|
|
|
return deferred.promise;
|
|
}
|
|
|
|
/**
|
|
* Removes all history visits, downloads, and form entries.
|
|
*/
|
|
function blankSlate() {
|
|
PlacesUtils.bhistory.removeAllPages();
|
|
|
|
// The promise is resolved only when removing both downloads and form history are done.
|
|
let deferred = Promise.defer();
|
|
let formHistoryDone = false, downloadsDone = false;
|
|
|
|
Task.spawn(function deleteAllDownloads() {
|
|
let publicList = yield Downloads.getList(Downloads.PUBLIC);
|
|
let downloads = yield publicList.getAll();
|
|
for (let download of downloads) {
|
|
yield publicList.remove(download);
|
|
yield download.finalize(true);
|
|
}
|
|
downloadsDone = true;
|
|
if (formHistoryDone) {
|
|
deferred.resolve();
|
|
}
|
|
}).then(null, Components.utils.reportError);
|
|
|
|
FormHistory.update({ op: "remove" },
|
|
{ handleError: function (error) {
|
|
do_throw("Error occurred updating form history: " + error);
|
|
deferred.reject(error);
|
|
},
|
|
handleCompletion: function (reason) {
|
|
if (!reason) {
|
|
formHistoryDone = true;
|
|
if (downloadsDone) {
|
|
deferred.resolve();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
return deferred.promise;
|
|
}
|
|
|
|
/**
|
|
* Ensures that the given pref is the expected value.
|
|
*
|
|
* @param aPrefName
|
|
* The pref's sub-branch under the privacy branch
|
|
* @param aExpectedVal
|
|
* The pref's expected value
|
|
* @param aMsg
|
|
* Passed to is()
|
|
*/
|
|
function boolPrefIs(aPrefName, aExpectedVal, aMsg) {
|
|
is(gPrefService.getBoolPref("privacy." + aPrefName), aExpectedVal, aMsg);
|
|
}
|
|
|
|
/**
|
|
* Checks to see if the download with the specified path exists.
|
|
*
|
|
* @param aPath
|
|
* The path of the download to check
|
|
* @return True if the download exists, false otherwise
|
|
*/
|
|
function downloadExists(aPath)
|
|
{
|
|
return Task.spawn(function() {
|
|
let publicList = yield Downloads.getList(Downloads.PUBLIC);
|
|
let listArray = yield publicList.getAll();
|
|
throw new Task.Result(listArray.some(i => i.target.path == aPath));
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Runs the next test in the gAllTests array. If all tests have been run,
|
|
* finishes the entire suite.
|
|
*/
|
|
function doNextTest() {
|
|
if (gAllTests.length <= gCurrTest) {
|
|
blankSlate();
|
|
waitForAsyncUpdates(finish);
|
|
}
|
|
else {
|
|
let ct = gCurrTest;
|
|
gCurrTest++;
|
|
gAllTests[ct]();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Ensures that the specified downloads are either cleared or not.
|
|
*
|
|
* @param aDownloadIDs
|
|
* Array of download database IDs
|
|
* @param aShouldBeCleared
|
|
* True if each download should be cleared, false otherwise
|
|
*/
|
|
function ensureDownloadsClearedState(aDownloadIDs, aShouldBeCleared) {
|
|
let niceStr = aShouldBeCleared ? "no longer" : "still";
|
|
aDownloadIDs.forEach(function (id) {
|
|
is((yield downloadExists(id)), !aShouldBeCleared,
|
|
"download " + id + " should " + niceStr + " exist");
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Ensures that the given pref is the expected value.
|
|
*
|
|
* @param aPrefName
|
|
* The pref's sub-branch under the privacy branch
|
|
* @param aExpectedVal
|
|
* The pref's expected value
|
|
* @param aMsg
|
|
* Passed to is()
|
|
*/
|
|
function intPrefIs(aPrefName, aExpectedVal, aMsg) {
|
|
is(gPrefService.getIntPref("privacy." + aPrefName), aExpectedVal, aMsg);
|
|
}
|
|
|
|
/**
|
|
* Creates a visit time.
|
|
*
|
|
* @param aMinutesAgo
|
|
* The visit will be visited this many minutes ago
|
|
*/
|
|
function visitTimeForMinutesAgo(aMinutesAgo) {
|
|
return now_uSec - aMinutesAgo * kUsecPerMin;
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
function test() {
|
|
requestLongerTimeout(2);
|
|
waitForExplicitFinish();
|
|
blankSlate();
|
|
// Kick off all the tests in the gAllTests array.
|
|
waitForAsyncUpdates(doNextTest);
|
|
}
|