summaryrefslogtreecommitdiffstats
path: root/devtools/server/tests/browser/browser_storage_listings.js
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-03-03 19:42:25 +0100
committerGitHub <noreply@github.com>2018-03-03 19:42:25 +0100
commitd252c5b2320859c58900b68a7f5ac82199aa1e83 (patch)
treebee56152ced9b7485267debb8d50fca952d9c447 /devtools/server/tests/browser/browser_storage_listings.js
parentc3039dadd95f5487e84311a9719604fa901aacd7 (diff)
parent8114b67b64e17482e46c2eaa77dd6a6156130dba (diff)
downloadUXP-d252c5b2320859c58900b68a7f5ac82199aa1e83.tar
UXP-d252c5b2320859c58900b68a7f5ac82199aa1e83.tar.gz
UXP-d252c5b2320859c58900b68a7f5ac82199aa1e83.tar.lz
UXP-d252c5b2320859c58900b68a7f5ac82199aa1e83.tar.xz
UXP-d252c5b2320859c58900b68a7f5ac82199aa1e83.zip
Merge pull request #36 from janekptacijarabaci/devtools_import-from-moebius_2
Port across devtools enhancements - 2
Diffstat (limited to 'devtools/server/tests/browser/browser_storage_listings.js')
-rw-r--r--devtools/server/tests/browser/browser_storage_listings.js58
1 files changed, 25 insertions, 33 deletions
diff --git a/devtools/server/tests/browser/browser_storage_listings.js b/devtools/server/tests/browser/browser_storage_listings.js
index 4ff3c3fc1..e47a320b8 100644
--- a/devtools/server/tests/browser/browser_storage_listings.js
+++ b/devtools/server/tests/browser/browser_storage_listings.js
@@ -20,15 +20,6 @@ const storeMap = {
isSecure: false,
},
{
- name: "cs2",
- value: "sessionCookie",
- path: "/",
- host: ".example.org",
- expires: 0,
- isDomain: true,
- isSecure: false,
- },
- {
name: "c3",
value: "foobar-2",
expires: 2000000001000,
@@ -130,24 +121,24 @@ const storeMap = {
const IDBValues = {
listStoresResponse: {
"http://test1.example.org": [
- ["idb1", "obj1"], ["idb1", "obj2"], ["idb2", "obj3"]
+ ["idb1 (default)", "obj1"], ["idb1 (default)", "obj2"], ["idb2 (default)", "obj3"]
],
"http://sectest1.example.org": [
],
"https://sectest1.example.org": [
- ["idb-s1", "obj-s1"], ["idb-s2", "obj-s2"]
+ ["idb-s1 (default)", "obj-s1"], ["idb-s2 (default)", "obj-s2"]
]
},
- dbDetails : {
+ dbDetails: {
"http://test1.example.org": [
{
- db: "idb1",
+ db: "idb1 (default)",
origin: "http://test1.example.org",
version: 1,
objectStores: 2
},
{
- db: "idb2",
+ db: "idb2 (default)",
origin: "http://test1.example.org",
version: 1,
objectStores: 1
@@ -157,13 +148,13 @@ const IDBValues = {
],
"https://sectest1.example.org": [
{
- db: "idb-s1",
+ db: "idb-s1 (default)",
origin: "https://sectest1.example.org",
version: 1,
objectStores: 1
},
{
- db: "idb-s2",
+ db: "idb-s2 (default)",
origin: "https://sectest1.example.org",
version: 1,
objectStores: 1
@@ -172,7 +163,7 @@ const IDBValues = {
},
objectStoreDetails: {
"http://test1.example.org": {
- idb1: [
+ "idb1 (default)": [
{
objectStore: "obj1",
keyPath: "id",
@@ -199,7 +190,7 @@ const IDBValues = {
indexes: []
}
],
- idb2: [
+ "idb2 (default)": [
{
objectStore: "obj3",
keyPath: "id3",
@@ -217,7 +208,7 @@ const IDBValues = {
},
"http://sectest1.example.org" : {},
"https://sectest1.example.org": {
- "idb-s1": [
+ "idb-s1 (default)": [
{
objectStore: "obj-s1",
keyPath: "id",
@@ -225,7 +216,7 @@ const IDBValues = {
indexes: []
},
],
- "idb-s2": [
+ "idb-s2 (default)": [
{
objectStore: "obj-s2",
keyPath: "id3",
@@ -245,7 +236,7 @@ const IDBValues = {
},
entries: {
"http://test1.example.org": {
- "idb1#obj1": [
+ "idb1 (default)#obj1": [
{
name: 1,
value: {
@@ -271,7 +262,7 @@ const IDBValues = {
}
}
],
- "idb1#obj2": [
+ "idb1 (default)#obj2": [
{
name: 1,
value: {
@@ -282,11 +273,11 @@ const IDBValues = {
}
}
],
- "idb2#obj3": []
+ "idb2 (default)#obj3": []
},
"http://sectest1.example.org" : {},
"https://sectest1.example.org": {
- "idb-s1#obj-s1": [
+ "idb-s1 (default)#obj-s1": [
{
name: 6,
value: {
@@ -304,7 +295,7 @@ const IDBValues = {
}
}
],
- "idb-s2#obj-s2": [
+ "idb-s2 (default)#obj-s2": [
{
name: 13,
value: {
@@ -337,7 +328,8 @@ function* testStores(data) {
}
function testCookies(cookiesActor) {
- is(Object.keys(cookiesActor.hosts).length, 2, "Correct number of host entries for cookies");
+ is(Object.keys(cookiesActor.hosts).length, 2,
+ "Correct number of host entries for cookies");
return testCookiesObjects(0, cookiesActor.hosts, cookiesActor);
}
@@ -346,9 +338,9 @@ var testCookiesObjects = Task.async(function* (index, hosts, cookiesActor) {
let matchItems = data => {
let cookiesLength = 0;
for (let secureCookie of storeMap.cookies[host]) {
- if (secureCookie.isSecure) {
- ++cookiesLength;
- }
+ if (secureCookie.isSecure) {
+ ++cookiesLength;
+ }
}
// Any secure cookies did not get stored in the database.
is(data.total, storeMap.cookies[host].length - cookiesLength,
@@ -478,17 +470,17 @@ var testIndexedDBs = Task.async(function* (index, hosts, indexedDBActor) {
for (let item of data.data) {
let found = false;
for (let toMatch of IDBValues.dbDetails[host]) {
- if (item.db == toMatch.db) {
+ if (item.uniqueKey == toMatch.db) {
found = true;
- ok(true, "Found indexed db " + item.db + " in response");
+ ok(true, "Found indexed db " + item.uniqueKey + " in response");
is(item.origin, toMatch.origin, "The origin matches.");
is(item.version, toMatch.version, "The version matches.");
is(item.objectStores, toMatch.objectStores,
- "The numebr of object stores matches.");
+ "The number of object stores matches.");
break;
}
}
- ok(found, "indexed db " + item.name + " should exist in response");
+ ok(found, "indexed db " + item.uniqueKey + " should exist in response");
}
};