| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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() |
| OLD | NEW |