1#[allow(
2 non_snake_case,
3 non_upper_case_globals,
4 non_camel_case_types,
5 dead_code,
6 clippy::all
7)]
8pub mod Microsoft {
9 pub mod Web {
10 pub mod WebView2 {
11 pub mod Win32 {
12 mod windows_core {
13 macro_rules! link_webview2 {
14 ($library:literal $abi:literal fn $($function:tt)*) => (
15 #[cfg_attr(
16 target_env = "msvc",
17 link(name = "WebView2LoaderStatic", kind = "static")
18 )]
19 #[cfg_attr(
20 not(target_env = "msvc"),
21 link(name = "WebView2Loader.dll")
22 )]
23 extern $abi {
24 pub fn $($function)*;
25 }
26 )
27 }
28
29 pub(crate) use ::windows_core::*;
30 pub(crate) use link_webview2 as link;
31 }
32
33 include!("bindings.rs");
34 }
35 }
36 }
37}
38
39pub mod declared_interfaces;
40
41#[cfg(test)]
42mod test {
43 use windows_core::w;
44
45 use crate::Microsoft::Web::WebView2::Win32::*;
46
47 #[test]
48 fn compare_eq() {
49 let mut result = 1;
50 unsafe { CompareBrowserVersions(w!("1.0.0"), w!("1.0.0"), &mut result) }.unwrap();
51 assert_eq!(0, result);
52 }
53
54 #[test]
55 fn compare_lt() {
56 let mut result = 0;
57 unsafe { CompareBrowserVersions(w!("1.0.0"), w!("1.0.1"), &mut result) }.unwrap();
58 assert_eq!(-1, result);
59 }
60
61 #[test]
62 fn compare_gt() {
63 let mut result = 0;
64 unsafe { CompareBrowserVersions(w!("2.0.0"), w!("1.0.1"), &mut result) }.unwrap();
65 assert_eq!(1, result);
66 }
67}