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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Royer
jio
Commits
1a8758a3
Commit
1a8758a3
authored
Sep 22, 2017
by
Vincent Bechu
Committed by
Vincent Bechu
Sep 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[indexeddbstorage] Fix putAttachment for empty blob
/reviewed-on
nexedi/jio!74
parent
2fddffaf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+3
-1
test/jio.storage/indexeddbstorage.tests.js
test/jio.storage/indexeddbstorage.tests.js
+27
-0
No files found.
src/jio.storage/indexeddbstorage.js
View file @
1a8758a3
...
@@ -385,7 +385,9 @@
...
@@ -385,7 +385,9 @@
end_index
-=
1
;
end_index
-=
1
;
}
}
function
resolver
(
result
)
{
function
resolver
(
result
)
{
if
(
result
.
blob
!==
undefined
)
{
result_list
.
push
(
result
);
result_list
.
push
(
result
);
}
resolve
(
result_list
);
resolve
(
result_list
);
}
}
function
getPart
(
i
)
{
function
getPart
(
i
)
{
...
...
test/jio.storage/indexeddbstorage.tests.js
View file @
1a8758a3
...
@@ -1357,6 +1357,33 @@
...
@@ -1357,6 +1357,33 @@
});
});
});
});
test
(
"
retrieve empty blob
"
,
function
()
{
var
context
=
this
,
attachment
=
"
attachment
"
,
blob
=
new
Blob
();
stop
();
expect
(
1
);
deleteIndexedDB
(
context
.
jio
)
.
then
(
function
()
{
return
context
.
jio
.
put
(
"
foo
"
,
{
"
title
"
:
"
bar
"
});
})
.
then
(
function
()
{
return
context
.
jio
.
putAttachment
(
"
foo
"
,
attachment
,
blob
);
})
.
then
(
function
()
{
return
context
.
jio
.
getAttachment
(
"
foo
"
,
attachment
);
})
.
then
(
function
(
result
)
{
deepEqual
(
result
,
blob
,
"
check empty blob
"
);
})
.
fail
(
function
(
error
)
{
ok
(
false
,
error
);
})
.
always
(
function
()
{
start
();
});
});
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// indexeddbStorage.removeAttachment
// indexeddbStorage.removeAttachment
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
...
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