CN117806964A - Rendering engine compatibility testing method and device, electronic equipment and storage medium - Google Patents

Rendering engine compatibility testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117806964A
CN117806964A CN202311851667.8A CN202311851667A CN117806964A CN 117806964 A CN117806964 A CN 117806964A CN 202311851667 A CN202311851667 A CN 202311851667A CN 117806964 A CN117806964 A CN 117806964A
Authority
CN
China
Prior art keywords
user interface
rendering
result
rendering engine
interface file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311851667.8A
Other languages
Chinese (zh)
Inventor
刘坤鹰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202311851667.8A priority Critical patent/CN117806964A/en
Publication of CN117806964A publication Critical patent/CN117806964A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a device, electronic equipment and a storage medium for testing compatibility of a rendering engine. By adopting the embodiment of the invention, the aim of automatically testing the compatibility of the rendering engine can be fulfilled, the cost generated by adopting manual testing is reduced, and the testing efficiency of testing the compatibility of the rendering engine is improved.

Description

Rendering engine compatibility testing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a rendering engine compatibility testing method and apparatus, an electronic device, and a storage medium.
Background
The User Interface (UI) is a page designed to interact with each other between a User and hardware, so that the User can conveniently and efficiently operate the hardware to achieve bidirectional interaction, and the User Interface is widely defined and comprises a man-machine interaction and a graphical User Interface, and the User Interface exists in the field of information communication between human beings and machines. The UI rendering engine is a tool for analyzing an HTML document and displaying the HTML document on a page, and realizes functions including typesetting, drawing, compositing, time, animation and the like, and provides a set of HTML+CSS development paradigm supported by the UI rendering engine for a developer to develop a UI.
In order to ensure the compatibility of the UI rendering engine to html+css combined paradigms, such as compatibility to instruction, component, attribute, style, event, etc. paradigms, and correctness of rendering results, traversal and combination testing must be performed on the paradigms supported by the UI rendering engine. The testing method in the related art is that each instruction, component, sub-component, attribute, style, event and method in the paradigm supported by the UI rendering engine is sent into the UI rendering engine to be traversed and combined for rendering, and then the rendered UI is checked manually to be in accordance with expectations. The number of cases for such traversal plus combination testing is enormous, and the testing process is time consuming and laborious. Furthermore, with iterative updating of the UI rendering engine, the newly added paradigm supported by the UI rendering engine also needs to be subjected to traversal and combination test, and the existing supported paradigm still needs to be subjected to regression test, which results in an increasing workload of testing the paradigm supported by the UI rendering engine, so if the test on the paradigm supported by the UI rendering engine is still continued by adopting the manual test method provided in the related art, the test efficiency of the compatibility test on the UI rendering engine is definitely reduced.
Disclosure of Invention
The embodiment of the invention aims to provide a rendering engine compatibility testing method, a rendering engine compatibility testing device, electronic equipment and a storage medium, so as to solve the technical problem of low testing efficiency of compatibility testing of a user interface rendering engine.
In a first aspect, an embodiment of the present invention provides a rendering engine compatibility testing method, including:
acquiring a user interface file to be processed;
invoking a user interface rendering engine to be tested, and rendering the user interface file to obtain a rendering result;
and determining a test result of the user interface rendering engine for rendering the user interface file according to the rendering result and a reference result corresponding to the user interface file.
In a second aspect, an embodiment of the present invention provides a rendering engine compatibility test apparatus, including:
the acquisition module is used for acquiring the user interface file to be processed;
the rendering module is used for calling a user interface rendering engine to be tested, and rendering the user interface file to obtain a rendering result;
and the determining module is used for determining a test result of rendering processing of the user interface file by the user interface rendering engine according to the rendering result and a reference result corresponding to the user interface file.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, where the steps in the rendering engine compatibility testing method described in any one of the above are implemented when the processor executes the computer program.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps in the rendering engine compatibility test method of any one of the above.
The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for testing the compatibility of a rendering engine, which are used for comparing a reference file corresponding to a user interface file with the rendering image after rendering the user interface file to be processed to obtain the rendering image, so that whether the test result of the user interface rendering engine on the user interface file accords with the expectation of the user interface file can be determined, the purpose of automatically testing the compatibility of the rendering engine is realized, the cost generated by adopting manual test is reduced, and the test efficiency for testing the compatibility of the rendering engine is improved.
Drawings
FIG. 1 is a flow chart of a rendering engine compatibility test method according to an embodiment of the present invention;
FIG. 2 is a second flow chart of a rendering engine compatibility test method according to an embodiment of the present invention;
FIG. 3 is a third flow chart of a rendering engine compatibility test method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a visual display provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of a rendering engine compatibility testing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 7 is a schematic diagram of another structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
In the related art, in order to ensure compatibility of the UI rendering engine to html+css combined paradigms, for example, compatibility to instruction, component, attribute, style, event, etc. paradigms, and correctness of rendering results, traversal and combination test must be performed on the paradigms supported by the UI rendering engine. The testing method provided in the related art is that each instruction, component, sub-component, attribute, style, event and method in the paradigm supported by the UI rendering engine is sent into the UI rendering engine to be traversed and combined for rendering, and then the rendered UI is checked manually to be in accordance with the expectations. The number of cases for such traversal plus combination testing is enormous, and the testing process is time consuming and laborious. Furthermore, with iterative updating of the UI rendering engine, the newly added paradigm supported by the UI rendering engine also needs to be subjected to traversal and combination test, and the existing supported paradigm still needs to be subjected to regression test, which results in an increasing workload of testing the paradigm supported by the UI rendering engine, so if the test on the paradigm supported by the UI rendering engine is still continued by adopting the manual test method provided in the related art, the test efficiency of the compatibility test on the UI rendering engine is definitely reduced.
In order to solve the technical problems in the related art, an embodiment of the present invention provides a method for testing compatibility of a rendering engine, please refer to fig. 1, fig. 1 is a flow chart of the method for testing compatibility of a rendering engine provided in the embodiment of the present invention, the method includes steps 101 to 103;
step 101, obtaining a user interface file to be processed.
In this embodiment, the user interface file to be processed provided in this embodiment is a file that can be subjected to rendering processing by the user interface rendering engine and output a rendering result. The user interface file may be an HTML format document, including a user interface configuration.
Specifically, the user interface file to be processed provided in this embodiment is a user interface file for which compatibility test is required to be performed on the user interface rendering engine, so as to determine whether the user interface rendering engine performing rendering processing on the user interface file can normally render the rendering result expected by the user interface file.
In some embodiments, the step of obtaining the user interface file to be processed provided in this embodiment may be: acquiring a user interface development paradigm to be processed and an execution configuration corresponding to the user interface development paradigm; writing a user interface development paradigm and an execution configuration into user interface code; and compiling the user interface codes to obtain user interface files which can be executed by the user interface rendering engine to be tested.
Because the development formats supported by the user interface rendering engines of different versions are different, and the user interface file to be processed contains the combined formats of the different development formats, compatibility test needs to be performed on the user interface rendering engine aiming at the user interface file to be processed. In order to enable the user interface rendering engine to be tested to execute rendering processing, the embodiment can write the user interface development paradigm to be processed and the configuration executable by the user interface development paradigm in the user interface rendering engine into user interface codes, namely UI codes, and then compile the user interface codes, so that user interface files executable by the user interface rendering engine to be tested can be obtained, and the testing efficiency of compatibility testing of the user interface rendering engine to be tested is improved.
Step 102, calling a user interface rendering engine to be tested, and rendering the user interface file to obtain a rendering result.
The user interface rendering engine to be tested provided by the embodiment is a user interface rendering engine for performing compatibility test on the user interface file to be processed. The rendering result provided in this embodiment may be an image of the user interface generated after the rendering process, or may be a video of the user interface generated after the rendering process, so long as the effect of the user interface generated by the rendering process can be reflected, and the method is not specifically limited herein.
And step 103, determining a test result of rendering processing of the user interface file by the user interface rendering engine according to the rendering result and a reference result corresponding to the user interface file.
In this embodiment, in one case, the reference result corresponding to the user interface file provided in this embodiment may be a rendering result generated after performing rendering processing on the user interface file to be processed by using a standard user interface rendering engine that performs compatibility test on the user interface file and obtains a rendering result that is checked manually. In other cases, the reference result corresponding to the user interface file provided in this embodiment may be a rendering result generated after the rendering process is performed on the user interface file to be processed by a professional technician.
It should be noted that, the reference results corresponding to the user interface file provided in this embodiment are not limited to the above-mentioned manner, and may be obtained by other manners capable of obtaining the rendering results that pass the manual verification, which is not limited herein.
After the reference result corresponding to the user interface file to be processed is obtained, whether the rendering effect images corresponding to the two rendering effect images are consistent or not can be checked by comparing the rendering result generated by the user interface rendering engine to be tested with the reference result, for example, comparing the rendering effect images corresponding to the two rendering effect images, so as to determine whether the rendering effect images corresponding to the rendering result are consistent with the expectation of the user interface file or not. If the rendering effect images corresponding to the two rendering effect images are inconsistent, the rendering effect images corresponding to the rendering result can be determined to be inconsistent with the expectation of the user interface file, so that the test result of the rendering processing of the user interface file by the user interface rendering engine can be determined to be failed; if the rendering effect images corresponding to the rendering effect images are consistent, the rendering effect images corresponding to the rendering result can be determined to accord with the expectation of the user interface file, so that the test result of the user interface rendering engine for rendering the user interface file can be determined to pass.
Therefore, by adopting the method provided by the embodiment of the invention, after the user interface file to be processed is rendered to obtain the rendered image, the reference file corresponding to the user interface file is adopted to be compared with the rendered image, so that whether the test result of the user interface rendering engine on the user interface file accords with the expectation of the user interface file can be determined, the purpose of automatically testing the compatibility of the rendering engine is realized, the cost generated by adopting manual test is reduced, and the test efficiency of testing the compatibility of the rendering engine is improved.
In some embodiments, please refer to fig. 2, fig. 2 is a second flowchart of a rendering engine compatibility testing method according to an embodiment of the present invention, as shown in fig. 2, where the rendering engine compatibility testing method according to the embodiment may further include steps 201 to 208;
step 201, a user interface file to be processed is obtained.
In this embodiment, the user interface file provided in this embodiment may be an HTML format document, including a user interface configuration. Specifically, the user interface file provided in this embodiment may be obtained by compiling and compiling a code of a development paradigm of a user interface to be processed, and please refer to the method steps provided in the above embodiment, which are not described herein.
Step 202, calling a user interface rendering engine to be tested, and rendering the user interface file to obtain a rendering result.
In this embodiment, in order to calculate the similarity between the rendering result and the reference result corresponding to the user interface file, before calculating the similarity, the reference result corresponding to the user interface file needs to be obtained, and specifically, the reference result corresponding to the user interface file may be obtained through steps 203 to 205;
and 203, performing rendering processing on the user interface file to obtain an initial rendering result.
In one case, the rendering processing manner of the user interface file according to this embodiment may be that a standard user interface rendering engine that performs a compatibility test on the user interface file and obtains a rendering result that passes the manual verification is adopted to perform rendering processing on the user interface file to be processed. In other cases, the present embodiment may also perform rendering processing on the user interface file to be processed manually, that is, by a professional technician.
The manner of rendering the user interface file according to the present embodiment is not limited to the several manners mentioned in the foregoing embodiments, but may be any other manner that can render the user interface file, and is not specifically limited herein.
Step 204, determining whether the initial rendering result meets the expectation of the user interface file, and obtaining a determination result.
After the initial rendering result is obtained, the embodiment can further perform verification processing on the initial rendering result to determine whether the initial rendering result meets the expectation of the user interface file. Specifically, the verification processing provided in this embodiment may be that a professional technician determines, according to the design content in the user interface file, whether the initial rendering result meets the design expectation in the user interface file.
Step 205, in the case that the determination result is yes, taking the initial rendering result as the reference result of the user interface file.
When the obtained judging result characterizes the initial rendering result to accord with the expectation of the user interface file, the initial rendering result can be used as the reference result of the user interface file so as to carry out similarity calculation on the rendering result generated by the user interface rendering engine to be tested subsequently, and the purpose of carrying out compatibility test on the user interface rendering engine to be tested is achieved.
And 206, calculating the similarity between the rendering result and the reference result corresponding to the user interface file to obtain a similarity value.
In this embodiment, similarity calculation is performed on the rendering result and the reference result, and specifically, in this embodiment, the similarity between the rendering result and the reference result may be calculated by using cosine similarity, that is, the image is expressed as a vector, and the similarity between two images is represented by calculating the cosine distance between the vectors, so as to obtain a similarity value; in this embodiment, the similarity between the rendering result and the reference result may be measured by using structural similarity, that is, the similarity between the image and the reference result is measured from three aspects of brightness, contrast and structure, specifically, the value range of the measurement result is [0,1], and the larger the value, the smaller the image distortion is, that is, the more similar is the image distortion.
It should be noted that, the similarity calculation method provided in this embodiment is not limited to the above embodiments, but may be other methods capable of calculating the similarity between the rendering result and the reference result, such as a deep learning method, and therefore the method for calculating the similarity between the rendering result and the reference result is not limited herein.
Step 207, determining that the test result of the user interface rendering engine is a compatible user interface file in the case that the similarity value is greater than the first target threshold.
Step 208, determining that the test result of the user interface rendering engine is an incompatible user interface file if the similarity value is not greater than the first target threshold.
In this embodiment, the first target threshold provided in this embodiment may be 0.8, or may be 0.85 or 0.9, and the specific value of the first target threshold may be set according to the actual application scenario, which is not specifically limited herein.
When the similarity value between the rendering result and the reference result is determined to be greater than the first target threshold value, the rendering result and the reference result are determined to be similar, namely the user interface rendering engine can be determined to correctly render the user interface file so as to obtain the rendering result which accords with the expectation of the user interface file, and accordingly the test result of the user interface rendering engine can be determined to be a compatible user interface file; when the similarity value between the rendering result and the reference result is not greater than the first target threshold, it is determined that the rendering result and the reference result are dissimilar, that is, it is determined that the user interface rendering engine cannot correctly render the user interface file and cannot obtain the rendering result which meets the expectation of the user interface file, and therefore it is determined that the test result of the user interface rendering engine is an incompatible user interface file.
In other embodiments, please refer to fig. 3, fig. 3 is a third flowchart of a rendering engine compatibility testing method according to an embodiment of the present invention, as shown in fig. 3, where the rendering engine compatibility testing method according to the embodiment may further include steps 301 to 307;
step 301, a user interface file to be processed is obtained.
Step 302, a user interface rendering engine to be tested is called, rendering processing is carried out on the user interface file, and a bitmap output by the user interface rendering engine is obtained.
In this embodiment, the output of the user interface rendering engine to be tested provided in this embodiment may be a bitmap, where each bit is used to represent a certain state, and the bitmap is essentially an application implementation of a hash table, and the principle is that given an int integer data, the int integer is mapped onto the corresponding bit, and the bit is changed from 0 to 1.
Step 303, converting the bitmap into a target image in a target format, and taking the target image as a rendering result.
The target format provided in this embodiment may be a format of a computer-stored image, for example, a format of bmp, jpg, png, tif, gif, etc., as long as the image can represent a user interface generated by rendering, and is not particularly limited herein. After the target image in the target format is obtained, the target image can be used as a rendering result generated after the rendering process of the user interface rendering engine to be tested at this time.
In this embodiment, after the rendered image corresponding to the rendered result is obtained, the image may be directly subjected to contrast processing, so that the embodiment may also convert the reference result into the reference image corresponding to the target format, so as to facilitate the subsequent contrast processing.
Step 304, calculating the difference value between each test pixel point in the rendered image and the corresponding pixel point in the reference image to obtain the pixel difference value corresponding to each test pixel point.
Step 305, a difference image is constructed based on the difference values of the pixels, and the pixel mean square error of the difference image is calculated to obtain the pixel mean square error value.
In some alternative examples, to improve the calculation efficiency, the width and height of the constructed difference image may be reduced by 10 times, for example, and then the pixel mean square error of the reduced difference image may be calculated.
Step 306, determining that the test result of the user interface rendering engine is a compatible user interface file in the case that the pixel mean square value is not greater than the second target threshold.
In step 307, in the case that the pixel mean square value is greater than the second target threshold, determining that the test result of the user interface rendering engine is an incompatible user interface file.
In this embodiment, the smaller the pixel mean square value is, the more consistent the two images representing the comparison are, so the specific value of the second target threshold value provided in this embodiment may be set according to the actual application scenario, and is not limited herein specifically.
When the pixel mean square value between the rendered image and the reference image is not larger than the second target threshold, the rendered image and the reference image are consistent, namely the user interface rendering engine can accurately render the user interface file to obtain the rendered image which accords with the expectation of the user interface file, so that the test result of the user interface rendering engine can be determined to be a compatible user interface file; when the pixel mean square value between the rendered image and the reference image is determined to be larger than the second target threshold value, the rendered image and the reference image are determined to be inconsistent, namely, the user interface rendering engine cannot correctly render the user interface file and cannot obtain the rendered image which accords with the expectation of the user interface file, so that the test result of the user interface rendering engine can be determined to be an incompatible user interface file.
In addition, the rendering engine compatibility testing method provided in the embodiment may further include: and visually displaying the test result, the rendering result and the reference result. The visual display of each test result is convenient for manual checking, so that the accuracy of each test result is ensured.
Specifically, referring to fig. 4, fig. 4 is a schematic diagram of a visual display provided by the embodiment of the present invention, as shown in fig. 4, in this embodiment, a test result may be displayed in text, and a rendering result and a reference result may be displayed in an image form, so that a person may check the test result directly according to an interface of the visual display, thereby ensuring accuracy of each test result.
In summary, an embodiment of the present invention provides a method for testing compatibility of a rendering engine, where the method includes obtaining a user interface file to be processed, calling the user interface rendering engine to be tested, performing rendering processing on the user interface file to obtain a rendering result, and determining a test result of the rendering processing of the user interface file by the user interface rendering engine according to the rendering result and a reference result corresponding to the user interface file. By adopting the embodiment of the invention, the aim of automatically testing the compatibility of the rendering engine can be fulfilled, the cost generated by adopting manual testing is reduced, and the testing efficiency of testing the compatibility of the rendering engine is improved.
According to the method described in the above embodiments, the present embodiment will be further described from the perspective of a rendering engine compatibility testing apparatus, which may be implemented as a separate entity, or may be implemented as an integrated electronic device, such as a terminal, which may include a mobile phone, a tablet computer, or the like.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a rendering engine compatibility testing apparatus according to an embodiment of the present invention, and as shown in fig. 5, a rendering engine compatibility testing apparatus 500 according to an embodiment of the present invention includes: an acquisition module 501, a rendering module 502, and a determination module 503;
the obtaining module 501 is configured to obtain a user interface file to be processed.
The rendering module 502 is configured to invoke a user interface rendering engine to be tested, and perform rendering processing on the user interface file to obtain a rendering result.
A determining module 503, configured to determine a test result of the user interface rendering engine for rendering the user interface file according to the rendering result and a reference result corresponding to the user interface file.
In some embodiments, the obtaining module 501 provided in this embodiment is specifically configured to: acquiring a user interface development paradigm to be processed and an execution configuration corresponding to the user interface development paradigm; writing a user interface development paradigm and an execution configuration into user interface code; and compiling the user interface codes to obtain user interface files which can be executed by the user interface rendering engine to be tested.
In some embodiments, the rendering module 502 provided in this embodiment is specifically configured to: invoking a user interface rendering engine to be tested, and rendering the user interface file to obtain a bitmap output by the user interface rendering engine; converting the bitmap into a target image in a target format, and taking the target image as a rendering result.
In some embodiments, the determining module 503 provided in this embodiment is specifically configured to: calculating the similarity between the rendering result and the reference result corresponding to the user interface file to obtain a similarity value; under the condition that the similarity value is larger than a first target threshold value, determining that the test result of the user interface rendering engine is a compatible user interface file; and under the condition that the similarity value is not greater than the first target threshold value, determining that the test result of the user interface rendering engine is an incompatible user interface file.
In some embodiments, the rendering engine compatibility testing apparatus 500 provided in this embodiment may further include: the pretreatment module is specifically used for: rendering the user interface file to obtain an initial rendering result; judging whether the initial rendering result accords with the expectation of the user interface file or not, and obtaining a judging result; and if the judgment result is yes, taking the initial rendering result as a reference result of the user interface file.
In some embodiments, the determining module 503 provided in this embodiment is specifically further configured to: calculating a difference value between each test pixel point in the rendered image and a corresponding pixel point in the reference image to obtain a pixel difference value corresponding to each test pixel point; constructing a difference image based on each pixel difference value, and calculating the pixel mean square error of the difference image to obtain a pixel mean square error value; under the condition that the pixel mean square value is not greater than a second target threshold value, determining that the test result of the user interface rendering engine is a compatible user interface file; and under the condition that the pixel mean square value is larger than a second target threshold value, determining that the test result of the user interface rendering engine is an incompatible user interface file.
In some embodiments, the rendering engine compatibility testing apparatus 500 provided in this embodiment may further include: the display module is specifically used for: and visually displaying the test result, the rendering result and the reference result.
In the implementation, each module and/or unit may be implemented as an independent entity, or may be combined arbitrarily and implemented as the same entity or a plurality of entities, where the implementation of each module and/or unit may refer to the foregoing method embodiment, and the specific beneficial effects that may be achieved may refer to the beneficial effects in the foregoing method embodiment, which are not described herein again.
In addition, referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device may be a mobile terminal, such as a smart phone, a tablet computer, or the like. As shown in fig. 6, the electronic device 600 includes a processor 601, a memory 602. The processor 601 is electrically connected to the memory 602.
The processor 601 is a control center of the electronic device 600, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device 600 and processes data by running or loading application programs stored in the memory 602, and calling data stored in the memory 602, thereby performing overall monitoring of the electronic device 600.
In this embodiment, the processor 601 in the electronic device 600 loads instructions corresponding to the processes of one or more application programs into the memory 602 according to the following steps, and the processor 601 executes the application programs stored in the memory 602, so as to implement any step of the rendering engine compatibility testing method provided in the foregoing embodiment.
The electronic device 600 may implement the steps in any embodiment of the rendering engine compatibility testing method provided by the embodiment of the present invention, so that the beneficial effects that any rendering engine compatibility testing method provided by the embodiment of the present invention can implement are detailed in the previous embodiments, and are not repeated here.
Referring to fig. 7, fig. 7 is another schematic structural diagram of an electronic device provided in an embodiment of the present invention, and fig. 7 is a specific structural block diagram of the electronic device provided in the embodiment of the present invention, where the electronic device may be used to implement the rendering engine compatibility testing method provided in the embodiment. The electronic device 700 may be a mobile terminal such as a smart phone or a notebook computer.
The RF circuit 710 is configured to receive and transmit electromagnetic waves, and to perform mutual conversion between the electromagnetic waves and the electrical signals, thereby communicating with a communication network or other devices. RF circuitry 710 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF circuitry 710 may communicate with various networks such as the internet, intranets, wireless networks, or other devices via wireless networks. The wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. The wireless network may use various communication standards, protocols, and technologies including, but not limited to, global system for mobile communications (Global System for Mobile Communication, GSM), enhanced mobile communications technology (Enhanced Data GSM Environment, EDGE), wideband code division multiple access technology (Wideband Code Division Multiple Access, WCDMA), code division multiple access technology (Code Division Access, CDMA), time division multiple access technology (Time Division Multiple Access, TDMA), wireless fidelity technology (Wireless Fidelity, wi-Fi) (e.g., institute of electrical and electronics engineers standards IEEE 802.11a,IEEE 802.11b,IEEE802.11g and/or IEEE802.11 n), internet telephony (Voice over Internet Protocol, voIP), worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, wi-Max), other protocols for mail, instant messaging, and short messaging, as well as any other suitable communication protocols, even including those not currently developed.
The memory 720 may be used to store software programs and modules, such as program instructions/modules corresponding to the rendering engine compatibility test method in the above embodiments, and the processor 780 executes the software programs and modules stored in the memory 720 to perform various functional applications and to perform the rendering engine compatibility test.
Memory 720 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 720 may further include memory located remotely from processor 780, which may be connected to electronic device 700 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 730 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 730 may include a touch-sensitive surface 731 and other input devices 732. The touch-sensitive surface 731, also referred to as a touch display screen or touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on or thereabout the touch-sensitive surface 731 using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection device according to a pre-set program. Alternatively, touch-sensitive surface 731 may comprise two parts, a touch-detecting device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 780, and can receive commands from the processor 780 and execute them. In addition, the touch sensitive surface 731 may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 731, the input unit 730 may also include other input devices 732. In particular, the other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 740 may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device 700, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 740 may include a display panel 741, and alternatively, the display panel 741 may be configured in the form of an LCD (Liquid Crystal Display ), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 731 may overlay the display panel 741, and upon detection of a touch operation thereon or thereabout by the touch-sensitive surface 731, the touch-sensitive surface 731 is passed to the processor 780 for determining the type of touch event, and the processor 780 then provides a corresponding visual output on the display panel 741 based on the type of touch event. Although in the figures the touch-sensitive surface 731 and the display panel 741 are implemented as two separate components, in some embodiments the touch-sensitive surface 731 and the display panel 741 may be integrated to implement the input and output functions.
The electronic device 700 may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 741 according to the brightness of ambient light, and a proximity sensor that may generate an interrupt when the folder is closed or closed. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device 700 are not described in detail herein.
Audio circuitry 760, speaker 761, and microphone 762 may provide an audio interface between a user and electronic device 700. The audio circuit 760 may transmit the received electrical signal converted from audio data to the speaker 761, and the electrical signal is converted into a sound signal by the speaker 761 to be output; on the other hand, microphone 762 converts the collected sound signals into electrical signals, which are received by audio circuit 760 and converted into audio data, which are processed by audio data output processor 780 for transmission to, for example, another terminal via RF circuit 710, or which are output to memory 720 for further processing. Audio circuitry 760 may also include an ear bud jack to provide communication between a peripheral ear bud and electronic device 700.
The electronic device 700 may facilitate user reception of requests, transmission of information, etc. via a transmission module 770 (e.g., wi-Fi module), which provides wireless broadband internet access to the user. Although the transmission module 770 is shown in the drawings, it is understood that it does not belong to the essential constitution of the electronic device 700, and can be omitted entirely as required within the scope not changing the essence of the invention.
The processor 780 is a control center of the electronic device 700, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the electronic device 700 and processes data by running or executing software programs and/or modules stored in the memory 720 and invoking data stored in the memory 720, thereby performing overall monitoring of the electronic device. Optionally, the processor 780 may include one or more processing cores; in some embodiments, the processor 780 may integrate an application processor that primarily processes operating systems, user interfaces, applications, and the like, with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 780.
The electronic device 700 also includes a power supply 790 (e.g., a battery) that provides power to the various components, and in some embodiments, may be logically coupled to the processor 780 through a power management system to perform functions such as managing charging, discharging, and power consumption by the power management system. Power supply 790 may also include one or more of any components, such as a dc or ac power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the electronic device 700 further includes a camera (e.g., front camera, rear camera), a bluetooth module, etc., which will not be described in detail herein. In particular, in this embodiment, the display unit of the electronic device is a touch screen display, and the mobile terminal further includes a memory, and one or more programs, where the one or more programs are stored in the memory, and configured to be executed by the one or more processors, where the one or more programs implement any step in the rendering engine compatibility test method provided in the foregoing embodiment.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium having stored therein a plurality of instructions that when executed by a processor enable any one of the steps of the rendering engine compatibility test method provided in the above embodiment.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The instructions stored in the storage medium can execute the steps in any embodiment of the rendering engine compatibility testing method provided by the embodiment of the present invention, so that the beneficial effects that any rendering engine compatibility testing method provided by the embodiment of the present invention can achieve can be achieved, and detailed descriptions of the previous embodiments are omitted herein.
The foregoing describes in detail a rendering engine compatibility testing method, apparatus, electronic device and storage medium provided in the embodiments of the present application, and specific examples are applied to illustrate principles and implementations of the present application, where the foregoing description of the embodiments is only for helping to understand the method and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above. Moreover, it will be apparent to those skilled in the art that various modifications and variations can be made without departing from the principles of the present invention, and such modifications and variations are also considered to be within the scope of the invention.

