Closed Bug 1442160 Opened 6 years ago Closed 6 years ago

browser_storage_dynamic_updates_localStorage.js and browser_storage_dynamic_updates_sessionstorage.js are using unnecessary generators

Categories

(DevTools :: Storage Inspector, enhancement)

enhancement
Not set
normal

Tracking

(firefox60 fixed)

RESOLVED FIXED
Firefox 60
Tracking Status
firefox60 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

These two files are using generators to call `clear` method, but this method never wait for any promise or async operation. So we could use plain functions instead.
That would help the Task.jsm refactoring (bug 1440321)
https://searchfox.org/mozilla-central/source/devtools/client/storage/test/browser_storage_dynamic_updates_localStorage.js#53-58
https://searchfox.org/mozilla-central/source/devtools/client/storage/test/browser_storage_dynamic_updates_sessionStorage.js#67-72
  // Clearing items. Bug 1233497 makes it so that we can no longer yield
  // CPOWs from Tasks. We work around this by calling clear via a ContentTask
  // instead.
  yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
    return Task.spawn(content.wrappedJSObject.clear);
  });

https://searchfox.org/mozilla-central/source/devtools/client/storage/test/storage-updates.html#35-46
/**
 * We keep this method here even though these items are automatically cleared
 * after the test is complete. this is so that the store-objects-cleared event
 * can be tested.
 */
window.clear = function*() {
  localStorage.clear();
  dump("removed localStorage from " + document.location + "\n");

  sessionStorage.clear();
  dump("removed sessionStorage from " + document.location + "\n");
};
Assignee: nobody → poirot.alex
Comment on attachment 8955048 [details]
Bug 1442160 - Remove unnecessary usages of generators in storage test.

https://reviewboard.mozilla.org/r/224226/#review231270
Attachment #8955048 - Flags: review?(mratcliffe) → review+
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d82a087fd56d
Remove unnecessary usages of generators in storage test. r=miker
https://hg.mozilla.org/mozilla-central/rev/d82a087fd56d
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: