diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-10-05 19:47:39 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-11-03 15:38:18 +0000 |
commit | f4d3af296c05260dfbb3deea4f8fa400cb6887d3 (patch) | |
tree | 169db2cc68e01a755b30500dd525f1a2ec2da861 /components/net_traits/tests/image.rs | |
parent | 863529d9622c68f0a9535225237eb5e5c5b8c757 (diff) | |
download | servo-f4d3af296c05260dfbb3deea4f8fa400cb6887d3.tar.gz servo-f4d3af296c05260dfbb3deea4f8fa400cb6887d3.zip |
Move `*_traits` and other shared types to `shared`
This is the start of the organization of types that are in their own
crates in order to break dependency cycles between other crates. The
idea here is that putting these packages into their own directory is the
first step toward cleaning them up. They have grown organically and it
is difficult to explain to new folks where to put new shared types. Many
of these crates contain more than traits or don't contain traits at all.
Notably, `script_traits` isn't touched because it is vendored from
Gecko. Eventually this will move to `third_party`.
Diffstat (limited to 'components/net_traits/tests/image.rs')
-rw-r--r-- | components/net_traits/tests/image.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/components/net_traits/tests/image.rs b/components/net_traits/tests/image.rs deleted file mode 100644 index a4963702b57..00000000000 --- a/components/net_traits/tests/image.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* 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/. */ - -use net_traits::image::base::detect_image_format; - -#[test] -fn test_supported_images() { - let gif1 = [b'G', b'I', b'F', b'8', b'7', b'a']; - let gif2 = [b'G', b'I', b'F', b'8', b'9', b'a']; - let jpeg = [0xff, 0xd8, 0xff]; - let png = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]; - let webp = [ - b'R', b'I', b'F', b'F', 0x01, 0x02, 0x03, 0x04, b'W', b'E', b'B', b'P', b'V', b'P', - ]; - let bmp = [0x42, 0x4D]; - let ico = [0x00, 0x00, 0x01, 0x00]; - let junk_format = [0x01, 0x02, 0x03, 0x04, 0x05]; - - assert!(detect_image_format(&gif1).is_ok()); - assert!(detect_image_format(&gif2).is_ok()); - assert!(detect_image_format(&jpeg).is_ok()); - assert!(detect_image_format(&png).is_ok()); - assert!(detect_image_format(&webp).is_ok()); - assert!(detect_image_format(&bmp).is_ok()); - assert!(detect_image_format(&ico).is_ok()); - assert!(detect_image_format(&junk_format).is_err()); -} |