diff options
author | Avi Weinstock <aweinstock314@gmail.com> | 2015-05-06 15:30:29 -0400 |
---|---|---|
committer | Avi Weinstock <aweinstock314@gmail.com> | 2015-05-06 15:30:29 -0400 |
commit | d054946f7d3bf9834a91cdf4ffa9de6f10099ccf (patch) | |
tree | 16808c50b8271551266a65d2a9ed3715614e0a96 /tests/unit/script/textinput.rs | |
parent | 05877179447cfd4b33e7b8e17b7e8e5082d89cd8 (diff) | |
download | servo-d054946f7d3bf9834a91cdf4ffa9de6f10099ccf.tar.gz servo-d054946f7d3bf9834a91cdf4ffa9de6f10099ccf.zip |
Fix test_clipboard_paste to pass on Mac OS.
Diffstat (limited to 'tests/unit/script/textinput.rs')
-rw-r--r-- | tests/unit/script/textinput.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs index c5ede5262d1..653507983a2 100644 --- a/tests/unit/script/textinput.rs +++ b/tests/unit/script/textinput.rs @@ -7,7 +7,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use msg::constellation_msg::{Key, CONTROL}; +use msg::constellation_msg::{Key, KeyModifiers}; + +#[cfg(target_os="macos")] +use msg::constellation_msg::SUPER; +#[cfg(not(target_os="macos"))] +use msg::constellation_msg::CONTROL; + use script::textinput::{TextInput, Selection, Lines, DeleteDir}; use script::clipboard_provider::DummyClipboardContext; use std::borrow::ToOwned; @@ -169,9 +175,14 @@ fn test_textinput_set_content() { #[test] fn test_clipboard_paste() { + #[cfg(target_os="macos")] + const MODIFIERS: KeyModifiers = SUPER; + #[cfg(not(target_os="macos"))] + const MODIFIERS: KeyModifiers = CONTROL; + let mut textinput = TextInput::new(Lines::Single, "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, CONTROL); + textinput.handle_keydown_aux(Key::V, MODIFIERS); assert_eq!(textinput.get_content(), "abcdefg"); } |