aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo/tests/servo.rs
blob: 6333b0af50ae1a9ed99b1becdb68bfd6f1d19d85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

//! Servo API unit tests.
//!
//! Since all Servo tests must run serially on the same thread, it is important
//! that tests never panic. In order to ensure this, use `anyhow::ensure!` instead
//! of `assert!` for test assertions. `ensure!` will produce a `Result::Err` in
//! place of panicking.

mod common;

use anyhow::ensure;
use common::{ServoTest, run_api_tests};

fn test_simple_servo_is_not_animating_by_default(
    servo_test: &ServoTest,
) -> Result<(), anyhow::Error> {
    ensure!(!servo_test.servo().animating());
    Ok(())
}

fn main() {
    run_api_tests!(test_simple_servo_is_not_animating_by_default);
}