Chromium Code Reviews| Index: tools/metrics/actions/extract_actions_test.py |
| diff --git a/tools/metrics/actions/extract_actions_test.py b/tools/metrics/actions/extract_actions_test.py |
| index a5cfd387717a1b2498ebdc099c991e5e0d8611be..e52cc51b24b9ac7739ab44979b695d3a746c87c6 100755 |
| --- a/tools/metrics/actions/extract_actions_test.py |
| +++ b/tools/metrics/actions/extract_actions_test.py |
| @@ -114,7 +114,6 @@ COMMENT_EXPECTED_XML = ( |
| '</actions>\n' |
| ) |
| - |
| class ActionXmlTest(unittest.TestCase): |
| def _GetProcessedAction(self, owner, description, obsolete, new_actions=[], |
| @@ -194,6 +193,15 @@ class ActionXmlTest(unittest.TestCase): |
| comment=COMMENT) |
| self.assertEqual(COMMENT_EXPECTED_XML, xml_result) |
| + def testUserMetricsActionSpanningTwoLines(self): |
| + code = 'base::UserMetricsAction(\n"Foo.Bar"));' |
| + names, _ = extract_actions.FindActionNames(code, 0) |
| + self.assertEqual(['Foo.Bar'], names) |
| + |
| + def testTernaryUserMetricsAction(self): |
| + code = 'base::UserMetricsAction(foo ? "Foo.Bar" : "Bar.Foo"));' |
|
Ilya Sherman
2015/01/09 22:25:44
I'm not convinced that we want to support this. I
Alexei Svitkine (slow)
2015/01/12 19:58:24
We could do that. The disadvantage is we'll need t
|
| + names, _ = extract_actions.FindActionNames(code, 0) |
| + self.assertEqual(['Foo.Bar', 'Bar.Foo'], names) |
| if __name__ == '__main__': |
| unittest.main() |