The Trunk: MorphicTests-mt.78.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: MorphicTests-mt.78.mcz

commits-2
Marcel Taeumel uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-mt.78.mcz

==================== Summary ====================

Name: MorphicTests-mt.78
Author: mt
Time: 17 April 2021, 2:34:45.066481 pm
UUID: 6b91789b-fdd8-e84c-a604-20d387270a86
Ancestors: MorphicTests-mt.77

Tweak test-specific hand to log ignored events to support debugging failing tests.

Complements Morphic-mt.1754

=============== Diff against MorphicTests-mt.77 ===============

Item was changed:
  HandMorph subclass: #HandMorphForEventTests
+ instanceVariableNames: 'eventsDuringCapture eventsDuringBubble eventsRejected eventsFiltered eventsIgnored isHandling'
- instanceVariableNames: 'eventsDuringCapture eventsDuringBubble eventsRejected eventsFiltered isHandling'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'MorphicTests-Events'!

Item was added:
+ ----- Method: HandMorphForEventTests>>eventsIgnored (in category 'accessing') -----
+ eventsIgnored
+ ^ eventsIgnored ifNil: [eventsIgnored := OrderedCollection new]!

Item was added:
+ ----- Method: HandMorphForEventTests>>ignoreEvent: (in category 'event filtering') -----
+ ignoreEvent: anEvent
+ "Log ignored event to support debugging."
+
+ super ignoreEvent: anEvent.
+ self eventsIgnored add: anEvent copy -> (thisContext stackOfSize: 5).!

Item was changed:
  ----- Method: MorphicEventTests>>test03EventHandler (in category 'tests') -----
  test03EventHandler
 
  | m |
  m := Morph new.
  m extent: 20@20; topLeft: 0@0.
 
  m wantsHaloFromClick: false.
  m wantsYellowButtonMenu: false.
  m wantsMetaMenu: false.
 
+ m on: #mouseDown send: #value: to: [:evt|
- m on: #mouseDown send: #value: to:[:evt|
  evt redButtonPressed ifTrue:[m color: Color red].
  evt yellowButtonPressed ifTrue:[m color: Color yellow].
  evt blueButtonPressed ifTrue:[m color: Color blue]].
 
+ m color: Color blue.
  m openInWorld: world.
 
  hand handleEvent: (self redMouseDownAt: m center).
  self assert: Color red equals: m color.
 
  hand handleEvent: (self yellowMouseDownAt: m center).
  self assert: Color yellow equals: m color.
 
  hand handleEvent: (self blueMouseDownAt: m center).
  self assert: Color blue equals: m color.!