File tree Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Original file line number Diff line number Diff line change 1
1
require . config ( {
2
- baseUrl :'./' ,
3
- paths : {
4
- 'lib' : '../lib' ,
5
- 'chai' : './testDeps/chai' ,
2
+ baseUrl : './' ,
3
+ paths : {
4
+ 'lib' : '../lib' ,
5
+ 'chai' : './testDeps/chai' ,
6
6
'sinon' : './testDeps/sinon'
7
7
}
8
8
} ) ;
@@ -13,7 +13,7 @@ var allTests = [
13
13
'tests/p5.Amplitude' ,
14
14
'tests/p5.Oscillator' ,
15
15
'tests/p5.Distortion' ,
16
- 'tests/p5.Effect' ,
16
+ 'tests/p5.Effect' ,
17
17
'tests/p5.Filter' ,
18
18
'tests/p5.FFT' ,
19
19
'tests/p5.Compressor' ,
@@ -27,6 +27,21 @@ var allTests = [
27
27
28
28
p5 . prototype . masterVolume ( 0 ) ;
29
29
30
- require ( allTests , function ( ) {
31
- mocha . run ( ) ;
30
+ var test_has_run = false ;
31
+
32
+ require ( allTests , function ( ) {
33
+ document . getElementById ( 'mocha' ) . innerHTML = 'click to begin tests' ;
34
+
35
+ // chromes autoplay policy requires a user interaction
36
+ // before the audiocontext can activate
37
+ function mousePressed ( ) {
38
+ if ( ! test_has_run ) {
39
+ document . getElementById ( 'mocha' ) . innerHTML = '' ;
40
+ p5 . prototype . userStartAudio ( ) ;
41
+ mocha . run ( ) ;
42
+ test_has_run = true ;
43
+ }
44
+ }
45
+
46
+ document . addEventListener ( 'click' , mousePressed , false ) ;
32
47
} ) ;
You can’t perform that action at this time.
0 commit comments