public static async Task <TestDisplayData> CreateAsync(SvgTest test) { var data = new TestDisplayData(test); var device = CanvasDevice.GetSharedDevice(false); data.ReferencePng = await DownloadPng(device, new Uri(test.ReferencePngUri)); var svgFile = await CachedData.GetStorageFileAsync(new Uri(test.SvgUri)); var svgDocument = await XmlDocument.LoadFromFileAsync(svgFile, new XmlLoadSettings() { ProhibitDtd = false }); data.Drawing = await SvgDrawing.LoadAsync(device, svgDocument); var description = svgDocument.SelectSingleNodeNS("//d:testDescription", "xmlns:d='http://www.w3.org/2000/02/svg/testsuite/description/'"); if (description != null) { data.Description = description.InnerText; } return(data); }
public static async Task<TestDisplayData> CreateAsync(SvgTest test) { var data = new TestDisplayData(test); var device = CanvasDevice.GetSharedDevice(false); data.ReferencePng = await DownloadPng(device, new Uri(test.ReferencePngUri)); var svgFile = await CachedData.GetStorageFileAsync(new Uri(test.SvgUri)); var svgDocument = await XmlDocument.LoadFromFileAsync(svgFile, new XmlLoadSettings() { ProhibitDtd = false }); data.Drawing = await SvgDrawing.LoadAsync(device, svgDocument); var description = svgDocument.SelectSingleNodeNS("//d:testDescription", "xmlns:d='http://www.w3.org/2000/02/svg/testsuite/description/'"); if (description != null) data.Description = description.InnerText; return data; }
protected TestSuite(List <SvgTest> tests) { testsByChapter = new Dictionary <string, List <SvgTest> >(); foreach (var test in tests) { List <SvgTest> chapterTests; if (!testsByChapter.TryGetValue(test.Chapter, out chapterTests)) { chapterTests = new List <SvgTest>(); testsByChapter.Add(test.Chapter, chapterTests); } chapterTests.Add(test); } selectedChapter = Chapters.First(); SelectedTest = Tests[0]; BackgroundDownloadTestData(); }
static List <SvgTest> ExtractTestsFromIndex(XmlDocument doc) { List <SvgTest> tests = new List <SvgTest>(); var links = doc.GetElementsByTagName("a"); foreach (var link in links) { var svgName = link.InnerText; var newTest = new SvgTest(svgName); // We don't expect anything in these chapters to work if (newTest.Chapter == "animate" || newTest.Chapter == "interact" || newTest.Chapter == "script") { continue; } // Filter out any tests that end with 'z' since we don't support // compressed files yet. // TODO; support svgz files if (newTest.SvgUri.EndsWith("svgz")) { continue; } // Filter out any DOM tests; we don't support the DOM if (newTest.Name.Contains("-dom")) { continue; } tests.Add(newTest); } return(tests); }
static List<SvgTest> ExtractTestsFromIndex(XmlDocument doc) { List<SvgTest> tests = new List<SvgTest>(); var links = doc.GetElementsByTagName("a"); foreach (var link in links) { var svgName = link.InnerText; var newTest = new SvgTest(svgName); // We don't expect anything in these chapters to work if (newTest.Chapter == "animate" || newTest.Chapter=="interact" || newTest.Chapter=="script") continue; // Filter out any tests that end with 'z' since we don't support // compressed files yet. // TODO; support svgz files if (newTest.SvgUri.EndsWith("svgz")) continue; // Filter out any DOM tests; we don't support the DOM if (newTest.Name.Contains("-dom")) continue; tests.Add(newTest); } return tests; }
protected TestSuite(List<SvgTest> tests) { testsByChapter = new Dictionary<string, List<SvgTest>>(); foreach (var test in tests) { List<SvgTest> chapterTests; if (!testsByChapter.TryGetValue(test.Chapter, out chapterTests)) { chapterTests = new List<SvgTest>(); testsByChapter.Add(test.Chapter, chapterTests); } chapterTests.Add(test); } selectedChapter = Chapters.First(); SelectedTest = Tests[0]; BackgroundDownloadTestData(); }
TestDisplayData(SvgTest test) { this.test = test; }