Commit b9f0306f authored by Kershaw Chang's avatar Kershaw Chang
Browse files

Bug 1743079 - Remove ResetUserPrefs(), r=KrisWright

parent d4e89a6f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3722,8 +3722,7 @@ Preferences::ResetPrefs() {
  return InitInitialObjects(/* isStartup */ false);
}

NS_IMETHODIMP
Preferences::ResetUserPrefs() {
nsresult Preferences::ResetUserPrefs() {
  ENSURE_PARENT_PROCESS("Preferences::ResetUserPrefs", "all prefs");
  NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
  MOZ_ASSERT(NS_IsMainThread());
+2 −0
Original line number Diff line number Diff line
@@ -445,6 +445,8 @@ class Preferences final : public nsIPrefService,
  nsresult SavePrefFileInternal(nsIFile* aFile, SaveMethod aSaveMethod);
  nsresult WritePrefFile(nsIFile* aFile, SaveMethod aSaveMethod);

  nsresult ResetUserPrefs();

  // Helpers for implementing
  // Register(Prefix)Callback/Unregister(Prefix)Callback.
 public:
+0 −6
Original line number Diff line number Diff line
@@ -62,12 +62,6 @@ interface nsIPrefService : nsISupports
   */
  void resetPrefs();

  /**
   * Called to reset all preferences with user set values back to the
   * application default values.
   */
  void resetUserPrefs();

  /**
   * Called to write current preferences state to a file.
   *
+4 −3
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ var SESSION_KEYS = {
};

function do_register_cleanup() {
  Services.prefs.resetUserPrefs();
  Services.prefs.clearUserPref("intl.accept_languages");
  Services.prefs.clearUserPref("services.common.log.logger.rest.request");

  // remove the pref change listener
  let hawk = new HAWKAuthenticatedRESTRequest("https://example.com");
@@ -150,7 +151,7 @@ add_task(async function test_hawk_authenticated_request() {
  Assert.equal(200, request.response.status);
  Assert.equal(request.response.body, "yay");

  Services.prefs.resetUserPrefs();
  Services.prefs.clearUserPref("intl.accept_languages");
  let pref = Services.prefs.getComplexValue(
    "intl.accept_languages",
    Ci.nsIPrefLocalizedString
@@ -206,7 +207,7 @@ add_task(async function test_hawk_language_pref_changed() {
  let response = await request.post({});

  Assert.equal(200, response.status);
  Services.prefs.resetUserPrefs();
  Services.prefs.clearUserPref("intl.accept_languages");

  await promiseStopServer(server);
});