Bug 1442160 - Remove unnecessary usages of generators in storage test. r=miker draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 01 Mar 2018 00:47:22 -0800
changeset 761604 67dd7a194e38ec31d44c895ad547ad0ec11e7bba
parent 761603 d459cad38af4515ccd98eb281ae95399e68cb59b
push id100978
push userbmo:poirot.alex@gmail.com
push dateThu, 01 Mar 2018 09:04:36 +0000
reviewersmiker
bugs1442160
milestone60.0a1
Bug 1442160 - Remove unnecessary usages of generators in storage test. r=miker MozReview-Commit-ID: 3x06Clvqtyq
devtools/client/storage/test/browser_storage_dynamic_updates_localStorage.js
devtools/client/storage/test/browser_storage_dynamic_updates_sessionStorage.js
devtools/client/storage/test/storage-updates.html
--- a/devtools/client/storage/test/browser_storage_dynamic_updates_localStorage.js
+++ b/devtools/client/storage/test/browser_storage_dynamic_updates_localStorage.js
@@ -45,21 +45,19 @@ add_task(function* () {
   // Updating a row
   gWindow.localStorage.setItem("ls2", "ls2-changed");
 
   yield gUI.once("store-objects-updated");
   yield gUI.once("store-objects-updated");
 
   checkCell("ls2", "value", "ls2-changed");
 
-  // 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);
+  // Clearing items.
+  yield ContentTask.spawn(gBrowser.selectedBrowser, null, function () {
+    content.wrappedJSObject.clear();
   });
 
   yield gUI.once("store-objects-cleared");
 
   yield checkState([
     [
       ["localStorage", "http://test1.example.org"],
       [ ]
--- a/devtools/client/storage/test/browser_storage_dynamic_updates_sessionStorage.js
+++ b/devtools/client/storage/test/browser_storage_dynamic_updates_sessionStorage.js
@@ -59,21 +59,19 @@ add_task(function* () {
   gWindow.sessionStorage.setItem("ss2", "changed=ss2");
 
   yield gUI.once("sidebar-updated");
 
   checkCell("ss2", "value", "changed=ss2");
 
   yield findVariableViewProperties([{name: "ss2", value: "changed=ss2"}]);
 
-  // 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);
+  // Clearing items.
+  yield ContentTask.spawn(gBrowser.selectedBrowser, null, function () {
+    content.wrappedJSObject.clear();
   });
 
   yield gUI.once("store-objects-cleared");
 
   yield checkState([
     [
       ["sessionStorage", "http://test1.example.org"],
       [ ]
--- a/devtools/client/storage/test/storage-updates.html
+++ b/devtools/client/storage/test/storage-updates.html
@@ -32,17 +32,17 @@ window.removeCookie = function(name, pat
     name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=" + path;
 };
 
 /**
  * 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*() {
+window.clear = function() {
   localStorage.clear();
   dump("removed localStorage from " + document.location + "\n");
 
   sessionStorage.clear();
   dump("removed sessionStorage from " + document.location + "\n");
 };
 
 window.onload = function() {