@@ -100,10 +100,10 @@ suite('Debug - Breakpoints', () => {
100100 const modelUri1 = uri . file ( '/myfolder/my file first.js' ) ;
101101 const modelUri2 = uri . file ( '/secondfolder/second/second file.js' ) ;
102102 addBreakpointsAndCheckEvents ( model , modelUri1 , [ { lineNumber : 5 , enabled : true } , { lineNumber : 10 , enabled : false } ] ) ;
103- assert . strictEqual ( getExpandedBodySize ( model , 9 ) , 44 ) ;
103+ assert . strictEqual ( getExpandedBodySize ( model , undefined , 9 ) , 44 ) ;
104104
105105 addBreakpointsAndCheckEvents ( model , modelUri2 , [ { lineNumber : 1 , enabled : true } , { lineNumber : 2 , enabled : true } , { lineNumber : 3 , enabled : false } ] ) ;
106- assert . strictEqual ( getExpandedBodySize ( model , 9 ) , 110 ) ;
106+ assert . strictEqual ( getExpandedBodySize ( model , undefined , 9 ) , 110 ) ;
107107
108108 assert . strictEqual ( model . getBreakpoints ( ) . length , 5 ) ;
109109 assert . strictEqual ( model . getBreakpoints ( { uri : modelUri1 } ) . length , 2 ) ;
@@ -137,7 +137,7 @@ suite('Debug - Breakpoints', () => {
137137 assert . strictEqual ( bp . enabled , true ) ;
138138
139139 model . removeBreakpoints ( model . getBreakpoints ( { uri : modelUri1 } ) ) ;
140- assert . strictEqual ( getExpandedBodySize ( model , 9 ) , 66 ) ;
140+ assert . strictEqual ( getExpandedBodySize ( model , undefined , 9 ) , 66 ) ;
141141
142142 assert . strictEqual ( model . getBreakpoints ( ) . length , 3 ) ;
143143 } ) ;
@@ -213,22 +213,75 @@ suite('Debug - Breakpoints', () => {
213213 test ( 'exception breakpoints' , ( ) => {
214214 let eventCount = 0 ;
215215 model . onDidChangeBreakpoints ( ( ) => eventCount ++ ) ;
216- model . setExceptionBreakpoints ( [ { filter : 'uncaught' , label : 'UNCAUGHT' , default : true } ] ) ;
216+ model . setExceptionBreakpointsForSession ( "session-id-1" , [ { filter : 'uncaught' , label : 'UNCAUGHT' , default : true } ] ) ;
217217 assert . strictEqual ( eventCount , 1 ) ;
218- let exceptionBreakpoints = model . getExceptionBreakpoints ( ) ;
218+ let exceptionBreakpoints = model . getExceptionBreakpointsForSession ( "session-id-1" ) ;
219219 assert . strictEqual ( exceptionBreakpoints . length , 1 ) ;
220220 assert . strictEqual ( exceptionBreakpoints [ 0 ] . filter , 'uncaught' ) ;
221221 assert . strictEqual ( exceptionBreakpoints [ 0 ] . enabled , true ) ;
222222
223- model . setExceptionBreakpoints ( [ { filter : 'uncaught' , label : 'UNCAUGHT' } , { filter : 'caught' , label : 'CAUGHT' } ] ) ;
223+ model . setExceptionBreakpointsForSession ( "session-id-2" , [ { filter : 'uncaught' , label : 'UNCAUGHT' } , { filter : 'caught' , label : 'CAUGHT' } ] ) ;
224224 assert . strictEqual ( eventCount , 2 ) ;
225- exceptionBreakpoints = model . getExceptionBreakpoints ( ) ;
225+ exceptionBreakpoints = model . getExceptionBreakpointsForSession ( "session-id-2" ) ;
226226 assert . strictEqual ( exceptionBreakpoints . length , 2 ) ;
227227 assert . strictEqual ( exceptionBreakpoints [ 0 ] . filter , 'uncaught' ) ;
228228 assert . strictEqual ( exceptionBreakpoints [ 0 ] . enabled , true ) ;
229229 assert . strictEqual ( exceptionBreakpoints [ 1 ] . filter , 'caught' ) ;
230230 assert . strictEqual ( exceptionBreakpoints [ 1 ] . label , 'CAUGHT' ) ;
231231 assert . strictEqual ( exceptionBreakpoints [ 1 ] . enabled , false ) ;
232+
233+ model . setExceptionBreakpointsForSession ( "session-id-3" , [ { filter : 'all' , label : 'ALL' } ] ) ;
234+ assert . strictEqual ( eventCount , 3 ) ;
235+ assert . strictEqual ( model . getExceptionBreakpointsForSession ( "session-id-3" ) . length , 1 ) ;
236+ exceptionBreakpoints = model . getExceptionBreakpoints ( ) ;
237+ assert . strictEqual ( exceptionBreakpoints [ 0 ] . filter , 'uncaught' ) ;
238+ assert . strictEqual ( exceptionBreakpoints [ 0 ] . enabled , true ) ;
239+ assert . strictEqual ( exceptionBreakpoints [ 1 ] . filter , 'caught' ) ;
240+ assert . strictEqual ( exceptionBreakpoints [ 1 ] . label , 'CAUGHT' ) ;
241+ assert . strictEqual ( exceptionBreakpoints [ 1 ] . enabled , false ) ;
242+ assert . strictEqual ( exceptionBreakpoints [ 2 ] . filter , 'all' ) ;
243+ assert . strictEqual ( exceptionBreakpoints [ 2 ] . label , 'ALL' ) ;
244+ } ) ;
245+
246+ test ( 'exception breakpoints multiple sessions' , ( ) => {
247+ let eventCount = 0 ;
248+ model . onDidChangeBreakpoints ( ( ) => eventCount ++ ) ;
249+
250+ model . setExceptionBreakpointsForSession ( "session-id-4" , [ { filter : 'uncaught' , label : 'UNCAUGHT' , default : true } , { filter : 'caught' , label : 'CAUGHT' } ] ) ;
251+ model . setExceptionBreakpointFallbackSession ( "session-id-4" ) ;
252+ assert . strictEqual ( eventCount , 1 ) ;
253+ let exceptionBreakpointsForSession = model . getExceptionBreakpointsForSession ( "session-id-4" ) ;
254+ assert . strictEqual ( exceptionBreakpointsForSession . length , 2 ) ;
255+ assert . strictEqual ( exceptionBreakpointsForSession [ 0 ] . filter , 'uncaught' ) ;
256+ assert . strictEqual ( exceptionBreakpointsForSession [ 1 ] . filter , 'caught' ) ;
257+
258+ model . setExceptionBreakpointsForSession ( "session-id-5" , [ { filter : 'all' , label : 'ALL' } , { filter : 'caught' , label : 'CAUGHT' } ] ) ;
259+ assert . strictEqual ( eventCount , 2 ) ;
260+ exceptionBreakpointsForSession = model . getExceptionBreakpointsForSession ( "session-id-5" ) ;
261+ let exceptionBreakpointsForUndefined = model . getExceptionBreakpointsForSession ( undefined ) ;
262+ assert . strictEqual ( exceptionBreakpointsForSession . length , 2 ) ;
263+ assert . strictEqual ( exceptionBreakpointsForSession [ 0 ] . filter , 'caught' ) ;
264+ assert . strictEqual ( exceptionBreakpointsForSession [ 1 ] . filter , 'all' ) ;
265+ assert . strictEqual ( exceptionBreakpointsForUndefined . length , 2 ) ;
266+ assert . strictEqual ( exceptionBreakpointsForUndefined [ 0 ] . filter , 'uncaught' ) ;
267+ assert . strictEqual ( exceptionBreakpointsForUndefined [ 1 ] . filter , 'caught' ) ;
268+
269+ model . removeExceptionBreakpointsForSession ( "session-id-4" ) ;
270+ assert . strictEqual ( eventCount , 2 ) ;
271+ exceptionBreakpointsForUndefined = model . getExceptionBreakpointsForSession ( undefined ) ;
272+ assert . strictEqual ( exceptionBreakpointsForUndefined . length , 2 ) ;
273+ assert . strictEqual ( exceptionBreakpointsForUndefined [ 0 ] . filter , 'uncaught' ) ;
274+ assert . strictEqual ( exceptionBreakpointsForUndefined [ 1 ] . filter , 'caught' ) ;
275+
276+ model . setExceptionBreakpointFallbackSession ( "session-id-5" ) ;
277+ assert . strictEqual ( eventCount , 2 ) ;
278+ exceptionBreakpointsForUndefined = model . getExceptionBreakpointsForSession ( undefined ) ;
279+ assert . strictEqual ( exceptionBreakpointsForUndefined . length , 2 ) ;
280+ assert . strictEqual ( exceptionBreakpointsForUndefined [ 0 ] . filter , 'caught' ) ;
281+ assert . strictEqual ( exceptionBreakpointsForUndefined [ 1 ] . filter , 'all' ) ;
282+
283+ const exceptionBreakpoints = model . getExceptionBreakpoints ( ) ;
284+ assert . strictEqual ( exceptionBreakpoints . length , 3 ) ;
232285 } ) ;
233286
234287 test ( 'instruction breakpoints' , ( ) => {
0 commit comments