1 | // Copyright 2013 The Flutter Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_TEST_H_ |
6 | #define FLUTTER_SHELL_PLATFORM_LINUX_FL_TEST_H_ |
7 | |
8 | #include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h" |
9 | #include "flutter/shell/platform/linux/public/flutter_linux/fl_value.h" |
10 | |
11 | #include <glib.h> |
12 | #include <stdint.h> |
13 | #include <ostream> |
14 | |
15 | G_BEGIN_DECLS |
16 | |
17 | // Helper functions for the tests. This is not included in the shell library. |
18 | |
19 | // Helper function to convert a hexadecimal string (e.g. "01feab") into GBytes |
20 | GBytes* hex_string_to_bytes(const gchar* hex_string); |
21 | |
22 | // Helper function to convert GBytes into a hexadecimal string (e.g. "01feab") |
23 | gchar* bytes_to_hex_string(GBytes* bytes); |
24 | |
25 | // Creates a mock engine that responds to platform messages. |
26 | FlEngine* make_mock_engine(); |
27 | |
28 | // Creates a mock engine using a specified FlDartProject that responds to |
29 | // platform messages. |
30 | FlEngine* make_mock_engine_with_project(FlDartProject* project); |
31 | |
32 | // GTest printer for FlValue. |
33 | void PrintTo(FlValue* v, std::ostream* os); |
34 | |
35 | G_END_DECLS |
36 | |
37 | #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_TEST_H_ |
38 | |