Merge branch 'main' into rpc

This commit is contained in:
Antonio Scandurra
2021-06-29 10:25:42 +02:00
18 changed files with 531 additions and 282 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ tree-sitter = "0.19"
usvg = "0.14"
[build-dependencies]
bindgen = "0.57"
bindgen = "0.58.1"
cc = "1.0.67"
[dev-dependencies]
+3 -3
View File
@@ -17,8 +17,8 @@ fn generate_dispatch_bindings() {
let bindings = bindgen::Builder::default()
.header("src/platform/mac/dispatch.h")
.whitelist_var("_dispatch_main_q")
.whitelist_function("dispatch_async_f")
.allowlist_var("_dispatch_main_q")
.allowlist_function("dispatch_async_f")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.layout_tests(false)
.generate()
@@ -95,7 +95,7 @@ fn compile_metal_shaders() {
fn generate_shader_bindings() {
let bindings = bindgen::Builder::default()
.header(SHADER_HEADER_PATH)
.whitelist_type("GPUI.*")
.allowlist_type("GPUI.*")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.layout_tests(false)
.generate()
+4
View File
@@ -279,6 +279,10 @@ impl TestAppContext {
);
}
pub fn dispatch_global_action<T: 'static + Any>(&self, name: &str, arg: T) {
self.cx.borrow_mut().dispatch_global_action(name, arg);
}
pub fn dispatch_keystroke(
&self,
window_id: usize,
+13 -7
View File
@@ -311,17 +311,24 @@ impl FontSystemState {
#[cfg(test)]
mod tests {
use crate::MutableAppContext;
use super::*;
use font_kit::properties::{Style, Weight};
use platform::FontSystem as _;
#[test]
fn test_layout_str() -> anyhow::Result<()> {
#[crate::test(self, retries = 5)]
fn test_layout_str(_: &mut MutableAppContext) {
// This is failing intermittently on CI and we don't have time to figure it out
let fonts = FontSystem::new();
let menlo = fonts.load_family("Menlo")?;
let menlo_regular = fonts.select_font(&menlo, &Properties::new())?;
let menlo_italic = fonts.select_font(&menlo, &Properties::new().style(Style::Italic))?;
let menlo_bold = fonts.select_font(&menlo, &Properties::new().weight(Weight::BOLD))?;
let menlo = fonts.load_family("Menlo").unwrap();
let menlo_regular = fonts.select_font(&menlo, &Properties::new()).unwrap();
let menlo_italic = fonts
.select_font(&menlo, &Properties::new().style(Style::Italic))
.unwrap();
let menlo_bold = fonts
.select_font(&menlo, &Properties::new().weight(Weight::BOLD))
.unwrap();
assert_ne!(menlo_regular, menlo_italic);
assert_ne!(menlo_regular, menlo_bold);
assert_ne!(menlo_italic, menlo_bold);
@@ -342,7 +349,6 @@ mod tests {
assert_eq!(line.runs[1].glyphs.len(), 4);
assert_eq!(line.runs[2].font_id, menlo_regular);
assert_eq!(line.runs[2].glyphs.len(), 5);
Ok(())
}
#[test]