Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
a74fd891
Commit
a74fd891
authored
Oct 09, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip indexeddb
parent
02b276e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+2
-2
test/jio.storage/indexeddbstorage.tests.js
test/jio.storage/indexeddbstorage.tests.js
+8
-3
No files found.
src/jio.storage/indexeddbstorage.js
View file @
a74fd891
...
...
@@ -296,7 +296,7 @@
context
=
this
;
function
addEntry
(
cursor
)
{
attachment_dict
[
cursor
.
value
.
_attachment
]
=
{};
attachment_dict
[
cursor
.
primaryKey
.
slice
(
cursor
.
key
.
length
+
1
)
]
=
{};
}
return
new
RSVP
.
Queue
()
...
...
@@ -308,7 +308,7 @@
waitForIDBRequest
(
tx
.
objectStore
(
"
metadata
"
).
get
(
id
)),
waitForAllSynchronousCursor
(
tx
.
objectStore
(
"
attachment
"
).
index
(
"
_id
"
)
.
openCursor
(
IDBKeyRange
.
only
(
id
)),
.
open
Key
Cursor
(
IDBKeyRange
.
only
(
id
)),
addEntry
)
]);
...
...
test/jio.storage/indexeddbstorage.tests.js
View file @
a74fd891
...
...
@@ -593,7 +593,7 @@
test
(
"
spy indexedDB usage
"
,
function
()
{
var
context
=
this
;
stop
();
expect
(
1
7
);
expect
(
1
8
);
deleteIndexedDB
(
context
.
jio
)
.
then
(
function
()
{
...
...
@@ -611,6 +611,7 @@
context
.
spy_create_index
=
sinon
.
spy
(
IDBObjectStore
.
prototype
,
"
createIndex
"
);
context
.
spy_cursor
=
sinon
.
spy
(
IDBIndex
.
prototype
,
"
openCursor
"
);
context
.
spy_key_cursor
=
sinon
.
spy
(
IDBIndex
.
prototype
,
"
openKeyCursor
"
);
context
.
spy_key_range
=
sinon
.
spy
(
IDBKeyRange
,
"
only
"
);
return
context
.
jio
.
allAttachments
(
"
foo
"
);
...
...
@@ -650,8 +651,10 @@
deepEqual
(
context
.
spy_index
.
firstCall
.
args
[
0
],
"
_id
"
,
"
index first argument
"
);
ok
(
context
.
spy_cursor
.
calledOnce
,
"
cursor count
"
+
ok
(
!
context
.
spy_cursor
.
called
,
"
cursor count
"
+
context
.
spy_cursor
.
callCount
);
ok
(
context
.
spy_key_cursor
.
calledOnce
,
"
cursor key count
"
+
context
.
spy_key_cursor
.
callCount
);
ok
(
context
.
spy_key_range
.
calledOnce
,
"
key range count
"
+
context
.
spy_key_range
.
callCount
);
...
...
@@ -673,6 +676,8 @@
delete
context
.
spy_index
;
context
.
spy_create_index
.
restore
();
delete
context
.
spy_create_index
;
context
.
spy_key_cursor
.
restore
();
delete
context
.
spy_key_cursor
;
context
.
spy_cursor
.
restore
();
delete
context
.
spy_cursor
;
context
.
spy_key_range
.
restore
();
...
...
@@ -1256,7 +1261,7 @@
deepEqual
(
context
.
spy_get
.
thirdCall
.
args
[
0
],
"
foo_attachment_1
"
,
"
get first argument
"
);
ok
(
!
context
.
spy_index
.
called
,
"
index count
"
+
ok
(
context
.
spy_index
.
called
,
"
index count
"
+
context
.
spy_index
.
callCount
);
})
.
always
(
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment