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

Side by Side Diff: tools/android/loading/loading_trace_database_unittest.py

Issue 1908483002: tools/android/loading Loading trace database improvements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor cleanup Created 4 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 unified diff | Download patch
« no previous file with comments | « tools/android/loading/loading_trace_database.py ('k') | tools/android/loading/request_track.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import unittest 5 import unittest
6 6
7 from loading_trace_database import LoadingTraceDatabase 7 from loading_trace_database import LoadingTraceDatabase
8 8
9 9
10 class LoadingTraceDatabaseUnittest(unittest.TestCase): 10 class LoadingTraceDatabaseUnittest(unittest.TestCase):
(...skipping 14 matching lines...) Expand all
25 25
26 # Test a URL with matching traces. 26 # Test a URL with matching traces.
27 self.assertEqual( 27 self.assertEqual(
28 set(self.database.GetTraceFilesForURL("http://bar.html")), 28 set(self.database.GetTraceFilesForURL("http://bar.html")),
29 set(["traces/trace1.json", "traces/trace2.json"])) 29 set(["traces/trace1.json", "traces/trace2.json"]))
30 30
31 def testSerialization(self): 31 def testSerialization(self):
32 self.assertEqual( 32 self.assertEqual(
33 self._JSON_DATABASE, self.database.ToJsonDict()) 33 self._JSON_DATABASE, self.database.ToJsonDict())
34 34
35 def testAddTrace(self): 35 def testSetTrace(self):
36 dummy_url = "http://dummy.com" 36 dummy_url = "http://dummy.com"
37 new_trace_file = "traces/new_trace.json" 37 new_trace_file = "traces/new_trace.json"
38 self.assertEqual(self.database.GetTraceFilesForURL(dummy_url), []) 38 self.assertEqual(self.database.GetTraceFilesForURL(dummy_url), [])
39 self.database.AddTrace(new_trace_file, {"url" : dummy_url}) 39 self.database.SetTrace(new_trace_file, {"url" : dummy_url})
40 self.assertEqual(self.database.GetTraceFilesForURL(dummy_url), 40 self.assertEqual(self.database.GetTraceFilesForURL(dummy_url),
41 [new_trace_file]) 41 [new_trace_file])
42 42
43 43
44 if __name__ == '__main__': 44 if __name__ == '__main__':
45 unittest.main() 45 unittest.main()
OLDNEW
« no previous file with comments | « tools/android/loading/loading_trace_database.py ('k') | tools/android/loading/request_track.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698