active-update.xml is not saved after a channel change which leaves behind cruft

RESOLVED FIXED

Status

()

Toolkit
Application Update
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: rstrong, Assigned: rstrong)

Tracking

unspecified
Points:
---
Bug Flags:
in-litmus +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 8 obsolete attachments)

5.23 KB, patch
rstrong
: review+
Details | Diff | Splinter Review
Found while working on bug 485624
Created attachment 370371 [details] [diff] [review]
patch w/ tests rev1 (requires patches from bug 485624)
Attachment #370371 - Flags: review?(dtownsend)
Attachment #370371 - Attachment description: patch w/ tests rev1 → patch w/ tests rev1 (requires patches from bug 485624)
Comment on attachment 370371 [details] [diff] [review]
patch w/ tests rev1 (requires patches from bug 485624)

>diff --git a/toolkit/mozapps/update/test/unit/test_0063_Manager_local_xml.js b/toolkit/mozapps/update/test/unit/test_0063_Manager_local_xml.js
>new file mode 100644
>--- /dev/null
>+++ b/toolkit/mozapps/update/test/unit/test_0063_Manager_local_xml.js

Please consider these fixed in my repo
>+  dump("Testing: verifying contents of " + FILE_UPDATE_ACTIVE "\n");
should be
>+  dump("Testing: verifying contents of " + FILE_UPDATE_ACTIVE + "\n");
and
>+  dump("Testing: verifying contents of " + FILE_UPDATES_DB "\n");
should be
should be
>+  dump("Testing: verifying contents of " + FILE_UPDATES_DB + "\n");
Created attachment 370373 [details] [diff] [review]
patch w/ tests rev2 (requires patches from bug 485624)
Attachment #370371 - Attachment is obsolete: true
Attachment #370373 - Flags: review?(dtownsend)
Attachment #370371 - Flags: review?(dtownsend)
Comment on attachment 370373 [details] [diff] [review]
patch w/ tests rev2 (requires patches from bug 485624)

bah... this also existing overwrites the update history.
Attachment #370373 - Attachment is obsolete: true
Attachment #370373 - Flags: review?(dtownsend)
Created attachment 370376 [details] [diff] [review]
patch w/ tests rev3 (requires patches from bug 487346)

this should do it
Attachment #370376 - Flags: review?(dtownsend)
Comment on attachment 370376 [details] [diff] [review]
patch w/ tests rev3 (requires patches from bug 487346)

>--- a/toolkit/mozapps/update/test/unit/head_update.js
>+++ b/toolkit/mozapps/update/test/unit/head_update.js
>...
>@@ -402,6 +402,31 @@ function closeSafeOutputStream(fos) {
>     fos.close();
> }
> 
>+function readUpdateXMLFile(fileName) {
>+  var fileLocator = AUS_Cc["@mozilla.org/file/directory_service;1"]
>+                      .getService(AUS_Ci.nsIProperties);
>+  var dir = fileLocator.get("GreD", AUS_Ci.nsIFile);
>+
>+  var file = dir.clone();
The above 3 vars are replaced by the following with the changes I've made in bug 487346
  var file = gNewGreD.clone();

>+function readFile(file) {
>+  var fis = AUS_Cc["@mozilla.org/network/file-input-stream;1"]
>+              .createInstance(AUS_Ci.nsIFileInputStream);
>+  var modeFlags = MODE_RDONLY;
>+  if (!file.exists())
>+    return null;
>+  fis.init(file, modeFlags, PERMS_FILE, 0);
I changed this to just use MODE_RDONLY instead of the var

Other than that it is good to go
Attachment #370376 - Attachment description: patch w/ tests rev3 (requires patches from bug 485624) → patch w/ tests rev3 (requires patches from bug 487346)
Created attachment 373023 [details] [diff] [review]
patch rev4 remove bitrot - requires the patch from bug 487346
Attachment #370376 - Attachment is obsolete: true
Attachment #373023 - Flags: review?(dtownsend)
Attachment #370376 - Flags: review?(dtownsend)
Created attachment 373025 [details] [diff] [review]
patch rev4 remove bitrot - requires the patch from bug 487346

missed a file :(
Attachment #373023 - Attachment is obsolete: true
Attachment #373025 - Flags: review?(dtownsend)
Attachment #373023 - Flags: review?(dtownsend)
Created attachment 373160 [details] [diff] [review]
patch rev5 remove bitrot again
Attachment #373025 - Attachment is obsolete: true
Attachment #373160 - Flags: review?(dtownsend)
Attachment #373025 - Flags: review?(dtownsend)
Created attachment 373279 [details] [diff] [review]
patch rev6 remove bitrot - requires patch from bug 488797

gonna hold off on requesting review until after bug 488797 is fixed
Attachment #373160 - Attachment is obsolete: true
Attachment #373160 - Flags: review?(dtownsend)
Created attachment 377740 [details] [diff] [review]
patch rev7 - remove bitrot
Attachment #373279 - Attachment is obsolete: true
Attachment #377740 - Flags: review?(dtownsend)
Attachment #377740 - Flags: review?(dtownsend) → review+
Pushed to mozilla-central
http://hg.mozilla.org/mozilla-central/rev/371be45fedd1
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Flags: in-litmus+
Resolution: --- → FIXED
Created attachment 378422 [details] [diff] [review]
patch as checked in (requires patch from bug 493805)
Attachment #377740 - Attachment is obsolete: true
Attachment #378422 - Flags: review+
You need to log in before you can comment on or make changes to this bug.