Referring to the Figures in which like numerals indicate like elements,
The system 100 may include a central processing unit (“CPU”) 102, a system memory 104 including a random access memory 106 (“RAM”) and a read-only memory 108 (“ROM”). The CPU 102 may interpret instructions and process data in computer applications. For example, the CPU 102 may be a microprocessor and include a number of integrated circuits, and may execute software or instructions and provide overall control to computing system 100. The RAM 106 may allow data stored on the RAM to be accessed in any order, the system 100 may also for example write to and read from the RAM 106. For example, a data file may be stored on the RAM 106 at a time X, and at a time Y the data file may be read from the RAM 106. The ROM 108 may contain data or systems that may be read from the ROM 108 by the system 100 (as opposed to the RAM 106 which generally may be written to or read by the system 100). For example the ROM 108 may comprise a basic input/output system (BIOS) software code to be run by the system 100 when the system 100 is first powered on. The ROM 108 may also for example be coupled to a clock 110. The clock 110, for example, may provide the time to the system 100 through the ROM 108.
The system 100 may also include an input/output controller 128 and a display device 130. Input/output (I/O) controller 128 may interface to one or more I/O devices, such as display device 130. The input/output controller 128 may, for example, provide output to the display device 130. The display device 130 may be a device configured to receive data from the input/output controller 128 and provide or display the data to a user. Although not shown, the input/output controller 128 may also be coupled to a variety of input devices, such as a keyboard, mouse, joystick, or any other input device configured to provide input to the system 100.
The system 100 may also include a data storage device 114 to store data, instructions or other information. Data storage device 114 may be, for example, a hard disk drive that stores data on a magnetic surface, a CD-ROM, or any other available media storage device accessible by the system 100.
By way of example, and not limitation, data storage device 114 may include any computer-readable media. The computer readable media may, for example, include computer storage media and communication media. Computer storage media may include media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computer.
One or more software programs or blocks may be stored in data storage device 114, such as an application 116, an operating system 120, and a stack 122. Application 116 may be a web browser, word processor, a multimedia application, or any other application. The operating system 120 may be a software program that manages the hardware and software of the system 100, and may be any type of operating system. For example, the operating system may be Microsoft Windows, Linux, etc. The stack 122 may be a temporary data structure used to store data from the data storage device 114.
According to an example embodiment the system 100 may operate in a networked environment using logical connections to communicate with remote computers through a network, such as a TCP/IP network 124, as an example. For example, the TCP/IP network 124 may be the Internet, a corporate intranet, a local area network, a wireless network, a wide area network, and/or any other network. The system 100 may communicate to the TCP/IP network 124 through a network interface unit 126. The network interface unit 126 may be a device and/or software program configured to allow the system 100 to communicate with the TCP/IP network 124. For example, the network interface unit 126 may be a network card, network interface controller (NIC), a modem, or any other communication enabling device.
A system bus 112 may be coupled to the CPU 102, the system memory 104, data storage device 114, network interface unit 126, and input/output controller 128. The system bus 112 may allow transfer of data between two or more system components. For example the system bus 112 may allow for transfer of data to and from the system memory 104 and CPU 102. The system bus 112 may also, for example, couple other parts of the system 100 together as well, such as the data storage device 114 to the input/output controller 128.
Hit test program 212 may perform hit testing. An application display area may typically include one or more visual elements, such as selectable or clickable buttons, windows, text boxes, background, etc., or other visual elements. In an example embodiment, an application may, for example, register a routine with the hit test program 212 for one or more visual elements. In an example embodiment, hit test program 212 may call or invoke the registered routines as event handlers when, for example, a visual element is hit or selected, e.g., by a mouse or other pointing device. In an example embodiment, when a specific location or pixel in a application display area is selected, hit test program 212 may perform hit testing in attempt to determine which visual element has been selected.
In an example embodiment, the hit test program 212 may provide an element ID identifying the visual element that the hit test program 212 has determined was selected (or clocked) or hit by the mouse or pointing device. However, it is possible that the hit test program 212 may incorrectly determine the visual element that was selected. For example, in some cases, the selectability rules, e.g., for determining when a visual element has been selected may have changed. For example, if a visual element is modified or transformed, the visual bounds and/or the hit test bounds for the visual element may have been modified in some manner, and may or may not match each other, which may complicate the task performed by the hit test program in some cases. Therefore, it may be useful, at least in some cases, to verify that the hit test program 212 is correctly identifying the selected visual elements. Until now, the verification of hit testing has been a manual operation.
According to an example embodiment, a hit test verification program 224 may verify the operation of the hit test program 212. A system under test (SUT) program 222 may provide a sample application that may be used for testing and verification, for example.
In addition, each location or pixel of application display area may also have a color or color code. Therefore, at any particular time, each pixel on application display area 300 may be associated with one of the plurality of visual elements based on a match between the color code for the pixel and the color code determined for a visual element. For example, a pixel on display area 300 that is black may be associated with (or correspond to) button 304 (since button 304 is black), while a white pixel may be associated with background 302 (since background 302 is also white), as examples. In an example embodiment, this information (e.g., association between pixel color codes and visual element color codes) may be used by hit test verification program 224 to verify operation of hit test program 212, for example.
Referring to
This process may be repeated. That is, user interactions platform 214 may move the mouse or pointer to select a new pixel on display 300. Hit test program 212 may then provide an element ID for the selected pixel that identifies the visual element hit test program 212 has determined was selected or hit. Hit test verification program 224 may then verify the operation of the hit test program 212 for the new selected pixel, e.g., by verifying that the element ID from the hit testing of the selected pixel matches the visual element associated with the selected pixel.
Referring to
After the effect is applied, button 404 now includes the area that was previously button 402, plus a shadow 406. After the shadow effect is applied to the button, the hit test bounds for button 404 does not change (is same as hit test bounds for button 402), but the visual bounds for button 404 is now larger than for button 402 due to the shadow 406. Therefore, the visual bounds no longer matches the hit test bounds for button 404. When this effect is applied to a button or other visual element, the selectabilty rules may therefore, change. Thus, if a user or mouse selects a location or pixel in the shadow 406, this is not a selection or hit on button 404. Hit test verification program 224 may, for example, verify that hit test program 212 is correctly determining when button 404 is selected or not (e.g., properly determining that a selection of a pixel within shadow 406 is a selection of a background or other element, and not a selection of button 404).
In
The effects illustrated in
At 710, each of a plurality of locations (or pixels) of an application display area may be associated with one of a plurality of visual elements. This associating (operation 710) may include, for example, one or more of determining one or more color codes for each of a plurality of visual elements (e.g., white for background, black for a button), determining a color code for each of a plurality of pixels, and/or associating each of the plurality of pixels of the application display area with one of the visual elements based on a match between a color code of a pixel and a color code of a visual element.
At 720, one of a plurality of locations (or pixels) on the application display area may be selected. For example, hit test verification program 224 may call user interactions platform 214 to move a mouse or pointer and click or select a location or pixel, for example.
At 730, hit testing may be performed for the selected location or pixel to obtain an element ID for one of the plurality of visual elements for the selected location or pixel. Hit testing (730) may be performed, for example, by registering with hit test program 212 for one or more visual elements, and/or receiving an element ID or notification when the hit test program determines that a visual element has been selected or hit, for example. In another example embodiment, hit testing may be performed by making a call to hit test program 212 to perform hit testing on the selected location and to obtain an element ID for one of the plurality of visual elements for the selected location.
At 740, the operation of the hit testing may be verified. For example, it may be verified that the element ID from the hit testing of the selected location (e.g., received from hit test program 212) matches the visual element associated with the selected location or pixel. Thus, it may be verified, e.g., through a comparison, that the element ID received via operation 730 matches or corresponds to the visual element associated with the selected pixel (from operation 710). This may confirm, for example, that the hit test program has correctly operated (correctly tested), at least for this test.
The hit test verification, or any operations thereof, described and shown in
At 810, one or more color codes may be determined for each of a plurality of visual elements. For example, a white color code may be used for background 302, and black may be used for button 304, etc.
At 820, an effect may be applied to a selected visual element of the plurality of visual elements of an application display area. The effect may be any effect, such as one of the effects shown in
At 830, one or more additional operations may be performed after the applying (820) operation, including operations 832, 834, 836, and 838.
At operation 832, each of a plurality of pixels of an application display area (e.g., area 300) may be associated with one of the visual elements. The operations 832 may include, for example, determining a color code for each of a plurality of pixels of the application display area, and associating each of the plurality of pixels of the application display area with one of a plurality of visual elements.
For example, a screen shot may be taken of the display area 300, after the effect has been applied. The color codes for each pixel may be identified and an array of color codes may be determined, where each pixel color code may indicate or may be associated with a visual element. For example:
At operation 834, one of a plurality of pixels of the application display area is selected. For example, hit test verification program 224 may call user interactions platform 214 to move a mouse or pointer and click or select a location or pixel on application display area 300, for example.
At operation 836, hit testing is performed for the selected pixel to obtain an element ID for one of the plurality of visual elements for the selected location. Hit testing (836) may be performed, for example, by registering with hit test program 212 for one or more visual elements, and/or receiving an element ID or notification when the hit test program determines that a visual element has been selected or hit, for example. In another example embodiment, hit testing may be performed by making a call to hit test program 212 to perform hit testing on the selected location.
For example, hit testing may include receiving a list of visual elements or element IDs for one or more, or even all, of the location or pixels of display area 300. For example:
At operation 838, it is verified that the element ID from hit testing of the selected pixel matches or corresponds to the visual element associated (e.g., associated in operation 832) with the selected pixel. For example, the color codes for a selected pixel (or all pixels) are compared to the color codes for visual elements to make sure there is a match.
For example, hit test verification may include verifying that, for a selected pixel, or for one or more (or even all) pixels of display area 300:
With reference to
At 910, each of a plurality of pixels of an application display area may be associated with one of a plurality of visual elements. Operation 910 may include, for example, determining one or more color codes for each of a plurality of visual elements, determining a color code for each of a plurality of pixels of the application display area, and associating each of the plurality of pixels of the application display area with one of the plurality of visual elements based on a match between a color code of the pixel and a determined color code for one of the visual elements.
At 920, one of the plurality of pixels on the application display area may be selected. Different techniques may be used to select a location or pixel, such as those technique noted above with reference to
At 930, an effect may be applied to a selected visual element of the plurality of visual elements of the application display area. Any effect may be applied. However, in an example embodiment, the applying operation of 930 may include applying an effect to a selected visual element of the plurality of visual elements of an application display area, wherein a visual bounds for the selected visual element does not match a hit test bounds for the selected visual element after the applying the effect to the selected visual element.
At 940, one or more additional operations may be performed after the applying operation (930), including operations 942 and 944.
At 942, hit testing may be performed for the selected pixel to obtain an element ID for one of the plurality of visual elements for the selected location or pixel. At 944, it may be verified that the element ID from the hit testing of the selected pixel matches the visual element associated with the selected pixel. As with
With reference to
While certain features of the described implementations have been illustrated as described herein, many modifications, substitutions, changes and equivalents may now occur to those skilled in the art. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes as fall within the true spirit of the various embodiments.