Bug 1442160 - Remove unnecessary usages of generators in storage test. r=miker
MozReview-Commit-ID: 3x06Clvqtyq
--- 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() {