it: test dnd focus change on drop
This commit is contained in:
parent
a39031d4f9
commit
c6b34550d8
16 changed files with 421 additions and 9 deletions
57
src/it/test_ifs/test_data_offer.rs
Normal file
57
src/it/test_ifs/test_data_offer.rs
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
use {
|
||||
crate::{
|
||||
it::{
|
||||
test_error::TestResult, test_object::TestObject, test_transport::TestTransport,
|
||||
testrun::ParseFull,
|
||||
},
|
||||
utils::buffd::MsgParser,
|
||||
wire::{wl_data_offer::*, WlDataOfferId},
|
||||
},
|
||||
std::{cell::Cell, rc::Rc},
|
||||
};
|
||||
|
||||
pub struct TestDataOffer {
|
||||
pub id: WlDataOfferId,
|
||||
pub tran: Rc<TestTransport>,
|
||||
pub destroyed: Cell<bool>,
|
||||
}
|
||||
|
||||
impl TestDataOffer {
|
||||
pub fn destroy(&self) -> TestResult {
|
||||
if !self.destroyed.replace(true) {
|
||||
self.tran.send(Destroy { self_id: self.id })?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_offer(&self, parser: MsgParser<'_, '_>) -> TestResult {
|
||||
let _ev = Offer::parse_full(parser)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_source_actions(&self, parser: MsgParser<'_, '_>) -> TestResult {
|
||||
let _ev = SourceActions::parse_full(parser)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_action(&self, parser: MsgParser<'_, '_>) -> TestResult {
|
||||
let _ev = Action::parse_full(parser)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for TestDataOffer {
|
||||
fn drop(&mut self) {
|
||||
let _ = self.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
test_object! {
|
||||
TestDataOffer, WlDataOffer;
|
||||
|
||||
OFFER => handle_offer,
|
||||
SOURCE_ACTIONS => handle_source_actions,
|
||||
ACTION => handle_action,
|
||||
}
|
||||
|
||||
impl TestObject for TestDataOffer {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue