@@ -100,6 +100,10 @@ function doneRunningTest() {
100100}
101101
102102function runTestFinishSuccessfulExecution ( ) {
103+ doneRunningTest ( ) ;
104+ }
105+
106+ function vizTestFinishSuccessfulExecution ( ) {
103107 optFinishSuccessfulExecution ( ) ;
104108 doneRunningTest ( ) ;
105109}
@@ -173,13 +177,17 @@ function addTestcase(id) {
173177 // adapted from executeCode in opt-frontend.js
174178 var backend_script = langToBackendScript ( $ ( '#pythonVersionSelector' ) . val ( ) ) ;
175179 var backendOptionsObj = getBaseBackendOptionsObj ( ) ;
180+ var frontendOptionsObj = getBaseFrontendOptionsObj ( ) ;
181+ frontendOptionsObj . jumpToEnd = true ;
182+
176183 if ( isViz ) {
177184 backendOptionsObj . viz_test_case = true ; // just so we can see this in server logs
178185 } else {
179186 backendOptionsObj . run_test_case = true ; // just so we can see this in server logs
187+ frontendOptionsObj . runTestCaseCallback = function ( ) {
188+ console . log ( 'hai!' ) ;
189+ } ;
180190 }
181- var frontendOptionsObj = getBaseFrontendOptionsObj ( ) ;
182- frontendOptionsObj . jumpToEnd = true ;
183191
184192 function runTestHandleUncaughtExceptionFunc ( trace ) {
185193 if ( trace . length == 1 && trace [ 0 ] . line ) {
@@ -202,16 +210,13 @@ function addTestcase(id) {
202210 doneRunningTest ( ) ;
203211 }
204212
205- if ( isViz ) {
206- executeCodeAndCreateViz ( dat . cod ,
207- backend_script , backendOptionsObj ,
208- frontendOptionsObj ,
209- 'pyOutputPane' ,
210- runTestFinishSuccessfulExecution ,
211- runTestHandleUncaughtExceptionFunc ) ;
212- } else {
213- // TODO
214- }
213+ executeCodeAndCreateViz ( dat . cod ,
214+ backend_script , backendOptionsObj ,
215+ frontendOptionsObj ,
216+ 'pyOutputPane' ,
217+ isViz ? vizTestFinishSuccessfulExecution :
218+ runTestFinishSuccessfulExecution ,
219+ runTestHandleUncaughtExceptionFunc ) ;
215220 }
216221
217222 $ ( '#runTestCase_' + id ) . click ( runOrVizTestCase . bind ( null , false ) ) ;
0 commit comments