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

Unified Diff: dashboard/dashboard/pinpoint/models/quest/read_value_test.py

Issue 3001043002: [pinpoint] Add ReadGraphJsonValue. (Closed)
Patch Set: Created 3 years, 4 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: dashboard/dashboard/pinpoint/models/quest/read_value_test.py
diff --git a/dashboard/dashboard/pinpoint/models/quest/read_value_test.py b/dashboard/dashboard/pinpoint/models/quest/read_value_test.py
index 972eef56e7da7edd20406de44dc4295eee929a58..b0cf86b3679114683ba5252c685f9d359b395876 100644
--- a/dashboard/dashboard/pinpoint/models/quest/read_value_test.py
+++ b/dashboard/dashboard/pinpoint/models/quest/read_value_test.py
@@ -105,3 +105,25 @@ class ReadChartJsonValueTest(unittest.TestCase):
execution.Poll()
self.assertEqual(execution.result_values, (2.5,))
+
+
+@mock.patch('dashboard.services.isolate_service.Retrieve')
+class ReadGraphJsonValueTest(unittest.TestCase):
+
+ def testReadGraphJsonValue(self, retrieve):
+ retrieve.side_effect = (
+ {'files': {'chartjson-output.json': {'h': 'graphjson hash'}}},
+ json.dumps({'chart': {'traces': {'trace': ['126444.869721', '0.0']}}}),
+ )
+
+ quest = read_value.ReadGraphJsonValue('chart', 'trace')
+ execution = quest.Start('output hash')
+ execution.Poll()
+
+ self.assertTrue(execution.completed)
+ self.assertFalse(execution.failed)
+ self.assertEqual(execution.result_values, (126444.869721,))
+ self.assertEqual(execution.result_arguments, {})
+
+ expected_calls = [mock.call('output hash'), mock.call('graphjson hash')]
+ self.assertEqual(retrieve.mock_calls, expected_calls)
« no previous file with comments | « dashboard/dashboard/pinpoint/models/quest/read_value.py ('k') | dashboard/dashboard/pinpoint/models/quest_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698