aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/style/parsing/mod.rs
diff options
context:
space:
mode:
authorJ. Ryan Stinnett <jryans@gmail.com>2017-04-10 09:24:32 +0800
committerJ. Ryan Stinnett <jryans@gmail.com>2017-04-12 16:40:17 +0800
commit4574cd8ea61b56b1fb553b5e4fe765888d419945 (patch)
tree69ba122f702f15bbecc15291a3d9782860264369 /tests/unit/style/parsing/mod.rs
parenta093b0a087d45bff0bb8a7039c8bfb8ec6706442 (diff)
downloadservo-4574cd8ea61b56b1fb553b5e4fe765888d419945.tar.gz
servo-4574cd8ea61b56b1fb553b5e4fe765888d419945.zip
Pull rule_type into ParserContext
Absorb `rule_type` into the `ParserContext` so that it's easier to pass down to deeper levels of the parser. MozReview-Commit-ID: DjBNytLxGKX
Diffstat (limited to 'tests/unit/style/parsing/mod.rs')
-rw-r--r--tests/unit/style/parsing/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/style/parsing/mod.rs b/tests/unit/style/parsing/mod.rs
index cb5181fc6cc..b6da9a138d6 100644
--- a/tests/unit/style/parsing/mod.rs
+++ b/tests/unit/style/parsing/mod.rs
@@ -7,12 +7,12 @@
use cssparser::Parser;
use media_queries::CSSErrorReporterTest;
use style::parser::ParserContext;
-use style::stylesheets::Origin;
+use style::stylesheets::{CssRuleType, Origin};
fn parse<T, F: Fn(&ParserContext, &mut Parser) -> Result<T, ()>>(f: F, s: &str) -> Result<T, ()> {
let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
let reporter = CSSErrorReporterTest;
- let context = ParserContext::new(Origin::Author, &url, &reporter);
+ let context = ParserContext::new(Origin::Author, &url, &reporter, Some(CssRuleType::Style));
let mut parser = Parser::new(s);
f(&context, &mut parser)
}
@@ -26,7 +26,7 @@ macro_rules! assert_roundtrip_with_context {
($fun:expr,$input:expr, $output:expr) => {
let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
let reporter = CSSErrorReporterTest;
- let context = ParserContext::new(Origin::Author, &url, &reporter);
+ let context = ParserContext::new(Origin::Author, &url, &reporter, Some(CssRuleType::Style));
let mut parser = Parser::new($input);
let parsed = $fun(&context, &mut parser)
.expect(&format!("Failed to parse {}", $input));
@@ -64,7 +64,7 @@ macro_rules! assert_parser_exhausted {
($name:ident, $string:expr, $should_exhausted:expr) => {{
let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
let reporter = CSSErrorReporterTest;
- let context = ParserContext::new(Origin::Author, &url, &reporter);
+ let context = ParserContext::new(Origin::Author, &url, &reporter, Some(CssRuleType::Style));
let mut parser = Parser::new($string);
let parsed = $name::parse(&context, &mut parser);
assert_eq!(parsed.is_ok(), true);
@@ -76,7 +76,7 @@ macro_rules! parse_longhand {
($name:ident, $s:expr) => {{
let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
let reporter = CSSErrorReporterTest;
- let context = ParserContext::new(Origin::Author, &url, &reporter);
+ let context = ParserContext::new(Origin::Author, &url, &reporter, Some(CssRuleType::Style));
$name::parse(&context, &mut Parser::new($s)).unwrap()
}};
}