Auto merge of #19819 - servo:rm-test-crates, r=<try>

(Do not merge) Merge some test crates in their corresponding components

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19819)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-01-20 08:51:27 -06:00 committed by GitHub
commit a4808a3649
155 changed files with 107 additions and 277 deletions

71
Cargo.lock generated
View file

@ -1043,16 +1043,6 @@ dependencies = [
"xml5ever 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gfx_tests"
version = "0.0.1"
dependencies = [
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1",
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1",
]
[[package]]
name = "gfx_traits"
version = "0.0.1"
@ -1435,6 +1425,7 @@ dependencies = [
"servo_config 0.0.1",
"servo_geometry 0.0.1",
"servo_url 0.0.1",
"size_of_test 0.0.1",
"smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1",
"style_traits 0.0.1",
@ -1443,14 +1434,6 @@ dependencies = [
"webrender_api 0.56.1 (git+https://github.com/servo/webrender)",
]
[[package]]
name = "layout_tests"
version = "0.0.1"
dependencies = [
"layout 0.0.1",
"size_of_test 0.0.1",
]
[[package]]
name = "layout_thread"
version = "0.0.1"
@ -1839,15 +1822,8 @@ dependencies = [
"malloc_size_of_derive 0.0.1",
"nonzero 0.0.1",
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender_api 0.56.1 (git+https://github.com/servo/webrender)",
]
[[package]]
name = "msg_tests"
version = "0.0.1"
dependencies = [
"msg 0.0.1",
"size_of_test 0.0.1",
"webrender_api 0.56.1 (git+https://github.com/servo/webrender)",
]
[[package]]
@ -1899,28 +1875,6 @@ dependencies = [
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "net_tests"
version = "0.0.1"
dependencies = [
"cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1",
"flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper-openssl 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net 0.0.1",
"net_traits 0.0.1",
"profile_traits 0.0.1",
"servo_config 0.0.1",
"servo_url 0.0.1",
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "net_traits"
version = "0.0.1"
@ -1944,13 +1898,6 @@ dependencies = [
"webrender_api 0.56.1 (git+https://github.com/servo/webrender)",
]
[[package]]
name = "net_traits_tests"
version = "0.0.1"
dependencies = [
"net_traits 0.0.1",
]
[[package]]
name = "nodrop"
version = "0.1.12"
@ -2836,13 +2783,6 @@ dependencies = [
"xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "servo_config_tests"
version = "0.0.1"
dependencies = [
"servo_config 0.0.1",
]
[[package]]
name = "servo_geometry"
version = "0.0.1"
@ -2872,13 +2812,6 @@ dependencies = [
"nonzero 0.0.1",
]
[[package]]
name = "servo_remutex_tests"
version = "0.0.1"
dependencies = [
"servo_remutex 0.0.1",
]
[[package]]
name = "servo_url"
version = "0.0.1"

View file

@ -8,6 +8,8 @@ publish = false
[lib]
name = "servo_config"
path = "lib.rs"
test = false
doctest = false
[dependencies]
euclid = "0.16"

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
extern crate servo_config;
use servo_config::opts::{parse_url_or_filename, parse_pref_from_command_line};
use servo_config::prefs::{PrefValue, PREFS};
use std::path::Path;

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
extern crate servo_config;
use servo_config::basedir;
use servo_config::prefs::{PREFS, PrefValue, read_prefs_from_file};
use std::fs::{self, File};

View file

@ -9,6 +9,8 @@ publish = false
[lib]
name = "gfx"
path = "lib.rs"
test = false
doctest = false
[features]
unstable = ["simd"]

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
extern crate gfx;
use gfx::text::util::{CompressionMode, transform_text};
#[test]

View file

@ -392,7 +392,7 @@ impl<'a> GlyphInfo<'a> {
/// Simple glyphs are stored inline in the `entry_buffer`, detailed glyphs are
/// stored as pointers into the `detail_store`.
///
/// ~~~ignore
/// ~~~ascii
/// +- GlyphStore --------------------------------+
/// | +---+---+---+---+---+---+---+ |
/// | entry_buffer: | | s | | s | | s | s | | d = detailed

View file

@ -8,6 +8,8 @@ publish = false
[lib]
name = "layout"
path = "lib.rs"
test = false
doctest = false
[dependencies]
app_units = "0.6.1"
@ -46,3 +48,6 @@ style_traits = {path = "../style_traits"}
unicode-bidi = {version = "0.3", features = ["with_serde"]}
unicode-script = {version = "0.1", features = ["harfbuzz"]}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
[dev-dependencies]
size_of_test = {path = "../size_of_test"}

View file

@ -140,22 +140,22 @@ pub struct InlineFragmentsConstructionResult {
///
/// The resulting `ConstructionItem` for the outer `span` will be:
///
/// ```ignore
/// ```rust,ignore
/// ConstructionItem::InlineFragments(
/// InlineFragmentsConstructionResult{
/// InlineFragmentsConstructionResult {
/// splits: linked_list![
/// InlineBlockSplit{
/// predecessors: IntermediateInlineFragments{
/// InlineBlockSplit {
/// predecessors: IntermediateInlineFragments {
/// fragments: linked_list![A],
/// absolute_descendents: AbsoluteDescendents{
/// absolute_descendents: AbsoluteDescendents {
/// descendant_links: vec![]
/// }
/// },
/// flow: B
/// },
/// flow: B,
/// }
/// ],
/// fragments: linked_list![C],
/// }
/// },
/// )
/// ```
#[derive(Clone)]

View file

@ -552,11 +552,13 @@ pub trait MutableOwnedFlowUtils {
/// Sets the flow as the containing block for all absolute descendants that have been marked
/// as having reached their containing block. This is needed in order to handle cases like:
///
/// ```html
/// <div>
/// <span style="position: relative">
/// <span style="position: absolute; ..."></span>
/// </span>
/// </div>
/// ```
fn take_applicable_absolute_descendants(&mut self,
absolute_descendants: &mut AbsoluteDescendants);
}
@ -742,12 +744,14 @@ pub struct AbsoluteDescendantInfo {
/// Whether the absolute descendant has reached its containing block. This exists so that we
/// can handle cases like the following:
///
/// ```html
/// <div>
/// <span id=a style="position: absolute; ...">foo</span>
/// <span style="position: relative">
/// <span id=b style="position: absolute; ...">bar</span>
/// </span>
/// </div>
/// ```
///
/// When we go to create the `InlineFlow` for the outer `div`, our absolute descendants will
/// be `a` and `b`. At this point, we need a way to distinguish between the two, because the
@ -1343,11 +1347,13 @@ impl MutableOwnedFlowUtils for FlowRef {
/// Sets the flow as the containing block for all absolute descendants that have been marked
/// as having reached their containing block. This is needed in order to handle cases like:
///
/// ```html
/// <div>
/// <span style="position: relative">
/// <span style="position: absolute; ..."></span>
/// </span>
/// </div>
/// ```
fn take_applicable_absolute_descendants(&mut self,
absolute_descendants: &mut AbsoluteDescendants) {
let mut applicable_absolute_descendants = AbsoluteDescendants::new();

View file

@ -2,6 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![cfg(target_pointer_width = "64")]
extern crate layout;
#[macro_use] extern crate size_of_test;
use layout::Fragment;
use layout::SpecificFragmentInfo;

View file

@ -8,6 +8,8 @@ publish = false
[lib]
name = "msg"
path = "lib.rs"
test = false
doctest = false
[features]
unstable = ["nonzero/unstable"]
@ -19,3 +21,6 @@ malloc_size_of_derive = { path = "../malloc_size_of_derive" }
nonzero = {path = "../nonzero"}
serde = "1.0.14"
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
[dev-dependencies]
size_of_test = {path = "../size_of_test"}

View file

@ -2,6 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![cfg(target_pointer_width = "64")]
extern crate msg;
#[macro_use] extern crate size_of_test;
use msg::constellation_msg::BrowsingContextId;
use msg::constellation_msg::PipelineId;
use msg::constellation_msg::TopLevelBrowsingContextId;

View file

@ -8,6 +8,8 @@ publish = false
[lib]
name = "net"
path = "lib.rs"
test = false
doctest = false
[dependencies]
base64 = "0.6"
@ -43,3 +45,7 @@ webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
[target.'cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))'.dependencies]
tinyfiledialogs = "2.5.9"
[[test]]
name = "main"
path = "tests/main.rs"

View file

@ -8,7 +8,7 @@ use url::Url;
#[test]
fn load_htm() {
let mut path = env::current_dir().expect("didn't get working dir");
path.push("test.jpeg");
path.push("tests/test.jpeg");
let canon_path = path.canonicalize().expect("file path doesn't exist");
let url = Url::from_file_path(canon_path);

View file

@ -16,11 +16,11 @@ pub struct TestProvider;
impl UIProvider for TestProvider {
fn open_file_dialog(&self, _path: &str, _patterns: Vec<FilterPattern>) -> Option<String> {
Some("test.jpeg".to_string())
Some("tests/test.jpeg".to_string())
}
fn open_file_dialog_multi(&self, _path: &str, _patterns: Vec<FilterPattern>) -> Option<Vec<String>> {
Some(vec!["test.jpeg".to_string()])
Some(vec!["tests/test.jpeg".to_string()])
}
}
@ -28,18 +28,18 @@ impl UIProvider for TestProvider {
fn test_filemanager() {
let filemanager = FileManager::new();
// Try to open a dummy file "tests/unit/net/test.jpeg" in tree
let mut handler = File::open("test.jpeg").expect("test.jpeg is stolen");
// Try to open a dummy file "components/net/tests/test.jpeg" in tree
let mut handler = File::open("tests/test.jpeg").expect("test.jpeg is stolen");
let mut test_file_content = vec![];
handler.read_to_end(&mut test_file_content)
.expect("Read tests/unit/net/test.jpeg error");
.expect("Read components/net/tests/test.jpeg error");
let patterns = vec![FilterPattern(".txt".to_string())];
let origin = "test.com".to_string();
{
// Try to select a dummy file "tests/unit/net/test.jpeg"
// Try to select a dummy file "components/net/tests/test.jpeg"
let (tx, rx) = ipc::channel().unwrap();
filemanager.handle(FileManagerThreadMsg::SelectFile(patterns.clone(), tx, origin.clone(), None),
TEST_PROVIDER);

View file

@ -23,7 +23,7 @@ fn read_file(path: &path::Path) -> io::Result<Vec<u8>> {
fn test_sniff_mp4_matcher() {
let matcher = Mp4Matcher;
let p = PathBuf::from("parsable_mime/video/mp4/test.mp4");
let p = PathBuf::from("tests/parsable_mime/video/mp4/test.mp4");
let read_result = read_file(&p);
match read_result {
@ -66,7 +66,7 @@ fn test_sniff_with_flags(filename_orig: &path::Path,
let current_working_directory = env::current_dir().unwrap();
println!("The current directory is {}", current_working_directory.display());
let mut filename = PathBuf::from("parsable_mime/");
let mut filename = PathBuf::from("tests/parsable_mime/");
filename.push(filename_orig);
let classifier = MimeClassifier::new();

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 14 B

After

Width:  |  Height:  |  Size: 14 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more