Claims (10)

1. A method for testing compatibility of a rendering engine, comprising:
acquiring a user interface file to be processed;
invoking a user interface rendering engine to be tested, and rendering the user interface file to obtain a rendering result;
and determining a test result of the user interface rendering engine for rendering the user interface file according to the rendering result and a reference result corresponding to the user interface file.
2. The method of claim 1, wherein the step of obtaining the user interface file to be processed comprises:
acquiring a user interface development paradigm to be processed and an execution configuration corresponding to the user interface development paradigm;
writing the user interface development paradigm and the execution configuration into user interface code;
and compiling the user interface codes to obtain user interface files which can be executed by the user interface rendering engine to be tested.
3. The method of claim 1, wherein the step of calling a user interface rendering engine to be tested, rendering the user interface file to obtain a rendering result comprises:
Invoking a user interface rendering engine to be tested, and rendering the user interface file to obtain a bitmap output by the user interface rendering engine;
converting the bitmap into a target image in a target format, and taking the target image as a rendering result.
4. A method according to claim 2 or 3, wherein the step of determining a test result of the user interface rendering engine for rendering the user interface file according to the rendering result and a reference result corresponding to the user interface file comprises:
calculating the similarity between the rendering result and the reference result corresponding to the user interface file to obtain a similarity value;
under the condition that the similarity value is larger than a first target threshold value, determining that the test result of the user interface rendering engine is compatible with the user interface file;
and under the condition that the similarity value is not greater than a first target threshold value, determining that the test result of the user interface rendering engine is incompatible with the user interface file.
5. The method of claim 4, wherein prior to the step of calculating a similarity between the rendering result and the reference result corresponding to the user interface file, the method further comprises:
Rendering the user interface file to obtain an initial rendering result;
judging whether the initial rendering result accords with the expectation of the user interface file or not to obtain a judging result;
and taking the initial rendering result as a reference result of the user interface file under the condition that the judging result is yes.
6. The method of claim 3, wherein the reference result comprises a reference image, and the step of determining a test result of the user interface rendering engine for rendering the user interface file according to the rendering result and the reference result corresponding to the user interface file comprises:
calculating a difference value between each test pixel point in the rendered image and a corresponding pixel point in the reference image to obtain a pixel difference value corresponding to each test pixel point;
constructing a difference image based on each pixel difference value, and calculating the pixel mean square error of the difference image to obtain a pixel mean square error value;
determining that the test result of the user interface rendering engine is compatible with the user interface file under the condition that the pixel mean square value is not greater than a second target threshold value;
And under the condition that the pixel mean square value is larger than a second target threshold value, determining that the test result of the user interface rendering engine is incompatible with the user interface file.
7. The method of claim 1, wherein the method further comprises:
and visually displaying the test result, the rendering result and the reference result.
8. A rendering engine compatibility test apparatus, comprising:
the acquisition module is used for acquiring the user interface file to be processed;
the rendering module is used for calling a user interface rendering engine to be tested, and rendering the user interface file to obtain a rendering result;
and the determining module is used for determining a test result of rendering processing of the user interface file by the user interface rendering engine according to the rendering result and a reference result corresponding to the user interface file.
9. An electronic device comprising a processor, a memory and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1 to 7 when the computer program is executed.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps in the method according to any one of claims 1 to 7.
CN202311851667.8A 2023-12-28 2023-12-28 Rendering engine compatibility testing method and device, electronic equipment and storage medium Pending CN117806964A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311851667.8A CN117806964A (en) 2023-12-28 2023-12-28 Rendering engine compatibility testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311851667.8A CN117806964A (en) 2023-12-28 2023-12-28 Rendering engine compatibility testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117806964A true CN117806964A (en) 2024-04-02

