Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
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
preetwinder
jio
Commits
aa0ecefe
Commit
aa0ecefe
authored
Aug 21, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests files changed and moved
parent
af2d4bf0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
183 deletions
+26
-183
test/jiotests_withoutrequirejs.html
test/jiotests_withoutrequirejs.html
+0
-51
test/run-qunit.js
test/run-qunit.js
+0
-85
test/tests.html
test/tests.html
+6
-3
test/tests.require.html
test/tests.require.html
+13
-0
test/tests.require.js
test/tests.require.js
+7
-44
No files found.
test/jiotests_withoutrequirejs.html
deleted
100644 → 0
View file @
af2d4bf0
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<title>
JIO, Storages and ComplexQueries QUnit/Sinon Tests
</title>
<link
rel=
"stylesheet"
href=
"../lib/qunit/qunit.css"
/>
</head>
<body>
<div
id=
"qunit"
></div>
<script
src=
"../lib/qunit/qunit.js"
></script>
<script
src=
"../lib/sinon/sinon.js"
></script>
<script
src=
"../lib/sinon/sinon-qunit.js"
></script>
<script
src=
"../complex_queries.js"
></script>
<script
src=
"./queries/tests.js"
></script>
<script
src=
"../src/md5.amd.js"
></script>
<script
src=
"../jio.js"
></script>
<script
src=
"./jio/tests.js"
></script>
<script
src=
"../src/jio.storage/localstorage.js"
></script>
<script
src=
"./jio.storage/localstorage.tests.js"
></script>
<script
src=
"../src/sha256.amd.js"
></script>
<script
src=
"../src/jio.storage/revisionstorage.js"
></script>
<script
src=
"./jio.storage/revisionstorage.tests.js"
></script>
<script
src=
"../src/jio.storage/replicaterevisionstorage.js"
></script>
<script
src=
"./jio.storage/replicaterevisionstorage.tests.js"
></script>
<script
src=
"../src/jio.storage/indexstorage.js"
></script>
<script
src=
"./jio.storage/indexstorage.tests.js"
></script>
<script
src=
"../src/jio.storage/splitstorage.js"
></script>
<script
src=
"./jio.storage/splitstorage.tests.js"
></script>
<script
src=
"../src/jio.storage/gidstorage.js"
></script>
<script
src=
"./jio.storage/gidstorage.tests.js"
></script>
<script
src=
"../lib/jquery/jquery.min.js"
></script>
<script
src=
"../src/jio.storage/davstorage.js"
></script>
<script
src=
"./jio.storage/davstorage.tests.js"
></script>
<script
src=
"../src/sha1.amd.js"
></script>
<script
src=
"../src/jio.storage/s3storage.js"
></script>
<script
src=
"./jio.storage/s3storage.tests.js"
></script>
<script
src=
"../src/jio.storage/xwikistorage.js"
></script>
<script
src=
"./jio.storage/xwikistorage.tests.js"
></script>
</body>
</html>
test/run-qunit.js
deleted
100644 → 0
View file @
af2d4bf0
/*jslint indent: 2, maxlen: 80 */
/*global require, phantom, document, setInterval, clearInterval, console */
(
function
()
{
"
use strict
"
;
var
system
=
require
(
'
system
'
),
page
;
/**
* Wait until the test condition is true or a timeout occurs. Useful for
* waiting on a server response or for a ui change (fadeIn, etc.) to occur.
*
* @method waitFor
* @param {Function} testFx Condition that evaluates to a boolean
* @param {Function} onReady What to do when testFx condition is fulfilled
* @param {Number} time_out_millis The max amount of time to wait.
* If not specified, 10 sec is used.
*/
function
waitFor
(
testFx
,
onReady
,
time_out_millis
)
{
var
maxtime_out_millis
,
start
,
condition
,
interval
;
maxtime_out_millis
=
time_out_millis
||
10001
;
start
=
new
Date
().
getTime
();
condition
=
false
;
interval
=
setInterval
(
function
()
{
if
((
new
Date
().
getTime
()
-
start
<
maxtime_out_millis
)
&&
!
condition
)
{
// If not time-out yet and condition not yet fulfilled
condition
=
testFx
();
}
else
{
if
(
!
condition
)
{
// If condition still not fulfilled (timeout but condition is 'false')
console
.
log
(
"
'waitFor()' timeout
"
);
phantom
.
exit
(
1
);
}
else
{
// Condition fulfilled (timeout and/or condition is 'true')
console
.
log
(
"
'waitFor()' finished in
"
+
(
new
Date
().
getTime
()
-
start
)
+
"
ms.
"
);
onReady
();
clearInterval
(
interval
);
//< Stop this interval
}
}
},
100
);
//< repeat check every 100ms
}
if
(
system
.
args
.
length
!==
2
)
{
console
.
log
(
'
Usage: run-qunit.js URL
'
);
phantom
.
exit
(
1
);
}
page
=
require
(
'
webpage
'
).
create
();
// Route "console.log()" calls from within the Page context to the main
// Phantom context (i.e. current "this")
page
.
onConsoleMessage
=
function
(
msg
)
{
console
.
log
(
msg
);
};
page
.
open
(
system
.
args
[
1
],
function
(
status
)
{
if
(
status
!==
"
success
"
)
{
console
.
log
(
"
Unable to access network
"
);
phantom
.
exit
(
1
);
}
waitFor
(
function
()
{
return
page
.
evaluate
(
function
()
{
var
el
=
document
.
getElementById
(
'
qunit-testresult
'
);
if
(
el
&&
el
.
innerText
.
match
(
'
completed
'
))
{
return
true
;
}
return
false
;
});
},
function
()
{
var
failedNum
=
page
.
evaluate
(
function
()
{
console
.
log
(
"
========================================================
"
);
console
.
log
(
document
.
documentElement
.
innerHTML
);
console
.
log
(
"
========================================================
"
);
var
el
=
document
.
getElementById
(
'
qunit-testresult
'
);
console
.
log
(
el
.
innerText
);
try
{
return
el
.
getElementsByClassName
(
'
failed
'
)[
0
].
innerHTML
;
}
catch
(
ignore
)
{
}
return
10000
;
});
phantom
.
exit
((
parseInt
(
failedNum
,
10
)
>
0
)
?
1
:
0
);
});
});
}());
test/tests.html
View file @
aa0ecefe
...
@@ -2,12 +2,15 @@
...
@@ -2,12 +2,15 @@
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
<title>
JIO, Storages and ComplexQueries QUnit/Sinon Tests
</title>
<link
rel=
"stylesheet"
href=
"../lib/qunit/qunit.css"
/>
<link
rel=
"stylesheet"
href=
"../lib/qunit/qunit.css"
/>
<script
src=
"../lib/require/require.js"
></script>
<title>
JIO Qunit/Sinon Unit Tests
</title>
<script
src=
"tests.require.js"
></script>
</head>
</head>
<body>
<body>
<div
id=
"qunit"
></div>
<div
id=
"qunit"
></div>
<script
src=
"../lib/qunit/qunit.js"
></script>
<script
src=
"../lib/sinon/sinon.js"
></script>
<script
src=
"../lib/sinon/sinon-qunit.js"
></script>
<script
src=
"../jio.js"
></script>
<script
src=
"jio/tests.js"
></script>
</body>
</body>
</html>
</html>
test/tests.require.html
0 → 100644
View file @
aa0ecefe
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<title>
JIO Qunit/Sinon Unit Tests
</title>
<script
src=
"../lib/require/require.js"
></script>
<script
src=
"tests.require.js"
></script>
<link
rel=
"stylesheet"
href=
"../lib/qunit/qunit.css"
/>
</head>
<body>
<div
id=
"qunit"
></div>
</body>
</html>
test/tests.require.js
View file @
aa0ecefe
/*jslint indent: 2, maxlen: 80 */
/*jslint indent: 2, maxlen: 80
, nomen : true
*/
/*global require */
/*global require */
(
function
()
{
(
function
()
{
...
@@ -6,41 +6,14 @@
...
@@ -6,41 +6,14 @@
require
.
config
({
require
.
config
({
"
paths
"
:
{
"
paths
"
:
{
"
md5
"
:
"
../src/md5.amd
"
,
"
sha1
"
:
"
../src/sha1.amd
"
,
"
sha256
"
:
"
../src/sha256.amd
"
,
"
jquery
"
:
"
../lib/jquery/jquery.min
"
,
"
complex_queries
"
:
"
../complex_queries
"
,
"
complex_queries_tests
"
:
"
queries/tests
"
,
"
jio
"
:
"
../jio
"
,
"
jio
"
:
"
../jio
"
,
"
jio_tests
"
:
"
jio/tests
"
,
"
jio_tests
"
:
"
jio/tests
"
,
"
localstorage
"
:
"
../src/jio.storage/localstorage
"
,
"
localstorage_tests
"
:
"
jio.storage/localstorage.tests
"
,
"
revisionstorage
"
:
"
../src/jio.storage/revisionstorage
"
,
"
revisionstorage_tests
"
:
"
jio.storage/revisionstorage.tests
"
,
"
replicaterevisionstorage
"
:
"
../src/jio.storage/replicaterevisionstorage
"
,
"
replicaterevisionstorage_tests
"
:
"
jio.storage/
"
+
"
replicaterevisionstorage.tests
"
,
"
davstorage
"
:
"
../src/jio.storage/davstorage
"
,
"
davstorage_tests
"
:
"
jio.storage/davstorage.tests
"
,
"
indexstorage
"
:
"
../src/jio.storage/indexstorage
"
,
"
indexstorage_tests
"
:
"
jio.storage/indexstorage.tests
"
,
"
splitstorage
"
:
"
../src/jio.storage/splitstorage
"
,
"
splitstorage_tests
"
:
"
jio.storage/splitstorage.tests
"
,
"
gidstorage
"
:
"
../src/jio.storage/gidstorage
"
,
"
gidstorage_tests
"
:
"
jio.storage/gidstorage.tests
"
,
"
xwikistorage
"
:
"
../src/jio.storage/xwikistorage
"
,
"
xwikistorage_tests
"
:
"
jio.storage/xwikistorage.tests
"
,
"
s3storage
"
:
"
../src/jio.storage/s3storage
"
,
"
s3storage_tests
"
:
"
jio.storage/s3storage.tests
"
,
"
qunit
"
:
"
../lib/qunit/qunit
"
,
"
qunit
"
:
"
../lib/qunit/qunit
"
,
"
sinon
"
:
"
../lib/sinon/sinon
"
,
"
sinon
"
:
"
../lib/sinon/sinon
"
,
"
sinon_qunit
"
:
"
../lib/sinon/sinon-qunit
"
"
sinon_qunit
"
:
"
../lib/sinon/sinon-qunit
"
},
},
"
shim
"
:
{
"
shim
"
:
{
"
jquery
"
:
{
"
exports
"
:
"
jQuery
"
},
"
sinon
"
:
[
"
qunit
"
],
"
sinon
"
:
[
"
qunit
"
],
"
sinon_qunit
"
:
[
"
sinon
"
]
"
sinon_qunit
"
:
[
"
sinon
"
]
}
}
...
@@ -48,16 +21,6 @@
...
@@ -48,16 +21,6 @@
require
([
require
([
"
sinon_qunit
"
,
"
sinon_qunit
"
,
"
complex_queries_tests
"
,
"
jio_tests
"
"
jio_tests
"
,
"
localstorage_tests
"
,
"
revisionstorage_tests
"
,
"
replicaterevisionstorage_tests
"
,
"
indexstorage_tests
"
,
"
splitstorage_tests
"
,
"
gidstorage_tests
"
,
"
davstorage_tests
"
,
"
xwikistorage_tests
"
,
"
s3storage_tests
"
]);
]);
}());
}());
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