Update sdk/platform-tools to version 26.0.0.
[android_tools.git] / sdk / platform-tools / systrace / catapult / telemetry / telemetry / timeline / bounds_unittest.py
blob0b0612411ab300e83af5229b178f3318a4ce07fa
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 import unittest
6 from telemetry.timeline import bounds
9 class BoundsTests(unittest.TestCase):
11 def testGetOverlap(self):
12 # Non overlap cases.
13 self.assertEquals(0, bounds.Bounds.GetOverlap(10, 20, 30, 40))
14 self.assertEquals(0, bounds.Bounds.GetOverlap(30, 40, 10, 20))
15 # Overlap cases.
16 self.assertEquals(10, bounds.Bounds.GetOverlap(10, 30, 20, 40))
17 self.assertEquals(10, bounds.Bounds.GetOverlap(20, 40, 10, 30))
18 # Inclusive cases.
19 self.assertEquals(10, bounds.Bounds.GetOverlap(10, 40, 20, 30))
20 self.assertEquals(10, bounds.Bounds.GetOverlap(20, 30, 10, 40))