Family

ID=90431521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311851667.8A Pending CN117806964A (en) 2023-12-28 2023-12-28 Rendering engine compatibility testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117806964A (en)

Similar Documents

Publication Publication Date Title
CN107038112B (en) Application interface debugging method and device
CN106502703B (en) Function calling method and device
CN111078556B (en) Application testing method and device
WO2014206055A1 (en) A method and system for generating a user interface
WO2018161540A1 (en) Fingerprint registration method and related product
CN112116690B (en) Video special effect generation method, device and terminal
CN109451130B (en) Mobile terminal testing method and device, mobile terminal and storage medium
CN112084747A (en) Resource management method and device, electronic equipment and storage medium
CN112749074B (en) Test case recommending method and device
CN108984374B (en) Method and system for testing database performance
CN111104180B (en) Application program optimization method and device, storage medium and electronic equipment
CN111026457B (en) Hardware configuration method and device, storage medium and terminal equipment
CN111045737B (en) Equipment identifier acquisition method, device, terminal equipment and storage medium
CN111064847B (en) False touch prevention method and device, storage medium and electronic equipment
CN108027967B (en) Image stitching method and electronic equipment
CN108269223B (en) Webpage graph drawing method and terminal
CN117806964A (en) Rendering engine compatibility testing method and device, electronic equipment and storage medium
CN106709856B (en) Graph rendering method and related equipment
CN108829600B (en) Method and device for testing algorithm library, storage medium and electronic equipment
CN114510417A (en) Image rendering effect testing method and device, electronic equipment and storage medium
CN109451295A (en) A kind of method and system obtaining virtual information
CN108959073B (en) Method and device for testing algorithm library, storage medium and electronic equipment
CN105988801B (en) Method and device for displaying annotation information
EP4160420A1 (en) Identification card conversion method and system, storage medium and terminal device
CN111309605B (en) Terminal test method and device, storage medium and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination