Restructured library.
This commit is contained in:
+10
File diff suppressed because one or more lines are too long
Vendored
+10719
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test .html-error{overflow:auto;color:#000;line-height:1.5;display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:-webkit-calc(100% - 42px);max-width:-moz-calc(100% - 42px);max-width:calc(100% - 42px);max-height:300px;word-wrap:break-word;border-bottom-color:#ddd;-webkit-box-shadow:0 1px 3px #eee;-moz-box-shadow:0 1px 3px #eee;box-shadow:0 1px 3px #eee;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}#mocha .test .html-error pre.error{border:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0;padding:0;margin:0;margin-top:18px;max-height:none}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:-webkit-calc(100% - 42px);max-width:-moz-calc(100% - 42px);max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-box-shadow:0 1px 3px #eee;-moz-box-shadow:0 1px 3px #eee;box-shadow:0 1px 3px #eee;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.pass .test.fail{display:none}#mocha-report.fail .test.pass{display:none}#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0;height:auto;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background-color:initial}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}}
|
||||
/*# sourceMappingURL=mocha.min.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["mocha.css"],"names":[],"mappings":"iBAEA,KACE,OAAO,EAGT,OACE,KAAM,IAAI,CAAC,IAAI,gBAAgB,CAAE,SAAS,CAAE,KAAK,CAAE,WACnD,OAAQ,KAAK,KAIf,UADA,UAEE,OAAQ,EACR,QAAS,EAGX,UACE,WAAY,KAGd,UACA,UACE,OAAQ,EAGV,UACE,WAAY,KACZ,UAAW,IACX,YAAa,IAGf,YACE,gBAAiB,KACjB,MAAO,QAGT,kBACE,gBAAiB,UAGnB,wBACE,WAAY,EACZ,UAAW,KAGb,eACE,QAAS,KAGX,UACE,UAAW,KACX,YAAa,IACb,OAAQ,QAGV,cACE,YAAa,KAGf,aACE,YAAa,KACb,SAAU,OAGZ,qCACE,QAAS,YACT,YAAa,KAAK,CAAE,WAGtB,mCACE,WAAY,QAGd,iCACE,WAAY,QAGd,0BACE,QAAS,IACT,UAAW,KACX,QAAS,MACT,MAAO,KACP,aAAc,IACd,MAAO,QAGT,4BACE,UAAW,IACX,YAAa,IACb,QAAS,IAAI,IACb,MAAO,KACP,mBAAoB,MAAM,EAAE,IAAI,IAAI,eACpC,gBAAiB,MAAM,EAAE,IAAI,IAAI,eACjC,WAAY,MAAM,EAAE,IAAI,IAAI,eAC5B,sBAAuB,IACvB,mBAAoB,IACpB,kBAAmB,IACnB,iBAAkB,IAClB,cAAe,IAGjB,iCACE,QAAS,KAGX,qBACE,MAAO,QAGT,6BACE,QAAS,IACT,MAAO,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mBAAmB,QAAQ,IAC3B,gBAAgB,QAAQ,IACxB,cAAc,QAAQ,IACtB,WAAY,QAAQ,IACpB,QAAS,GACT,MAAO,KAGT,4BACE,QAAS,EAGX,8BACE,QAAS,KAGX,8BACE,QAAS,KAIX,iCADA,iCAEE,QAAS,KAEX,yCACE,QAAS,MAGX,aACE,MAAO,KACP,UAAW,MACX,YAAa,IACb,eAAgB,IAGlB,aACE,SAAU,MACV,IAAK,KACL,MAAO,KACP,UAAW,KACX,OAAQ,EACR,MAAO,KACP,QAAS,EAGX,uBACE,MAAO,MACP,YAAa,EAOb,OAAQ,KACR,mBAAoB,KACpB,gBAAiB,KACjB,WAAY,KACZ,iBAAkB,QAGpB,gBACE,MAAO,KAGT,eACE,gBAAiB,KACjB,MAAO,QAGT,qBACE,cAAe,IAAI,MAAM,KAG3B,gBACE,QAAS,aACT,OAAQ,EAAE,IACV,WAAY,KACZ,YAAa,KAGf,oBACE,MAAO,KACP,OAAQ,KAGV,qBAAuB,MAAO,KAC9B,kBAAoB,MAAO,QAC3B,oBAAsB,MAAO,QAC7B,qBAAuB,MAAO,QAC9B,oBAAsB,MAAO,QAE7B,2CACE,OACE,OAAQ,KAAK,EAGf,cACE,SAAU"}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
|
||||
#mocha {
|
||||
margin: 0;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
#mocha-stats {
|
||||
position: absolute;
|
||||
top: 70px;
|
||||
}
|
||||
|
||||
#mocha-stats li.progress {
|
||||
float: none !important;
|
||||
}
|
||||
|
||||
#mocha-report a {
|
||||
font-size: .9em;
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/* globals chai, describe, it, beforeEach, testFrame, UITest */
|
||||
/* eslint no-console: ["error", { allow: ["log", "info", "error"] }] */
|
||||
|
||||
/**
|
||||
* Imports
|
||||
*/
|
||||
|
||||
/**
|
||||
* Setup
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tests
|
||||
*/
|
||||
describe('Zoom in, zoom out', function () {
|
||||
|
||||
before('load index.html in testFrame', function(done) {
|
||||
|
||||
if (window.testType !== 'all' && window.testType !== 'zoomInZoomOut') {
|
||||
this.skip()
|
||||
}
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
it('should zoom in, zoom out, zoom in, zoom out, ... for one hour', function(done) {
|
||||
|
||||
this.timeout(1000 * 60 * 70)
|
||||
this.slow(1000 * 60 * 61)
|
||||
|
||||
const app = testFrame.contentWindow.app3
|
||||
|
||||
const scale = app._deepZoomImage3.scatter.scale
|
||||
const center = app._deepZoomImage3.scatter.center
|
||||
|
||||
function test() {
|
||||
|
||||
app._deepZoomImage3.scatter.scale = scale
|
||||
app._deepZoomImage3.scatter.centerAt(center)
|
||||
|
||||
const fingers = fingersFromCenter(randomCenter(app.center))
|
||||
|
||||
new UITest()
|
||||
.pinch(app.view, fingers.zoomIn, 1, {
|
||||
distance: 200,
|
||||
duration: 3
|
||||
})
|
||||
.pinch(app.view, fingers.zoomOut, 5, {
|
||||
distance: -58,
|
||||
duration: 2
|
||||
})
|
||||
.start()
|
||||
}
|
||||
|
||||
setInterval(test, 9000)
|
||||
|
||||
test()
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* Utils
|
||||
*/
|
||||
function randomCenter(center) {
|
||||
|
||||
let x = Math.random() * 200
|
||||
if (Math.random() < .5) {
|
||||
x *= -1
|
||||
}
|
||||
|
||||
let y = Math.random() * 200
|
||||
if (Math.random() < .5) {
|
||||
y *= -1
|
||||
}
|
||||
|
||||
return {
|
||||
x: center.x + x,
|
||||
y: center.y + y
|
||||
}
|
||||
}
|
||||
|
||||
function fingersFromCenter(center) {
|
||||
|
||||
const finger1 = {
|
||||
x: center.x - 3,
|
||||
y: center.y
|
||||
}
|
||||
const finger2 = {
|
||||
x: center.x + 3,
|
||||
y: center.y
|
||||
}
|
||||
const finger3 = {
|
||||
x: center.x - 30,
|
||||
y: center.y
|
||||
}
|
||||
const finger4 = {
|
||||
x: center.x + 30,
|
||||
y: center.y
|
||||
}
|
||||
|
||||
return {zoomIn: [finger1, finger2], zoomOut: [finger3, finger4]}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/* globals mocha, chai, Bootstrap */
|
||||
/* eslint no-console: ["error", { allow: ["log", "info", "error"] }] */
|
||||
|
||||
/**
|
||||
* Mocha setup
|
||||
*/
|
||||
mocha.setup('bdd')
|
||||
|
||||
/**
|
||||
* Chai setup
|
||||
*/
|
||||
const assert = chai.assert
|
||||
|
||||
/**
|
||||
* List of tests
|
||||
*/
|
||||
let tests = [
|
||||
'../test/tests/zoomInZoomOut.js'
|
||||
]
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class UITestSuite {
|
||||
|
||||
async run(type = 'all') {
|
||||
window.testType = type
|
||||
|
||||
this.reset()
|
||||
|
||||
for (let test of tests) {
|
||||
await this.loadTest(test)
|
||||
}
|
||||
|
||||
mocha.run()
|
||||
}
|
||||
|
||||
reset() {
|
||||
mocha.suite.suites = []
|
||||
document.getElementById('mocha').innerHTML = ''
|
||||
}
|
||||
|
||||
loadTest(url) {
|
||||
return new Promise(resolve => {
|
||||
Bootstrap.import(`${url}?_=${Date.now()}`, () => {
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
window.uiTestSuite = new UITestSuite()
|
||||
Reference in New Issue
Block a user