Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: tests/SkDOMTest.cpp

Issue 2150353002: Make XML compilation conditional. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: improved SkDOMTest guard Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/xml.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h"
9
10 #if defined(SK_XML)
11
8 #include "SkDOM.h" 12 #include "SkDOM.h"
9 #include "Test.h"
10 13
11 DEF_TEST(SkDOM_test, r) { 14 DEF_TEST(SkDOM_test, r) {
12 static const char gDoc[] = 15 static const char gDoc[] =
13 "<root a='1' b='2'>" 16 "<root a='1' b='2'>"
14 "<elem1 c='3' />" 17 "<elem1 c='3' />"
15 "<elem2 d='4' />" 18 "<elem2 d='4' />"
16 "<elem3 e='5'>" 19 "<elem3 e='5'>"
17 "<subelem1/>" 20 "<subelem1/>"
18 "<subelem2 f='6' g='7'/>" 21 "<subelem2 f='6' g='7'/>"
19 "</elem3>" 22 "</elem3>"
(...skipping 10 matching lines...) Expand all
30 const char* v = dom.findAttr(root, "a"); 33 const char* v = dom.findAttr(root, "a");
31 REPORTER_ASSERT(r, v && !strcmp(v, "1")); 34 REPORTER_ASSERT(r, v && !strcmp(v, "1"));
32 v = dom.findAttr(root, "b"); 35 v = dom.findAttr(root, "b");
33 REPORTER_ASSERT(r, v && !strcmp(v, "2")); 36 REPORTER_ASSERT(r, v && !strcmp(v, "2"));
34 v = dom.findAttr(root, "c"); 37 v = dom.findAttr(root, "c");
35 REPORTER_ASSERT(r, v == nullptr); 38 REPORTER_ASSERT(r, v == nullptr);
36 39
37 REPORTER_ASSERT(r, dom.getFirstChild(root, "elem1")); 40 REPORTER_ASSERT(r, dom.getFirstChild(root, "elem1"));
38 REPORTER_ASSERT(r, !dom.getFirstChild(root, "subelem1")); 41 REPORTER_ASSERT(r, !dom.getFirstChild(root, "subelem1"));
39 } 42 }
43
44 #endif // SK_XML
OLDNEW
« no previous file with comments | « gyp/xml.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698