From 93583fc60fcbf5e4485ad3c67611411434a86330 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Sun, 27 Mar 2016 00:17:46 -0700 Subject: [PATCH] Bug 1160368 - Part 5: Clean up some confusing browser_storage_listings.js checks. r=jdm Also fix a reference error about undeclared variable i. --- .../tests/browser/browser_storage_listings.js | 37 ++++--------------- extensions/cookie/test/unit/test_eviction.js | 4 +- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/devtools/server/tests/browser/browser_storage_listings.js b/devtools/server/tests/browser/browser_storage_listings.js index c59dd7adac94..71c469916843 100644 --- a/devtools/server/tests/browser/browser_storage_listings.js +++ b/devtools/server/tests/browser/browser_storage_listings.js @@ -361,9 +361,7 @@ var testCookiesObjects = Task.async(function*(index, hosts, cookiesActor) { break; } } - if (!found) { - ok(false, "cookie " + item.name + " should not exist in response;"); - } + ok(found, "cookie " + item.name + " should exist in response"); } }; @@ -396,10 +394,7 @@ var testLocalStorageObjects = Task.async(function*(index, hosts, localStorageAct break; } } - if (!found) { - ok(false, "local storage item " + item.name + - " should not exist in response;"); - } + ok(found, "local storage item " + item.name + " should exist in response"); } }; @@ -433,10 +428,7 @@ var testSessionStorageObjects = Task.async(function*(index, hosts, sessionStorag break; } } - if (!found) { - ok(false, "session storage item " + item.name + - " should not exist in response;"); - } + ok(found, "session storage item " + item.name + " should exist in response"); } }; @@ -462,12 +454,7 @@ var testIndexedDB = Task.async(function*(indexedDBActor) { break; } } - if (!found) { - ok (false, item + " should not be present in list stores response"); - } - else { - ok (true, item + " found from indexedDB list stores response"); - } + ok(found, item + " should exist in list stores response"); } } @@ -494,9 +481,7 @@ var testIndexedDBs = Task.async(function*(index, hosts, indexedDBActor) { break; } } - if (!found) { - ok(false, "indexed db " + item.name + " should not exist in response"); - } + ok(found, "indexed db " + item.name + " should exist in response"); } }; @@ -537,16 +522,12 @@ var testObjectStores = Task.async(function*(index, hosts, indexedDBActor) { break; } } - if (!indexFound) { - ok(false, "Index " + index + " should not be present in response"); - } + ok(indexFound, "Index " + index + " should exist in response"); } break; } } - if (!found) { - ok(false, "indexed db " + item.name + " should not exist in response"); - } + ok(found, "indexed db " + item.name + " should exist in response"); } }; @@ -584,9 +565,7 @@ var testIDBEntries = Task.async(function*(index, hosts, indexedDBActor) { break; } } - if (!found) { - ok(false, "indexed db item " + item.name + " should not exist in response"); - } + ok(found, "indexed db item " + item.name + " should exist in response"); } }; diff --git a/extensions/cookie/test/unit/test_eviction.js b/extensions/cookie/test/unit/test_eviction.js index 8be0875f97c9..5c0cf010fcdf 100644 --- a/extensions/cookie/test/unit/test_eviction.js +++ b/extensions/cookie/test/unit/test_eviction.js @@ -1,6 +1,8 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + var test_generator = do_run_test(); function run_test() @@ -231,7 +233,7 @@ function get_creationTime(i) function check_remaining_cookies(aNumberTotal, aNumberOld, aNumberToExpect) { var enumerator = Services.cookiemgr.enumerator; - i = 0; + let i = 0; while (enumerator.hasMoreElements()) { var cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2); ++i;