@@ -295,6 +295,55 @@ DSRecordHistoryTest >> testBuildWindows [
295295 self assert: (windows at: 8 ) first name equals: ' StDebugger' .
296296]
297297
298+ { #category : ' tests' }
299+ DSRecordHistoryTest >> testCollectScrollingPeriods [
300+
301+ | scrollList |
302+ history records: {
303+ (DSMouseEnterWindowRecord new
304+ dateTime: ' 2026-03-25T10:01:17' asDateAndTime;
305+ windowId: 1 ).
306+ (DSScrollingRecord new
307+ dateTime: ' 2026-03-25T10:02:44' asDateAndTime;
308+ windowId: 1 ).
309+ (DSScrollingRecord new
310+ dateTime: ' 2026-03-25T10:06:08' asDateAndTime;
311+ windowId: 1 ).
312+ (DSScrollingRecord new
313+ dateTime: ' 2026-03-25T10:09:23' asDateAndTime;
314+ windowId: 1 ).
315+ (DSScrollingRecord new
316+ dateTime: ' 2026-03-25T10:13:41' asDateAndTime;
317+ windowId: 1 ).
318+ (DSMouseLeaveWindowRecord new
319+ dateTime: ' 2026-03-25T10:20:16' asDateAndTime;
320+ windowId: 1 ).
321+ (DSMouseEnterWindowRecord new
322+ dateTime: ' 2026-03-25T10:21:41' asDateAndTime;
323+ windowId: 2 ).
324+ (DSDoItRecord new
325+ dateTime: ' 2026-03-25T10:26:09' asDateAndTime;
326+ windowId: 2 ).
327+ (DSScrollingRecord new
328+ dateTime: ' 2026-03-25T10:13:41' asDateAndTime;
329+ windowId: 2 ).
330+ (DSStepIntoRecord new
331+ dateTime: ' 2026-03-25T10:14:01' asDateAndTime;
332+ windowId: 2 ) }.
333+
334+ scrollList := history collectScrollingPeriods.
335+
336+ self assert: scrollList size equals: 2 .
337+ self assert: scrollList first key equals: {
338+ ' 2026-03-25T10:02:44' asDateAndTime.
339+ ' 2026-03-25T10:13:41' asDateAndTime }.
340+ self assert: scrollList first value equals: 1 .
341+ self assert: scrollList second key equals: {
342+ ' 2026-03-25T10:13:41' asDateAndTime.
343+ ' 2026-03-25T10:13:41' asDateAndTime }.
344+ self assert: scrollList second value equals: 2
345+ ]
346+
298347{ #category : ' tests' }
299348DSRecordHistoryTest >> testCollectTimeDiscrepancies [
300349
@@ -638,6 +687,56 @@ DSRecordHistoryTest >> testFixWindowRecordKeysNames [
638687 self assert: (windowsHistory keys detect: [ :k | k windowId = 2 ]) windowName isNil
639688]
640689
690+ { #category : ' tests' }
691+ DSRecordHistoryTest >> testGetSumOfScrollingPeriods [
692+
693+ | scrollList |
694+ history records: {
695+ (DSMouseEnterWindowRecord new
696+ dateTime: ' 2026-03-25T10:01:17' asDateAndTime;
697+ windowId: 1 ).
698+ (DSScrollingRecord new
699+ dateTime: ' 2026-03-25T10:02:44' asDateAndTime;
700+ windowId: 1 ).
701+ (DSScrollingRecord new
702+ dateTime: ' 2026-03-25T10:06:08' asDateAndTime;
703+ windowId: 1 ).
704+ (DSScrollingRecord new
705+ dateTime: ' 2026-03-25T10:09:23' asDateAndTime;
706+ windowId: 1 ).
707+ (DSScrollingRecord new
708+ dateTime: ' 2026-03-25T10:13:41' asDateAndTime;
709+ windowId: 1 ).
710+ (DSMouseLeaveWindowRecord new
711+ dateTime: ' 2026-03-25T10:20:16' asDateAndTime;
712+ windowId: 1 ).
713+ (DSMouseEnterWindowRecord new
714+ dateTime: ' 2026-03-25T10:21:41' asDateAndTime;
715+ windowId: 2 ).
716+ (DSDoItRecord new
717+ dateTime: ' 2026-03-25T10:26:09' asDateAndTime;
718+ windowId: 2 ).
719+ (DSScrollingRecord new
720+ dateTime: ' 2026-03-25T10:13:41' asDateAndTime;
721+ windowId: 2 ).
722+ (DSStepIntoRecord new
723+ dateTime: ' 2026-03-25T10:14:01' asDateAndTime;
724+ windowId: 2 ).
725+ (DSScrollingRecord new
726+ dateTime: ' 2026-03-25T10:26:35' asDateAndTime;
727+ windowId: 1 ).
728+ (DSScrollingRecord new
729+ dateTime: ' 2026-03-25T10:27:39' asDateAndTime;
730+ windowId: 1 ) }.
731+
732+
733+ scrollList := history getSumOfScrollingPeriods.
734+
735+ self assert: scrollList size equals: 2 .
736+ self assert: (scrollList at: 1 ) equals: (Duration seconds: 721 ).
737+ self assert: (scrollList at: 2 ) equals: (Duration seconds: 0 )
738+ ]
739+
641740{ #category : ' tests' }
642741DSRecordHistoryTest >> testMergeContinuousEvents [
643742
0 commit comments