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

Unified Diff: tools/metrics/ukm/pretty_print_test.py

Issue 2769223005: Create a UKM descriptions XML file (Closed)
Patch Set: Incorporate feedback Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: tools/metrics/ukm/pretty_print_test.py
diff --git a/tools/metrics/ukm/pretty_print_test.py b/tools/metrics/ukm/pretty_print_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..8f23cd7f02f04c9e99f6ce3a18fd8020d7de5ad9
--- /dev/null
+++ b/tools/metrics/ukm/pretty_print_test.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import unittest
+
+import model
+
+
+PRETTY_XML = """
+<!-- Comment1 -->
+
+<ukm-configuration>
+
+<event name="Event1">
+ <owner>owner@chromium.org</owner>
+ <summary>
+ Event1 summary.
+ </summary>
+ <metric name="Metric1">
+ <owner>owner2@chromium.org</owner>
+ <summary>
+ Metric1 summary.
+ </summary>
+ </metric>
+ <metric name="Metric2"/>
+</event>
+
+</ukm-configuration>
+""".strip()
+
+
+class UkmXmlTest(unittest.TestCase):
+
+ def testIsPretty(self):
+ result = model.UpdateXML(PRETTY_XML)
+ self.assertMultiLineEqual(PRETTY_XML, result.strip())
+
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698