mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix test build
This commit is contained in:
parent
945058adc0
commit
2a0761732e
5 changed files with 17 additions and 16 deletions
|
@ -62,8 +62,9 @@ fn parse_display_type(str : ~str) -> Option<DisplayType> {
|
|||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
import css_lexer::spawn_css_lexer_from_string;
|
||||
import css_builder::build_stylesheet;
|
||||
import css::lexer::spawn_css_lexer_from_string;
|
||||
import css::parser::build_stylesheet;
|
||||
import css::values::{Stylesheet, Element, FontSize, Width, Height};
|
||||
|
||||
#[test]
|
||||
fn should_match_font_sizes() {
|
||||
|
|
|
@ -161,7 +161,7 @@ mod test {
|
|||
#[allow(non_implicitly_copyable_typarams)]
|
||||
fn new_node(scope: NodeScope, -name: ~str) -> Node {
|
||||
let elmt = ElementData(name, ~HTMLDivElement);
|
||||
return scope.new_node(base::Element(elmt));
|
||||
return scope.new_node(dom::base::Element(elmt));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -187,14 +187,14 @@ mod test {
|
|||
do g2.aux |aux| { aux.specified_style.height = Some(Px(10.0)); }
|
||||
|
||||
let parent_box = parent.construct_boxes();
|
||||
let child_box = parent_box.tree.first_child.get();
|
||||
let child2_box = parent_box.tree.last_child.get();
|
||||
let child_box = parent_box.get().tree.first_child.get();
|
||||
let child2_box = parent_box.get().tree.last_child.get();
|
||||
let g1_box = child_box.tree.first_child.get();
|
||||
let g2_box = child_box.tree.last_child.get();
|
||||
|
||||
top_down_traversal(parent_box, inhereit_height);
|
||||
top_down_traversal(parent_box.get(), inhereit_height);
|
||||
|
||||
assert parent_box.appearance.height == Px(100.0);
|
||||
assert parent_box.get().appearance.height == Px(100.0);
|
||||
assert child_box.appearance.height == Auto;
|
||||
assert child2_box.appearance.height == Px(50.0);
|
||||
assert g1_box.appearance.height == Auto;
|
||||
|
|
|
@ -367,10 +367,10 @@ mod test {
|
|||
tree::add_child(s, n3, n1);
|
||||
tree::add_child(s, n3, n2);
|
||||
|
||||
let b0 = n0.construct_boxes();
|
||||
let b1 = n1.construct_boxes();
|
||||
let b2 = n2.construct_boxes();
|
||||
let b3 = n3.construct_boxes();
|
||||
let b0 = n0.construct_boxes().get();
|
||||
let b1 = n1.construct_boxes().get();
|
||||
let b2 = n2.construct_boxes().get();
|
||||
let b3 = n3.construct_boxes().get();
|
||||
|
||||
tree::add_child(BTree, b3, b0);
|
||||
tree::add_child(BTree, b3, b1);
|
||||
|
|
|
@ -111,7 +111,7 @@ fn should_convert_text_boxes_to_solid_color_background_items() {
|
|||
|
||||
let s = Scope();
|
||||
let n = s.new_node(Text(~"firecracker"));
|
||||
let b = n.construct_boxes();
|
||||
let b = n.construct_boxes().get();
|
||||
|
||||
let subbox = match b.kind {
|
||||
TextBoxKind(subbox) => subbox,
|
||||
|
@ -134,7 +134,7 @@ fn should_convert_text_boxes_to_text_items() {
|
|||
|
||||
let s = Scope();
|
||||
let n = s.new_node(Text(~"firecracker"));
|
||||
let b = n.construct_boxes();
|
||||
let b = n.construct_boxes().get();
|
||||
|
||||
let subbox = match b.kind {
|
||||
TextBoxKind(subbox) => { subbox },
|
||||
|
@ -157,7 +157,7 @@ fn should_calculate_the_bounds_of_the_text_box_background_color() {
|
|||
|
||||
let s = Scope();
|
||||
let n = s.new_node(Text(~"firecracker"));
|
||||
let b = n.construct_boxes();
|
||||
let b = n.construct_boxes().get();
|
||||
|
||||
let subbox = match b.kind {
|
||||
TextBoxKind(subbox) => { subbox },
|
||||
|
@ -182,7 +182,7 @@ fn should_calculate_the_bounds_of_the_text_items() {
|
|||
|
||||
let s = Scope();
|
||||
let n = s.new_node(Text(~"firecracker"));
|
||||
let b = n.construct_boxes();
|
||||
let b = n.construct_boxes().get();
|
||||
|
||||
let subbox = match b.kind {
|
||||
TextBoxKind(subbox) => { subbox },
|
||||
|
|
|
@ -48,7 +48,7 @@ fn should_calculate_the_size_of_the_text_box() {
|
|||
|
||||
let s = Scope();
|
||||
let n = s.new_node(Text(~"firecracker"));
|
||||
let b = n.construct_boxes();
|
||||
let b = n.construct_boxes().get();
|
||||
|
||||
let subbox = match b.kind {
|
||||
TextBoxKind(subbox) => { subbox },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue