diff options
Diffstat (limited to 'tests/unit/script/textinput.rs')
-rw-r--r-- | tests/unit/script/textinput.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs index c252d8c8f74..da7555f7775 100644 --- a/tests/unit/script/textinput.rs +++ b/tests/unit/script/textinput.rs @@ -15,9 +15,10 @@ use msg::constellation_msg::{Key, KeyModifiers}; use script::clipboard_provider::DummyClipboardContext; use script::textinput::{TextInput, Selection, Lines, Direction}; use std::borrow::ToOwned; +use util::str::DOMString; fn text_input(lines: Lines, s: &str) -> TextInput<DummyClipboardContext> { - TextInput::new(lines, s.to_owned(), DummyClipboardContext::new("")) + TextInput::new(lines, DOMString(s.to_owned()), DummyClipboardContext::new("")) } #[test] @@ -85,7 +86,7 @@ fn test_textinput_replace_selection() { textinput.adjust_horizontal(2, Selection::NotSelected); textinput.adjust_horizontal(2, Selection::Selected); - textinput.replace_selection("xyz".to_owned()); + textinput.replace_selection(DOMString("xyz".to_owned())); assert_eq!(textinput.get_content(), "abxyzefg"); } @@ -176,7 +177,7 @@ fn test_textinput_set_content() { let mut textinput = text_input(Lines::Multiple, "abc\nde\nf"); assert_eq!(textinput.get_content(), "abc\nde\nf"); - textinput.set_content("abc\nf".to_owned()); + textinput.set_content(DOMString("abc\nf".to_owned())); assert_eq!(textinput.get_content(), "abc\nf"); assert_eq!(textinput.edit_point.line, 0); @@ -184,7 +185,7 @@ fn test_textinput_set_content() { textinput.adjust_horizontal(3, Selection::Selected); assert_eq!(textinput.edit_point.line, 0); assert_eq!(textinput.edit_point.index, 3); - textinput.set_content("de".to_owned()); + textinput.set_content(DOMString("de".to_owned())); assert_eq!(textinput.get_content(), "de"); assert_eq!(textinput.edit_point.line, 0); assert_eq!(textinput.edit_point.index, 2); @@ -197,7 +198,9 @@ fn test_clipboard_paste() { #[cfg(not(target_os = "macos"))] const MODIFIERS: KeyModifiers = CONTROL; - let mut textinput = TextInput::new(Lines::Single, "defg".to_owned(), DummyClipboardContext::new("abc")); + let mut textinput = TextInput::new(Lines::Single, + DOMString("defg".to_owned()), + DummyClipboardContext::new("abc")); assert_eq!(textinput.get_content(), "defg"); assert_eq!(textinput.edit_point.index, 0); textinput.handle_keydown_aux(Key::V, MODIFIERS); |