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
02b276e3
Commit
02b276e3
authored
Oct 08, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip indexeddb
parent
e29efa38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
30 deletions
+9
-30
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+1
-1
test/jio.storage/indexeddbstorage.tests.js
test/jio.storage/indexeddbstorage.tests.js
+8
-29
No files found.
src/jio.storage/indexeddbstorage.js
View file @
02b276e3
...
...
@@ -576,7 +576,7 @@
cursor
.
primaryKey
.
slice
(
key_path
.
length
+
1
),
10
);
if
(
index
>
blob_part
.
length
+
1
)
{
if
(
index
>
=
blob_part
.
length
)
{
delete_promise_list
.
push
(
waitForIDBRequest
(
blob_store
.
delete
(
cursor
.
primaryKey
))
);
...
...
test/jio.storage/indexeddbstorage.tests.js
View file @
02b276e3
...
...
@@ -1581,7 +1581,7 @@
var
context
=
this
,
attachment
=
"
attachment
"
;
stop
();
expect
(
1
7
);
expect
(
1
8
);
deleteIndexedDB
(
context
.
jio
)
.
then
(
function
()
{
...
...
@@ -1638,18 +1638,12 @@
"
store first argument
"
);
deepEqual
(
context
.
spy_store
.
secondCall
.
args
[
0
],
"
blob
"
,
"
store first argument
"
);
/*
deepEqual(context.spy_store.thirdCall.args[0], "attachment",
"store first argument");
deepEqual(context.spy_store.getCall(3).args[0], "blob",
"store first argument");
*/
equal
(
context
.
spy_delete
.
callCount
,
110
,
"
delete count
"
+
equal
(
context
.
spy_delete
.
callCount
,
1
,
"
delete count
"
+
context
.
spy_delete
.
callCount
);
/*
deepEqual(context.spy_delete.firstCall.args[0], "foo_attachment",
deepEqual
(
context
.
spy_delete
.
firstCall
.
args
[
0
],
"
foo_attachment_1
"
,
"
delete first argument
"
);
*/
equal
(
context
.
spy_index
.
callCount
,
1
,
"
index count
"
+
context
.
spy_index
.
callCount
);
...
...
@@ -1657,16 +1651,8 @@
context
.
spy_cursor
.
callCount
);
equal
(
context
.
spy_key_cursor
.
callCount
,
1
,
"
cursor count
"
+
context
.
spy_key_cursor
.
callCount
);
/*
equal(context.spy_cursor_delete.callCount, 0, "delete count " +
context.spy_cursor_delete.callCount);
ok(context.spy_key_range.calledOnce, "key range count " +
context.spy_key_range.callCount);
deepEqual(context.spy_key_range.firstCall.args[0],
["foo", "attachment"],
"key range first argument");
*/
equal
(
context
.
spy_put
.
callCount
,
3
,
"
put count
"
+
equal
(
context
.
spy_put
.
callCount
,
2
,
"
put count
"
+
context
.
spy_put
.
callCount
);
deepEqual
(
context
.
spy_put
.
firstCall
.
args
[
0
],
{
"
_attachment
"
:
"
attachment
"
,
...
...
@@ -1674,7 +1660,7 @@
"
_key_path
"
:
"
foo_attachment
"
,
"
info
"
:
{
"
content_type
"
:
"
text/plain;charset=utf-8
"
,
"
length
"
:
3000000
"
length
"
:
12
}
},
"
put first argument
"
);
delete
context
.
spy_put
.
secondCall
.
args
[
0
].
blob
;
...
...
@@ -1686,13 +1672,6 @@
"
_key_path
"
:
"
foo_attachment_0
"
},
"
put first argument
"
);
delete
context
.
spy_put
.
thirdCall
.
args
[
0
].
blob
;
// XXX Check blob content
deepEqual
(
context
.
spy_put
.
thirdCall
.
args
[
0
],
{
"
_attachment
"
:
"
attachment
"
,
"
_id
"
:
"
foo
"
,
"
_part
"
:
1
,
"
_key_path
"
:
"
foo_attachment_1
"
},
"
put first argument
"
);
})
.
always
(
function
()
{
context
.
spy_open
.
restore
();
...
...
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