One proxy, and a macro instead of a shared test module
`Proxy` is the task queue as well as the way an application sends its own events, so `ProxyQueue` is gone. `schedule_redraw` becomes `request_redraw_if_needed`, which says what the comment beside it was saying. `assert_corners!` replaces the region helper, so `tests/common` goes with it, and the scroll test now states both corners rather than one number.
This commit is contained in:
1 parent
3a74a04a5b
commit
7eb2b85425
5 files changed
+33
-37
No files matched your search
+4
-7
@@ -1,9 +1,6 @@
|
||||
//! Scrolling moves content and stops at its ends.
|
||||
|
||||
mod common;
|
||||
|
||||
use common::corners;
|
||||
use iris::harness::Harness;
|
||||
use iris::harness::{Harness, assert_corners};
|
||||
use iris::prelude::*;
|
||||
|
||||
#[test]
|
||||
@@ -16,14 +13,14 @@ fn a_wheel_scrolls_the_content_and_stops_at_its_end() {
|
||||
h.move_to((200, 100));
|
||||
|
||||
// `Scroll` starts snapped to the end.
|
||||
assert_eq!(corners(&h, &top).1, -200.0);
|
||||
assert_corners!(h, top, (0, -200), (400, 0));
|
||||
|
||||
// The handler scales a wheel line by 50.
|
||||
h.scroll((0, 1));
|
||||
h.frame();
|
||||
assert_eq!(corners(&h, &top).1, -150.0);
|
||||
assert_corners!(h, top, (0, -150), (400, 50));
|
||||
|
||||
h.scroll((0, 10));
|
||||
h.frame();
|
||||
assert_eq!(corners(&h, &top).1, 0.0);
|
||||
assert_corners!(h, top, (0, 0), (400, 200));
|
||||
}
|
||||
Reference in new issue
Block a user