Lines Matching refs:reporter
51 void check_text_node(skiatest::Reporter* reporter,
59 ERRORF(reporter, "root element not found.");
65 ERRORF(reporter, "<text> element not found.");
68 REPORTER_ASSERT(reporter, dom.getType(textElem) == SkDOM::kElement_Type);
71 REPORTER_ASSERT(reporter, textNode != nullptr);
73 REPORTER_ASSERT(reporter, dom.getType(textNode) == SkDOM::kText_Type);
74 REPORTER_ASSERT(reporter, strcmp(expected, dom.getName(textNode)) == 0);
80 REPORTER_ASSERT(reporter, x != nullptr);
83 REPORTER_ASSERT(reporter, SkParse::Count(x) == xposCount);
91 REPORTER_ASSERT(reporter, xpos[0] == offset.x());
95 REPORTER_ASSERT(reporter, xpos[i] == SkIntToScalar(expected[i]));
101 REPORTER_ASSERT(reporter, y != nullptr);
104 REPORTER_ASSERT(reporter, SkParse::Count(y) == yposCount);
109 REPORTER_ASSERT(reporter, ypos[0] == offset.y());
112 REPORTER_ASSERT(reporter, ypos[i] == 150 - SkIntToScalar(expected[i]));
118 void test_whitespace_pos(skiatest::Reporter* reporter,
132 check_text_node(reporter, dom, dom.finishParsing(), offset, 0, txt, expected);
143 check_text_node(reporter, dom, dom.finishParsing(), offset, 1, txt, expected);
154 check_text_node(reporter, dom, dom.finishParsing(), offset, 2, txt, expected);
159 DEF_TEST(SVGDevice_whitespace_pos, reporter) {
177 test_whitespace_pos(reporter, tests[i].tst_in, tests[i].tst_out);
191 bool FindImageShaderNodes(skiatest::Reporter* reporter, const SkDOM* dom, const SkDOM::Node* root,
195 ERRORF(reporter, "root element not found");
202 ERRORF(reporter, "rect not found");
209 ERRORF(reporter, "defs not found");
215 ERRORF(reporter, "pattern not found");
222 ERRORF(reporter, "image not found");
240 DEF_TEST(SVGDevice_image_shader_norepeat, reporter) {
252 FindImageShaderNodes(reporter, &dom, root, &patternNode, &imageNode, &rectNode);
253 REPORTER_ASSERT(reporter, structureAppropriate);
256 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "width")) == imageWidth);
257 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "height")) == imageHeight);
261 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(patternNode, "width"), "100%") == 0);
262 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(patternNode, "height"), "100%") == 0);
265 DEF_TEST(SVGDevice_image_shader_tilex, reporter) {
276 ERRORF(reporter, "inner svg element not found");
282 FindImageShaderNodes(reporter, &dom, innerSvg, &patternNode, &imageNode, &rectNode);
283 REPORTER_ASSERT(reporter, structureAppropriate);
286 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "width")) == imageWidth);
287 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "height")) == imageHeight);
291 REPORTER_ASSERT(reporter, atoi(dom.findAttr(patternNode, "width")) == imageWidth);
292 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(patternNode, "height"), "100%") == 0);
295 DEF_TEST(SVGDevice_image_shader_tiley, reporter) {
306 ERRORF(reporter, "inner svg element not found");
312 FindImageShaderNodes(reporter, &dom, innerSvg, &patternNode, &imageNode, &rectNode);
313 REPORTER_ASSERT(reporter, structureAppropriate);
316 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "width")) == imageNodeWidth);
317 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "height")) == imageNodeHeight);
321 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(patternNode, "width"), "100%") == 0);
322 REPORTER_ASSERT(reporter, atoi(dom.findAttr(patternNode, "height")) == imageNodeHeight);
325 DEF_TEST(SVGDevice_image_shader_tileboth, reporter) {
338 ERRORF(reporter, "inner svg element not found");
342 FindImageShaderNodes(reporter, &dom, innerSvg, &patternNode, &imageNode, &rectNode);
343 REPORTER_ASSERT(reporter, structureAppropriate);
346 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "width")) == imageWidth);
347 REPORTER_ASSERT(reporter, atoi(dom.findAttr(imageNode, "height")) == imageHeight);
349 REPORTER_ASSERT(reporter, atoi(dom.findAttr(patternNode, "width")) == imageWidth);
350 REPORTER_ASSERT(reporter, atoi(dom.findAttr(patternNode, "height")) == imageHeight);
353 DEF_TEST(SVGDevice_ColorFilters, reporter) {
363 ABORT_TEST(reporter, !rootElement, "root element not found");
366 ABORT_TEST(reporter, !filterElement, "filter element not found");
369 ABORT_TEST(reporter, !floodElement, "feFlood element not found");
372 ABORT_TEST(reporter, !compositeElement, "feComposite element not found");
374 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(filterElement, "width"), "100%") == 0);
375 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(filterElement, "height"), "100%") == 0);
377 REPORTER_ASSERT(reporter,
379 REPORTER_ASSERT(reporter, atoi(dom.findAttr(floodElement, "flood-opacity")) == 1);
381 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(compositeElement, "in"), "flood") == 0);
382 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(compositeElement, "operator"), "in") == 0);
385 DEF_TEST(SVGDevice_textpath, reporter) {
397 REPORTER_ASSERT(reporter, rootElement, "root element not found");
399 REPORTER_ASSERT(reporter, !!textElement == !expect_path, "unexpected text element");
401 REPORTER_ASSERT(reporter, !!pathElement == expect_path, "unexpected path element");
416 DEF_TEST(SVGDevice_fill_stroke, reporter) {
440 REPORTER_ASSERT(reporter, root, "root element not found");
442 REPORTER_ASSERT(reporter, rect, "rect element not found");
444 REPORTER_ASSERT(reporter, !!fill == !!tst.expected_fill);
446 REPORTER_ASSERT(reporter, strcmp(fill, tst.expected_fill) == 0);
449 REPORTER_ASSERT(reporter, !!stroke == !!tst.expected_stroke);
451 REPORTER_ASSERT(reporter, strcmp(stroke, tst.expected_stroke) == 0);
456 DEF_TEST(SVGDevice_fill_rect_hex, reporter) {
466 ABORT_TEST(reporter, !rootElement, "root element not found");
469 ABORT_TEST(reporter, !rectElement, "rect element not found");
470 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(rectElement, "fill"), "blue") == 0);
473 DEF_TEST(SVGDevice_fill_rect_custom_hex, reporter) {
487 ABORT_TEST(reporter, !rootElement, "root element not found");
491 ABORT_TEST(reporter, !rectElement, "rect element not found");
492 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(rectElement, "fill"), "#AABCDE") == 0);
496 ABORT_TEST(reporter, !rectElement, "rect element not found");
497 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(rectElement, "fill"), "#ABC") == 0);
501 ABORT_TEST(reporter, !rectElement, "rect element not found");
502 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(rectElement, "fill"), "#AA1123") == 0);
505 DEF_TEST(SVGDevice_fill_stroke_rect_hex, reporter) {
520 ABORT_TEST(reporter, !rootElement, "root element not found");
523 ABORT_TEST(reporter, !rectNode, "rect element not found");
524 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(rectNode, "fill"), "#00BBAC") == 0);
527 ABORT_TEST(reporter, !rectNode, "rect element not found");
528 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(rectNode, "stroke"), "#123456") == 0);
529 REPORTER_ASSERT(reporter, strcmp(dom.findAttr(rectNode, "stroke-width"), "1") == 0);
532 DEF_TEST(SVGDevice_path_effect, reporter) {
551 REPORTER_ASSERT(reporter, rootElement, "root element not found");
553 REPORTER_ASSERT(reporter, pathElement, "path element not found");
567 REPORTER_ASSERT(reporter, mCount == 3);
570 DEF_TEST(SVGDevice_relative_path_encoding, reporter) {
584 REPORTER_ASSERT(reporter, rootElement, "root element not found");
586 REPORTER_ASSERT(reporter, pathElement, "path element not found");
588 REPORTER_ASSERT(reporter, !strcmp(d, "m100 50l100 0l0 100l-100 -100Z"));
591 DEF_TEST(SVGDevice_color_shader, reporter) {
603 REPORTER_ASSERT(reporter, rootElement, "root element not found");
605 REPORTER_ASSERT(reporter, ellipseElement, "ellipse element not found");
607 REPORTER_ASSERT(reporter, fill, "fill attribute not found");
608 REPORTER_ASSERT(reporter, !strcmp(fill, "yellow"));