A method and apparatus for screen output testing
By acquiring the configuration information of the screen under test and using virtual output and recording devices to simulate the output and recording of test data streams, the instability problem of in-vehicle map navigation application testing and verification is solved, achieving efficient and stable testing results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA INNOVATION PRIVATE LIMITED
- Filing Date
- 2021-04-28
- Publication Date
- 2026-04-24
AI Technical Summary
The existing testing and verification process for in-vehicle map navigation applications is susceptible to uncontrollable factors such as in-vehicle hardware and compatibility software packages, which can lead to inefficient and unstable testing and verification, especially when in-vehicle hardware is unavailable, affecting subsequent processes.
By acquiring the configuration information of the screen under test, a virtual output device and a virtual recording device adapted to the screen under test are obtained. Test data is simulated based on the virtual output device, and the test data stream is recorded using the virtual recording device to verify the output effect of the target data on the screen under test.
Without relying on in-vehicle hardware or compatible software packages, it achieves efficient and stable testing and verification of map navigation data output, avoiding the impact of uncontrollable factors.
Smart Images

Figure CN115248771B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a screen output testing method. This application also relates to a screen output testing device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] In the field of map navigation applications, existing map navigation applications can provide services for outputting map navigation information on multiple screens, including extended screens. This model supports customized configuration of map navigation applications to meet specific needs. For example, in the field of in-vehicle navigation software products, when formulating navigation project plans, in order to improve the user experience of in-vehicle map navigation applications, car manufacturers can customize map navigation applications based on multiple in-vehicle screens (main in-vehicle screen, instrument screen, screens of other in-vehicle accessories, etc.) so that multiple in-vehicle screens can collaboratively output map navigation data.
[0003] In the aforementioned process, it is necessary to test the output effect of map navigation data beforehand (e.g., the display effect of map navigation information on the in-vehicle screen, system interaction effect, etc.) to verify whether the output effect of map navigation data on the corresponding in-vehicle screen meets expectations, thereby achieving the adaptation and integration of map navigation application and in-vehicle system. Existing testing and verification processes for in-vehicle map navigation applications rely on in-vehicle hardware and adaptation software packages. This process is susceptible to uncontrollable factors, leading to inefficient and unstable testing and verification, affecting subsequent processes. For example, if there are problems with the in-vehicle hardware and adaptation software packages, the testing and verification process for in-vehicle map navigation applications will be blocked. If it is at a critical release node for the in-vehicle map navigation application version, it is necessary to rely on the in-vehicle environment for debugging and reproduction to investigate existing problems. This process is time-consuming and may reduce the quality of the in-vehicle map navigation application version. Furthermore, if the in-vehicle hardware is unavailable due to uncontrollable factors, the testing and verification work cannot be carried out as planned, similarly affecting subsequent processes. Therefore, how to efficiently and stably implement testing and verification of in-vehicle map navigation applications for multiple screens is a problem that needs to be solved. Summary of the Invention
[0004] This application provides a screen output testing method, apparatus, electronic device, and computer-readable storage medium to solve the problem that existing testing and verification work for in-vehicle map navigation applications is easily affected by uncontrollable factors due to reliance on in-vehicle hardware devices and adaptation software packages, resulting in the inability to achieve efficient and stable testing and verification.
[0005] This application provides a screen output testing method, including:
[0006] Obtain configuration information for the screen under test, which is a predetermined output screen for the target data;
[0007] Based on the configuration information, a virtual output device and a virtual recording device adapted to the screen under test are obtained;
[0008] Based on the virtual output device, output test data representing the output effect of the target data on the screen under test is output;
[0009] The output test data is recorded using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test.
[0010] This application also provides a screen output testing device, including:
[0011] A configuration information acquisition unit is used to acquire configuration information for the screen under test, wherein the screen under test is a predetermined output screen for the target data;
[0012] The virtual device acquisition unit is used to acquire, based on the configuration information, a virtual output device and a virtual recording device adapted to the screen under test;
[0013] The output test data output unit is used to output output test data, which characterizes the output effect of the target data on the screen under test, based on the virtual output device.
[0014] The test data stream acquisition unit is used to record the output test data using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test.
[0015] This application also provides an electronic device, including a processor and a memory; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method described above.
[0016] This application also provides a computer-readable storage medium storing one or more computer instructions that are executed by a processor to implement the method described above.
[0017] This application also provides a computer program product, including a computer program / instructions, wherein the computer program / instructions, when executed by a processor, implement the steps of the above-described method.
[0018] Compared with the prior art, the embodiments of this application have the following advantages:
[0019] The screen output testing method provided in this application first obtains configuration information for the screen under test, which is a predetermined output screen for the target data. Based on the configuration information, a virtual output device and a virtual recording device adapted to the screen under test are obtained. Then, output test data representing the output effect of the target data on the screen under test is output based on the virtual output device, and the output test data is recorded using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test. This method, based on configuration information for the screen under test, obtains a test data stream for verifying the output effect of target data on the screen under test by using a virtual output device and a virtual recording device adapted to the screen under test. In scenarios where the output effect of map navigation data (e.g., the display effect of map navigation data on the in-vehicle screen, system interaction effect, etc.) is tested, the above method can efficiently and stably test and verify the output effect of map navigation data of map navigation applications on the screen under test without relying on in-vehicle hardware devices and adaptation software packages. It avoids the problem that existing testing and verification work of in-vehicle map navigation applications is easily affected by uncontrollable factors due to reliance on in-vehicle hardware devices and adaptation software packages, resulting in the inability to achieve efficient and stable testing and verification. Attached Figure Description
[0020] Figure 1 This is a flowchart of the screen output testing method provided in the first embodiment of this application;
[0021] Figure 2 This is a unit block diagram of the screen output testing device provided in the second embodiment of this application;
[0022] Figure 3 This is a schematic diagram of the logical structure of the electronic device provided in the third embodiment of this application. Detailed Implementation
[0023] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0024] To address screen output testing scenarios and reduce the dependence of screen output effect testing on the physical screen environment and the installation of compatible software packages, thereby improving the stability and simplifying the testing process, this application provides a screen output testing method, a corresponding screen output testing device, an electronic device, and a computer-readable storage medium. The following embodiments provide a detailed description of the method, device, electronic device, and computer-readable storage medium.
[0025] The first embodiment of this application provides a screen output testing method. The application subject of this method can be a computing device application used to test the screen output effect. The computing device application can run on the server of a travel service network platform. Figure 1 This is a flowchart of the screen output testing method provided in the first embodiment of this application, which is described below in conjunction with... Figure 1 The method provided in this embodiment will be described in detail. The embodiments described below are used to explain the principle of the method and are not intended to limit actual use.
[0026] like Figure 1 As shown, the screen output testing method provided in this embodiment includes the following steps:
[0027] S101, obtain configuration information for the screen under test.
[0028] This step is used to obtain configuration information for the screen under test, which is the predetermined output screen for the target data. Pre-testing the effect of outputting the target data on the screen under test verifies whether the output effect of the target data on that screen meets expectations. In the field of map navigation applications, map navigation applications can provide services for outputting map navigation information on multiple screens, including extended screens. This mode supports customized configuration of map navigation applications to meet specific needs. For example, in the field of in-vehicle navigation software products, when formulating navigation project plans, car manufacturers can customize map navigation applications based on multiple in-vehicle screens (main screen, instrument panel screen, screens configured on other in-vehicle accessories, etc.) to improve the user experience of in-vehicle map navigation applications. This allows multiple in-vehicle screens to collaboratively output map navigation data. For example, map navigation data or other relevant information can be displayed in sections on the in-vehicle dashboard or other in-vehicle accessory screens, combined with the map display on the main in-vehicle screen, thereby improving the user experience of navigation applications. In this scenario, the screen under test is the target vehicle screen, and the target data can be map navigation data output to that target vehicle screen. There can be multiple target vehicle screens, which can work together as predetermined output screens for map navigation data. Examples include the main vehicle screen, instrument panel screen, and screens of other vehicle accessories. Pre-testing the output effect of the map navigation data on the target vehicle screen (e.g., the display effect of map navigation information on the target vehicle screen, system interaction effect, etc.) verifies whether the output effect of the map navigation data on the corresponding vehicle screen meets expectations, thereby achieving the adaptation and connection between the map navigation application and the vehicle system. In this embodiment, the target vehicle screen is preferably an extended vehicle screen, such as the aforementioned instrument panel screen or screens of other vehicle accessories. The map navigation data can be map navigation display data, such as a map display screen, and can also include navigation voice data corresponding to the map navigation display data, such as navigation voice interaction information output synchronously with the map display screen.
[0029] The configuration information for the screen under test can be a configuration file generated based on the configuration requirements of the target vehicle screen when outputting map navigation data. It includes one or more of the following: the number of screens under test (e.g., the number of vehicle screens preset by the car manufacturer for collaborative output of map navigation data), the size of the screen under test, the functional attributes of the screen under test (e.g., for outputting main map information, for outputting secondary map information, etc.), the output mode of the screen under test (e.g., full-screen output mode, partial output mode, panoramic mode, overview mode, etc.), and the personalized output content of the screen under test (e.g., personalized image information and text information output by the car manufacturer on the screen under test). In this embodiment, the configuration information for the screen under test may also include any other information that meets the adaptation and customization requirements.
[0030] S102, based on the configuration information for the screen under test, obtains a virtual output device and a virtual recording device that are compatible with the screen under test.
[0031] After obtaining the configuration information for the screen under test in the above steps, this step can obtain a virtual output device and a virtual recording device adapted to the screen under test based on the configuration information. The virtual output device can be a virtual screen with the same size, frame rate, output mode, etc. as the screen under test. It is used to simulate the output of predetermined target data that needs to be output through the screen under test. For example, it can simulate the playback of map navigation data containing navigation voice data through an in-vehicle extended screen. The virtual recording device can be used to virtually record the content simulated by the virtual output device.
[0032] In this embodiment, the process of obtaining a virtual output device and a virtual recording device adapted to the screen under test can be implemented using the MediaProjection + MediaRecorder screen recording technology framework provided by the Android system. Specifically, this process can be as follows:
[0033] First, a MediaProjectionManager instance is invoked to obtain a MediaProjection instance. MediaProjection is a media projection class provided by the Android system that implements screen capture and recording. It authorizes applications to record screen content and system audio, enabling authorized applications to capture screen content and / or record system audio (in this embodiment, the authorized application is the implementation subject). MediaProjectionManager is the management class for MediaProjection; that is, MediaProjection instances are managed and obtained by a MediaProjectionManager instance. System-level services can be invoked via the getSystemService() method. It should be noted that before invoking the MediaProjectionManager instance as described above, the implementation entity of this embodiment also needs to send a screen recording permission request to the MediaProjectionManager system service, and in response to the screen recording permission confirmation information returned by the MediaProjectionManager system service, invoke the MediaProjectionManager instance. That is, if the authorization is successful, the MediaProjectionManager instance is started, and the MediaProjection instance is obtained through the MediaProjectionManager.getMediaProjection() method.
[0034] Secondly, create a MediaRecorder instance and configure it as a virtual recording device adapted to the screen under test according to the configuration information for the screen under test. Creating a MediaRecorder instance means initializing and constructing a MediaRecorder instance based on a MediaProjection instance. For example, after obtaining a MediaProjection instance, create a MediaRecorder instance using the createMediaRecorder() method and set information such as whether to record audio, screen recording file output format, screen recording file output path, audio and video encoder, encoding format, bitrate, and video frame rate based on the configuration information.
[0035] Then, a virtual display instance is created based on the media projection instance, and the virtual display instance is configured as a virtual output device adapted to the screen under test according to the configuration information for the screen under test mentioned above. Specifically, the createVirtualDisplay() method of the media projection instance is called to create the virtual display instance, and its width, height, pixel density, etc. are set according to the configuration information mentioned above. The media projection instance and the media recorder instance can interact based on the virtual display instance.
[0036] Finally, the rendering carrier (Surface) instance created in the MediaRecorder instance is obtained through the MediaProjection instance, and then configured in the VirtualDisplay instance. That is, after the MediaRecorder instance creates the Surface instance, it is configured as a parameter in the aforementioned VirtualDisplay instance. The Surface instance serves as a carrier for acquiring layer data of the screen under test; it acts as a buffer for layer data and can store layer data drawn by the image rendering tools. After configuring the MediaRecorder instance as described above, and before creating the VirtualDisplay instance, the MediaRecorder.prepare() method must be called to properly obtain the Surface instance.
[0037] S103, based on a virtual output device, outputs test data representing the output effect of the target data on the screen under test.
[0038] After obtaining the virtual output device and virtual recording device adapted to the screen under test in the above steps, this step is used to simulate the output of test data to characterize the output effect of the target data on the screen under test based on the virtual output device. The output test data is the data obtained after executing test cases on the simulated output process of the target data. For example, if the screen under test is the target vehicle screen, and the map navigation data is map navigation display data, the output test data is the virtual video data obtained after executing test cases (e.g., window switching execution case, display mode switching execution case, system interaction execution case, etc.) on the simulated display process of the map navigation display data corresponding to the target vehicle screen. When the map navigation data also includes navigation voice data corresponding to the map navigation display data, the output test data is the virtual audio and video data obtained after executing test cases (e.g., voice navigation command test cases) on the simulated output process of the map navigation display data and navigation voice data corresponding to the target vehicle screen.
[0039] The aforementioned output test data, based on a virtual output device, representing the output effect of target data on the screen under test, can specifically refer to: instructing the application under test to simulate outputting target data based on the virtual output device and simultaneously executing test cases for verifying the output effect of the target data, so that the virtual output device simulates the output test data. For example, during the process of instructing the application under test to simulate outputting target data based on the virtual output device, a preset protocol is used to interact with the application under test, so that when the application under test outputs target data based on the virtual output device, it simultaneously executes test cases corresponding to the preset protocol, making the final output data the output test data for which the test cases have been executed. In this embodiment, the target data is map navigation data, and the application under test is an in-vehicle map navigation application for outputting map navigation data. The above process can specifically be: instructing the in-vehicle map navigation application to draw map navigation display data based on the virtual output device and interacting with the in-vehicle map navigation application using a preset protocol, so that when the in-vehicle map navigation application draws map navigation display data, it simultaneously executes test cases corresponding to the preset protocol (e.g., window switching execution test cases, display mode switching execution test cases, system interaction execution test cases, etc.), so that the final drawn data is the output test data for which the test cases have been executed.
[0040] In this embodiment, after obtaining the configuration information for the screen under test, the configuration information can be provided to the application under test in advance so that the application under test can update the target data based on the configuration information. For example, custom information can be added to the target data (e.g., personalized image information, text information, etc. that the car manufacturer wants to display on the in-vehicle extended screen). The control of the custom information can be displayed in the subsequent process of simulating the output of the target data. In this case, the above-mentioned instruction to the application under test to simulate the output of the target data based on the virtual output device can mean: instructing the application under test to simulate the output of the updated target data based on the virtual output device.
[0041] S104, a virtual recording device is used to record the output test data to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test.
[0042] While the above steps output test data representing the output effect of the target data on the screen under test, this step is used to record the above output test data using a virtual recording device to obtain a test data stream for verifying the output effect of the target data on the screen under test.
[0043] The aforementioned verification of the target data's output effect on the screen under test can specifically refer to: presenting the test data stream in real time and verifying the effect of the target data output on the screen under test based on the real-time presented test data stream; or, after the above-mentioned output test data recording is completed, replaying the test data stream and verifying the effect of the target data output on the screen under test based on the replayed test data stream. After obtaining the verification results, the verification results also need to be reported to achieve efficient summarization and targeted repair of the problems found in the test.
[0044] Corresponding to step S102 above, the simulated output process and recording process of the output test data can also be implemented based on the screen recording technology framework provided by the Android system. For example, the method of outputting the output test data representing the output effect of the target data on the screen under test based on the virtual output device in step S103 above can be specifically as follows: using an image drawing tool (e.g., an in-vehicle map navigation application) to draw the output test data based on the rendering carrier (Surface) instance configured on the virtual screen (VirtualDisplay) instance. The method of recording the output test data using a virtual recording device in step S104 above can be specifically as follows: using a media recording instance (MediaRecorder) to record the data drawn on the rendering carrier instance. For example, the output test data is recorded. For instance, the output test data drawn on the Surface instance is provided to the MediaRecorder instance by using the mMediaRecorder.getSurface() method. The recorded content is the content on the surface obtained by mediaRecorder.getSurface(). The MediaRecorder instance encapsulates the drawn output test data, for example, encapsulates it into an Mp4 file, and calls the start() method of the MediaRecorder instance to output the encapsulated data to the specified directory, thus obtaining a test data stream used to verify the output effect of the target data corresponding to the screen under test.
[0045] It should be noted that, in addition to using the MediaProjection+MediaRecorder screen recording technology framework mentioned above, the simulated output process and recording process of the test data can also be implemented in other ways, such as using the existing screen recording technology framework of MediaProjection+MediaCodec+MediaMuxer, which will not be elaborated here.
[0046] The screen output testing method provided in this embodiment first obtains configuration information for the screen under test, which is a predetermined output screen for the target data. Based on the configuration information, a virtual output device and a virtual recording device adapted to the screen under test are obtained. Then, output test data representing the output effect of the target data on the screen under test is output based on the virtual output device, and the output test data is recorded using the virtual recording device to obtain a test data stream used to verify the output effect of the target data corresponding to the screen under test. The output test data is virtual data obtained after executing test cases in the simulated output process of the target data. This method, based on configuration information for the screen under test, obtains a test data stream for verifying the output effect of target data on the screen under test by using a virtual output device and a virtual recording device adapted to the screen under test. In scenarios where the output effect of map navigation data (e.g., the display effect of map navigation data on the in-vehicle screen, system interaction effect, etc.) is tested, the above process can efficiently and stably test and verify the output effect of map navigation data of map navigation applications on the screen under test without relying on in-vehicle hardware devices and adaptation software packages. It avoids the problem that existing testing and verification work of in-vehicle map navigation applications, which relies on in-vehicle hardware devices and adaptation software packages, is easily affected by uncontrollable factors, resulting in the inability to achieve efficient and stable testing and verification.
[0047] The first embodiment described above provides a screen output testing method. Correspondingly, the second embodiment of this application also provides a screen output testing device. Since the device embodiment is basically similar to the method embodiment, it is described in a relatively simple way. For details of the relevant technical features, please refer to the corresponding description of the method embodiment provided above. The following description of the device embodiment is merely illustrative.
[0048] Please refer to Figure 2 Understanding this embodiment, Figure 2 This is a unit block diagram of the screen output testing device provided in this embodiment, as shown below. Figure 2 As shown, the apparatus provided in this embodiment includes:
[0049] The configuration information acquisition unit 201 is used to acquire configuration information for the screen under test, wherein the screen under test is a predetermined output screen for the target data;
[0050] The virtual device acquisition unit 202 is used to acquire a virtual output device and a virtual recording device that are compatible with the screen under test based on the configuration information.
[0051] The output test data output unit 203 is used to output output test data that characterizes the output effect of the target data on the screen under test, based on the virtual output device.
[0052] The test data stream acquisition unit 204 is used to record the output test data using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test.
[0053] The output test data is the data obtained after executing test cases on the simulated output process of the target data. The step of obtaining a virtual output device and a virtual recording device adapted to the screen under test based on the configuration information includes: calling a media projection management instance and obtaining a media projection instance through the media projection management instance; creating a media recording instance and configuring the media recording instance as a virtual recording device adapted to the screen under test according to the configuration information; creating a virtual screen instance based on the media projection instance and configuring the virtual screen instance as a virtual output device adapted to the screen under test according to the configuration information; obtaining a rendering carrier instance created in the media recording instance through the media projection instance and configuring the rendering carrier instance in the virtual screen instance.
[0054] The step of outputting output test data representing the output effect of the target data on the screen under test based on the virtual output device includes: drawing the output test data based on the rendering carrier instance configured in the virtual screen instance. The step of recording the output test data using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test includes: recording the output test data drawn on the rendering carrier instance by the media recording instance.
[0055] Before invoking the media projection management instance, the method further includes: sending a screen recording permission request to the media projection management system service; invoking the media projection management instance includes: invoking the media projection management instance in response to the screen recording permission confirmation information returned by the media projection management system service.
[0056] The step of outputting output test data representing the output effect of the target data on the screen under test based on the virtual output device includes: instructing the application under test to simulate outputting the target data based on the virtual output device and synchronously executing test cases for verifying the output effect of the target data, so that the virtual output device simulates outputting the output test data.
[0057] The instruction to the application under test to simulate outputting the target data based on the virtual output device and simultaneously execute test cases for verifying the output effect of the target data includes: during the process of instructing the application under test to simulate outputting the target data based on the virtual output device, interacting with the application under test using a preset protocol, so that the application under test simultaneously executes test cases corresponding to the preset protocol when outputting the target data.
[0058] It also includes: a configuration information providing unit, used to provide the configuration information to the application under test so that the application under test can update the target data based on the configuration information; the instruction to the application under test to simulate outputting the target data based on the virtual output device includes: instructing the application under test to simulate outputting the updated target data based on the virtual output device.
[0059] The application under test includes an in-vehicle map navigation application, the screen under test includes a target in-vehicle screen, and the target data includes map navigation data for output on the target in-vehicle screen. The configuration information for the screen under test includes configuration requirements information corresponding to the target in-vehicle screen when outputting the map navigation data. The output test data includes virtual multimedia data obtained after executing test cases for the simulated output process of the map navigation data corresponding to the target in-vehicle screen.
[0060] The map navigation data includes: map navigation display data; the output test data includes: virtual video data obtained after executing test cases for the simulated display process of the map navigation display data corresponding to the target in-vehicle screen. The map navigation data also includes: voice data corresponding to the map navigation display data; the output test data also includes: virtual audio and video data obtained after executing test cases for the simulated output process of the map navigation display data and the voice data corresponding to the target in-vehicle screen. The target in-vehicle screen includes a target in-vehicle extended screen.
[0061] The verification of the output effect of the target data corresponding to the screen under test includes: presenting the test data stream in real time, and verifying the effect of the target data output on the screen under test based on the real-time presented test data stream; or, after the output test data is recorded, playing back the test data stream, and verifying the effect of the target data output on the screen under test based on the played-back test data stream.
[0062] The number of screens to be tested is multiple, and the multiple screens to be tested work together as the predetermined output screen for the target data.
[0063] The configuration information includes at least one of the following: the number of screens under test; the size of the screens under test; the functional attributes of the screens under test; the output mode of the screens under test; and the personalized output content of the screens under test.
[0064] The screen output testing device provided in this embodiment can obtain a test data stream for verifying the output effect of target data on the screen under test based on the configuration information of the screen under test and by using a virtual output device and a virtual recording device adapted to the screen under test. In scenarios where the output effect of map navigation data (e.g., the display effect of map navigation data on the in-vehicle screen, system interaction effect, etc.) is tested, the above device can efficiently and stably test and verify the output effect of map navigation data of map navigation application on the screen under test without relying on in-vehicle hardware devices and adaptation software packages. This avoids the problem that the existing testing and verification work of in-vehicle map navigation application is easily affected by uncontrollable factors due to reliance on in-vehicle hardware devices and adaptation software packages, resulting in the inability to achieve efficient and stable testing and verification.
[0065] In the above embodiments, a screen output testing method and a screen output testing device are provided. Furthermore, the third embodiment of this application also provides an electronic device. Since the electronic device embodiment is basically similar to the method embodiment, it is described simply. For details of the relevant technical features, please refer to the corresponding descriptions of the above-provided method embodiments. The following description of the electronic device embodiment is merely illustrative. The electronic device embodiment is as follows:
[0066] Please refer to Figure 3 To understand this embodiment, Figure 3 This is a schematic diagram of the electronic device provided in this embodiment.
[0067] like Figure 3 As shown, the electronic device includes: a processor 301; a memory 302; the memory 302 is used to store a program for implementing the screen output test method, and when the program is read and executed by the processor, it performs the following operations:
[0068] Obtain configuration information for the screen under test, which is a predetermined output screen for the target data;
[0069] Based on the configuration information, a virtual output device and a virtual recording device adapted to the screen under test are obtained;
[0070] Based on the virtual output device, output test data representing the output effect of the target data on the screen under test is output;
[0071] The output test data is recorded using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test.
[0072] The output test data is the data obtained after executing test cases on the simulated output process of the target data. The step of obtaining a virtual output device and a virtual recording device adapted to the screen under test based on the configuration information includes: calling a media projection management instance and obtaining a media projection instance through the media projection management instance; creating a media recording instance and configuring the media recording instance as a virtual recording device adapted to the screen under test according to the configuration information; creating a virtual screen instance based on the media projection instance and configuring the virtual screen instance as a virtual output device adapted to the screen under test according to the configuration information; obtaining a rendering carrier instance created in the media recording instance through the media projection instance and configuring the rendering carrier instance in the virtual screen instance.
[0073] The step of outputting output test data representing the output effect of the target data on the screen under test based on the virtual output device includes: drawing the output test data based on the rendering carrier instance configured in the virtual screen instance. The step of recording the output test data using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test includes: recording the output test data drawn on the rendering carrier instance by the media recording instance.
[0074] Before invoking the media projection management instance, the method further includes: sending a screen recording permission request to the media projection management system service; invoking the media projection management instance includes: invoking the media projection management instance in response to the screen recording permission confirmation information returned by the media projection management system service.
[0075] The step of outputting output test data representing the output effect of the target data on the screen under test based on the virtual output device includes: instructing the application under test to simulate outputting the target data based on the virtual output device and synchronously executing test cases for verifying the output effect of the target data, so that the virtual output device simulates outputting the output test data.
[0076] The instruction to the application under test to simulate outputting the target data based on the virtual output device and simultaneously execute test cases for verifying the output effect of the target data includes: during the process of instructing the application under test to simulate outputting the target data based on the virtual output device, interacting with the application under test using a preset protocol, so that the application under test simultaneously executes test cases corresponding to the preset protocol when outputting the target data.
[0077] It also includes: providing the configuration information to the application under test so that the application under test can update the target data based on the configuration information; instructing the application under test to simulate outputting the target data based on the virtual output device includes: instructing the application under test to simulate outputting the updated target data based on the virtual output device.
[0078] The application under test includes an in-vehicle map navigation application, the screen under test includes a target in-vehicle screen, and the target data includes map navigation data for output on the target in-vehicle screen. The configuration information for the screen under test includes configuration requirements information corresponding to the target in-vehicle screen when outputting the map navigation data. The output test data includes virtual multimedia data obtained after executing test cases for the simulated output process of the map navigation data corresponding to the target in-vehicle screen.
[0079] The map navigation data includes: map navigation display data; the output test data includes: virtual video data obtained after executing test cases for the simulated display process of the map navigation display data corresponding to the target in-vehicle screen. The map navigation data also includes: voice data corresponding to the map navigation display data; the output test data also includes: virtual audio and video data obtained after executing test cases for the simulated output process of the map navigation display data and the voice data corresponding to the target in-vehicle screen. The target in-vehicle screen includes a target in-vehicle extended screen.
[0080] The verification of the output effect of the target data corresponding to the screen under test includes: presenting the test data stream in real time, and verifying the effect of the target data output on the screen under test based on the real-time presented test data stream; or, after the output test data is recorded, playing back the test data stream, and verifying the effect of the target data output on the screen under test based on the played-back test data stream.
[0081] The number of screens to be tested is multiple, and the multiple screens to be tested work together as the predetermined output screen for the target data.
[0082] The configuration information includes at least one of the following: the number of screens under test; the size of the screens under test; the functional attributes of the screens under test; the output mode of the screens under test; and the personalized output content of the screens under test.
[0083] By running the electronic device provided in this embodiment, a test data stream can be obtained based on the configuration information of the screen under test and by using a virtual output device and a virtual recording device adapted to the screen under test to verify the output effect of the target data corresponding to the screen under test. In scenarios where the output effect of map navigation data (e.g., the display effect of map navigation data on the in-vehicle screen, system interaction effect, etc.) is tested, the electronic device can efficiently and stably test and verify the output effect of map navigation data of map navigation application on the screen under test without relying on in-vehicle hardware devices and adaptation software packages. This avoids the problem that the existing testing and verification work of in-vehicle map navigation application is easily affected by uncontrollable factors due to reliance on in-vehicle hardware devices and adaptation software packages, resulting in the inability to achieve efficient and stable testing and verification.
[0084] In the above embodiments, a screen output testing method, a screen output testing device, and an electronic device are provided. Furthermore, the fourth embodiment of this application also provides a computer-readable storage medium for implementing the above screen output testing method. The embodiments of the computer-readable storage medium provided in this application are described relatively simply; relevant parts can be found in the corresponding descriptions of the above method embodiments. The embodiments described below are merely illustrative. The computer-readable storage medium provided in this embodiment stores computer instructions, which, when executed by a processor, perform the following steps:
[0085] Obtain configuration information for the screen under test, which is a predetermined output screen for the target data;
[0086] Based on the configuration information, a virtual output device and a virtual recording device adapted to the screen under test are obtained;
[0087] Based on the virtual output device, output test data representing the output effect of the target data on the screen under test is output;
[0088] The output test data is recorded using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test.
[0089] The output test data is the data obtained after executing test cases on the simulated output process of the target data. The step of obtaining a virtual output device and a virtual recording device adapted to the screen under test based on the configuration information includes: calling a media projection management instance and obtaining a media projection instance through the media projection management instance; creating a media recording instance and configuring the media recording instance as a virtual recording device adapted to the screen under test according to the configuration information; creating a virtual screen instance based on the media projection instance and configuring the virtual screen instance as a virtual output device adapted to the screen under test according to the configuration information; obtaining a rendering carrier instance created in the media recording instance through the media projection instance and configuring the rendering carrier instance in the virtual screen instance.
[0090] The step of outputting output test data representing the output effect of the target data on the screen under test based on the virtual output device includes: drawing the output test data based on the rendering carrier instance configured in the virtual screen instance. The step of recording the output test data using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test includes: recording the output test data drawn on the rendering carrier instance by the media recording instance.
[0091] Before invoking the media projection management instance, the method further includes: sending a screen recording permission request to the media projection management system service; invoking the media projection management instance includes: invoking the media projection management instance in response to the screen recording permission confirmation information returned by the media projection management system service.
[0092] The step of outputting output test data representing the output effect of the target data on the screen under test based on the virtual output device includes: instructing the application under test to simulate outputting the target data based on the virtual output device and synchronously executing test cases for verifying the output effect of the target data, so that the virtual output device simulates outputting the output test data.
[0093] The instruction to the application under test to simulate outputting the target data based on the virtual output device and simultaneously execute test cases for verifying the output effect of the target data includes: during the process of instructing the application under test to simulate outputting the target data based on the virtual output device, interacting with the application under test using a preset protocol, so that the application under test simultaneously executes test cases corresponding to the preset protocol when outputting the target data.
[0094] It also includes: providing the configuration information to the application under test so that the application under test can update the target data based on the configuration information; instructing the application under test to simulate outputting the target data based on the virtual output device includes: instructing the application under test to simulate outputting the updated target data based on the virtual output device.
[0095] The application under test includes an in-vehicle map navigation application, the screen under test includes a target in-vehicle screen, and the target data includes map navigation data for output on the target in-vehicle screen. The configuration information for the screen under test includes configuration requirements information corresponding to the target in-vehicle screen when outputting the map navigation data. The output test data includes virtual multimedia data obtained after executing test cases for the simulated output process of the map navigation data corresponding to the target in-vehicle screen.
[0096] The map navigation data includes: map navigation display data; the output test data includes: virtual video data obtained after executing test cases for the simulated display process of the map navigation display data corresponding to the target in-vehicle screen. The map navigation data also includes: voice data corresponding to the map navigation display data; the output test data also includes: virtual audio and video data obtained after executing test cases for the simulated output process of the map navigation display data and the voice data corresponding to the target in-vehicle screen. The target in-vehicle screen includes a target in-vehicle extended screen.
[0097] The verification of the output effect of the target data corresponding to the screen under test includes: presenting the test data stream in real time, and verifying the effect of the target data output on the screen under test based on the real-time presented test data stream; or, after the output test data is recorded, playing back the test data stream, and verifying the effect of the target data output on the screen under test based on the played-back test data stream.
[0098] The number of screens to be tested is multiple, and the multiple screens to be tested work together as the predetermined output screen for the target data.
[0099] The configuration information includes at least one of the following: the number of screens under test; the size of the screens under test; the functional attributes of the screens under test; the output mode of the screens under test; and the personalized output content of the screens under test.
[0100] By executing the computer instructions stored on the computer-readable storage medium provided in this embodiment, a test data stream can be obtained based on the configuration information of the screen under test and by using a virtual output device and a virtual recording device adapted to the screen under test to verify the output effect of the target data corresponding to the screen under test. In scenarios where the output effect of map navigation data (e.g., the display effect of map navigation data on the in-vehicle screen, system interaction effect, etc.) is tested, the above process can efficiently and stably test and verify the output effect of map navigation data of map navigation application on the screen under test without relying on in-vehicle hardware devices and adaptation software packages. This avoids the problem that the existing testing and verification work of in-vehicle map navigation application is easily affected by uncontrollable factors due to reliance on in-vehicle hardware devices and adaptation software packages, resulting in the inability to achieve efficient and stable testing and verification.
[0101] Corresponding to the screen output testing method provided in the first embodiment of this application, the fifth embodiment of this application also provides a computer program product. Since the fifth embodiment is basically similar to the screen output testing method provided in the first embodiment of this application, it is described simply; relevant details can be found in the description of the first embodiment. The computer program product embodiments described below are merely illustrative.
[0102] The computer program product includes a computer program / instruction, wherein when the computer program / instruction is executed by a processor, it implements the steps of the screen output testing method provided in the first embodiment described above.
[0103] For a detailed description of the computer program product provided in the fifth embodiment of this application, please refer to the relevant description of the screen output test method provided in the first embodiment of this application, which will not be repeated here.
[0104] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0105] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0106] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0107] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
Claims
1. A screen output testing method, wherein, include: The system acquires configuration information for a screen under test, which is a predetermined output screen for target data. The screen under test includes a target in-vehicle screen and a target in-vehicle extended screen. There are multiple target in-vehicle screens. The target data includes map navigation data for output on the target in-vehicle screen. The map navigation data includes map navigation display data, or map navigation display data and navigation voice data. The configuration information is a configuration file generated based on the configuration requirements when the screen under test outputs the target data. The configuration information includes one or more of the following: the number of screens under test, the size of the screens under test, the functional attributes of the screens under test, the output mode of the screens under test, and the personalized output content of the screens under test. The number of screens under test is the number of in-vehicle screens preset by the car manufacturer for collaboratively outputting map navigation data. Based on the configuration information, a virtual output device and a virtual recording device adapted to the screen under test are obtained. The virtual output device is a virtual screen consistent with the configuration information of the screen under test. The virtual output device is used to simulate the output of predetermined target data that needs to be output through the screen under test. Based on the virtual output device, output test data characterizing the output effect of the target data on the screen under test is output, including: instructing the in-vehicle map navigation application to draw map navigation display data based on the virtual output device, and interacting with the in-vehicle map navigation application using a preset protocol, so that the in-vehicle map navigation application executes test cases corresponding to the preset protocol simultaneously when drawing map navigation display data, so that the finally drawn data is output test data that has executed the test cases; the output test data includes: virtual video data obtained after executing test cases for the simulated display process of the map navigation display data corresponding to the target in-vehicle screen; or virtual audio and video data obtained after executing test cases for the simulated output process of the map navigation display data and the navigation voice data corresponding to the target in-vehicle screen; The output test data is recorded using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test.
2. The method according to claim 1, wherein, The step of obtaining a virtual output device and a virtual recording device adapted to the screen under test based on the configuration information includes: Invoke the media projection management instance, and obtain the media projection instance through the media projection management instance; Create a media recording instance and configure the media recording instance as a virtual recording device adapted to the screen under test according to the configuration information; A virtual screen instance is created based on the media projection instance, and the virtual screen instance is configured as a virtual output device adapted to the screen under test according to the configuration information. The rendering carrier instance created in the media recording instance is obtained through the media projection instance, and the rendering carrier instance is configured in the virtual screen instance.
3. The method according to claim 2, wherein, The step of outputting test data, which characterizes the output effect of the target data on the screen under test based on the virtual output device, includes: The output test data is drawn based on the rendering carrier instance configured in the virtual screen instance.
4. The method according to claim 3, wherein, The step of recording the output test data using the virtual recording device includes: recording the output test data drawn on the rendering carrier instance by the media recording instance.
5. The method according to claim 1, wherein, The configuration information for the screen under test includes: A configuration file generated based on the configuration requirements of the target vehicle screen when outputting the map navigation data; The output test data includes: virtual multimedia data obtained after executing test cases for the simulated output process of the map navigation data corresponding to the target vehicle screen.
6. The method according to claim 1, wherein, The verification of the output effect of the target data corresponding to the screen under test includes: The effect of the target data output on the screen under test is verified based on the real-time presented test data stream; or, The effect of outputting the target data on the screen under test is verified based on the replayed test data stream.
7. A screen output testing device, wherein, include: A configuration information acquisition unit is used to acquire configuration information for a screen under test. The screen under test is a predetermined output screen for target data. The screen under test includes a target vehicle screen and a target vehicle extended screen. There are multiple target vehicle screens. The target data includes map navigation data for output on the target vehicle screen. The map navigation data includes map navigation display data, or map navigation display data and navigation voice data. The configuration information is a configuration file generated based on the configuration requirements when the screen under test outputs the target data. The configuration information includes one or more of the following: the number of screens under test, the size of the screens under test, the functional attributes of the screens under test, the output mode of the screens under test, and the personalized output content of the screens under test. The number of screens under test is the number of vehicle screens preset by the car manufacturer for collaborative output of map navigation data. A virtual device acquisition unit is used to acquire, based on the configuration information, a virtual output device and a virtual recording device adapted to the screen under test. The virtual output device is a virtual screen consistent with the configuration information of the screen under test. The virtual output device is used to simulate the output of predetermined target data that needs to be output through the screen under test. The output test data output unit is used to output output test data characterizing the output effect of the target data on the screen under test based on the virtual output device. This includes instructing the in-vehicle map navigation application to draw map navigation display data based on the virtual output device and interacting with the in-vehicle map navigation application using a preset protocol. This allows the in-vehicle map navigation application to synchronously execute test cases corresponding to the preset protocol while drawing the map navigation display data, so that the final drawn data is output test data with the test cases executed. The output test data includes: virtual video data obtained after executing test cases for the simulated display process of the map navigation display data corresponding to the target in-vehicle screen; or virtual audio and video data obtained after executing test cases for the simulated output process of the map navigation display data and the navigation voice data corresponding to the target in-vehicle screen. The test data stream acquisition unit is used to record the output test data using the virtual recording device to obtain a test data stream for verifying the output effect of the target data corresponding to the screen under test.
8. A computer program product comprising a computer program / instructions, wherein, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Equipment simulation method and device, electronic equipment and storage medium
CN110618944A
Screen recording method and device of multi-screen electronic equipment, multi-screen electronic equipment and storage medium
CN111338536A
Evaluation method, device and equipment for data updating and storage medium
CN112486817A