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

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

Issue 1888343003: Clovis: contentful paint upgrades. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@url-rename
Patch Set: Use new frame detection Created 4 years, 7 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
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 collections 5 import collections
6 import copy 6 import copy
7 import logging 7 import logging
8 import operator 8 import operator
9 import unittest 9 import unittest
10 10
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 {'ts': 7, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x123', 302 {'ts': 7, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x123',
303 'name': 'navigationStart', 'cat': 'blink.user_timing', 303 'name': 'navigationStart', 'cat': 'blink.user_timing',
304 'args': {'frame': _SUBFRAME_ID}}, 304 'args': {'frame': _SUBFRAME_ID}},
305 {'ts': 8, 'ph': 'X', 'dur': 2, 'pid': 2, 'tid': 1, 'id': '0x12343', 305 {'ts': 8, 'ph': 'X', 'dur': 2, 'pid': 2, 'tid': 1, 'id': '0x12343',
306 'name': 'A'}, 306 'name': 'A'},
307 {'ts': 3, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x125', 307 {'ts': 3, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x125',
308 'name': 'navigationStart', 'cat': 'blink.user_timing', 308 'name': 'navigationStart', 'cat': 'blink.user_timing',
309 'args': {'frame': _MAIN_FRAME_ID}}, 309 'args': {'frame': _MAIN_FRAME_ID}},
310 ] 310 ]
311 self._HandleEvents(events) 311 self._HandleEvents(events)
312 self.assertEquals(_MAIN_FRAME_ID, self.track._GetMainFrameID()) 312 self.assertEquals(_MAIN_FRAME_ID, self.track.GetMainFrameID())
313 313
314 def testGetMatchingEvents(self): 314 def testGetMatchingEvents(self):
315 _MAIN_FRAME_ID = 0xffff 315 _MAIN_FRAME_ID = 0xffff
316 _SUBFRAME_ID = 0xaaaa 316 _SUBFRAME_ID = 0xaaaa
317 events = [ 317 events = [
318 {'ts': 7, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x123', 318 {'ts': 7, 'ph': 'X', 'dur': 10, 'pid': 2, 'tid': 1, 'id': '0x123',
319 'name': 'navigationStart', 'cat': 'blink.user_timing', 319 'name': 'navigationStart', 'cat': 'blink.user_timing',
320 'args': {'frame': _SUBFRAME_ID}}, 320 'args': {'frame': _SUBFRAME_ID}},
321 {'ts': 8, 'ph': 'X', 'dur': 2, 'pid': 2, 'tid': 1, 'id': '0x12343', 321 {'ts': 8, 'ph': 'X', 'dur': 2, 'pid': 2, 'tid': 1, 'id': '0x12343',
322 'name': 'A'}, 322 'name': 'A'},
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 'cat': 'bar,baz,bizbiz', 449 'cat': 'bar,baz,bizbiz',
450 'ph': 'X', 450 'ph': 'X',
451 'ts': 0, 'dur': 0}) 451 'ts': 0, 'dur': 0})
452 self.assertTrue(event.Matches('bar', 'foo')) 452 self.assertTrue(event.Matches('bar', 'foo'))
453 self.assertTrue(event.Matches('baz', 'foo')) 453 self.assertTrue(event.Matches('baz', 'foo'))
454 self.assertFalse(event.Matches('bar', 'biz')) 454 self.assertFalse(event.Matches('bar', 'biz'))
455 self.assertFalse(event.Matches('biz', 'foo')) 455 self.assertFalse(event.Matches('biz', 'foo'))
456 456
457 if __name__ == '__main__': 457 if __name__ == '__main__':
458 unittest.main() 458 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698