| 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 |
| 11 import devtools_monitor | 11 import devtools_monitor |
| 12 | 12 |
| 13 from tracing import (Event, TracingTrack, _IntervalTree) | 13 from tracing_track import (Event, TracingTrack, _IntervalTree) |
| 14 | 14 |
| 15 | 15 |
| 16 class TracingTrackTestCase(unittest.TestCase): | 16 class TracingTrackTestCase(unittest.TestCase): |
| 17 _MIXED_EVENTS = [ | 17 _MIXED_EVENTS = [ |
| 18 {'ts': 3, 'ph': 'N', 'id': 1, 'args': {'name': 'A'}}, | 18 {'ts': 3, 'ph': 'N', 'id': 1, 'args': {'name': 'A'}}, |
| 19 {'ts': 5, 'ph': 'X', 'dur': 1, 'args': {'name': 'B'}}, | 19 {'ts': 5, 'ph': 'X', 'dur': 1, 'args': {'name': 'B'}}, |
| 20 {'ts': 7, 'ph': 'D', 'id': 1}, | 20 {'ts': 7, 'ph': 'D', 'id': 1}, |
| 21 {'ts': 10, 'ph': 'B', 'args': {'name': 'D'}}, | 21 {'ts': 10, 'ph': 'B', 'args': {'name': 'D'}}, |
| 22 {'ts': 10, 'ph': 'b', 'cat': 'X', 'id': 1, 'args': {'name': 'C'}}, | 22 {'ts': 10, 'ph': 'b', 'cat': 'X', 'id': 1, 'args': {'name': 'C'}}, |
| 23 {'ts': 11, 'ph': 'e', 'cat': 'X', 'id': 1}, | 23 {'ts': 11, 'ph': 'e', 'cat': 'X', 'id': 1}, |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 'cat': 'bar,baz,bizbiz', | 484 'cat': 'bar,baz,bizbiz', |
| 485 'ph': 'X', | 485 'ph': 'X', |
| 486 'ts': 0, 'dur': 0}) | 486 'ts': 0, 'dur': 0}) |
| 487 self.assertTrue(event.Matches('bar', 'foo')) | 487 self.assertTrue(event.Matches('bar', 'foo')) |
| 488 self.assertTrue(event.Matches('baz', 'foo')) | 488 self.assertTrue(event.Matches('baz', 'foo')) |
| 489 self.assertFalse(event.Matches('bar', 'biz')) | 489 self.assertFalse(event.Matches('bar', 'biz')) |
| 490 self.assertFalse(event.Matches('biz', 'foo')) | 490 self.assertFalse(event.Matches('biz', 'foo')) |
| 491 | 491 |
| 492 if __name__ == '__main__': | 492 if __name__ == '__main__': |
| 493 unittest.main() | 493 unittest.main() |
| OLD | NEW |