| 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 from crash import crash_util | 5 from crash import crash_util |
| 6 from testing_utils import testing | 6 from testing_utils import testing |
| 7 | 7 |
| 8 | 8 |
| 9 class CrashUtilTest(testing.AppengineTestCase): | 9 class CrashUtilTest(testing.AppengineTestCase): |
| 10 | 10 |
| 11 def testIsSameFilePath(self): | 11 def testIsSameFilePath(self): |
| 12 path_1 = 'third_party/a/b/c/file.cc' | 12 path_1 = 'third_party/a/b/c/file.cc' |
| 13 path_2 = 'third_party/a/file.cc' | 13 path_2 = 'third_party/a/file.cc' |
| 14 | 14 |
| 15 self.assertTrue(crash_util.IsSameFilePath(path_1, path_2)) | 15 self.assertTrue(crash_util.IsSameFilePath(path_1, path_2)) |
| 16 | 16 |
| 17 path_1 = 'a/b/c/file.cc' | 17 path_1 = 'a/b/c/file.cc' |
| 18 path_2 = 'a/b/c/file2.cc' | 18 path_2 = 'a/b/c/file2.cc' |
| 19 | 19 |
| 20 self.assertFalse(crash_util.IsSameFilePath(path_1, path_2)) | 20 self.assertFalse(crash_util.IsSameFilePath(path_1, path_2)) |
| 21 | 21 |
| 22 path_1 = 'a/b/c/d/e/file.cc' | 22 path_1 = 'a/b/c/d/e/file.cc' |
| 23 path_2 = 'f/g/file.cc' | 23 path_2 = 'f/g/file.cc' |
| 24 | 24 |
| 25 self.assertTrue(crash_util.IsSameFilePath(None, None)) |
| 25 self.assertFalse(crash_util.IsSameFilePath(path_1, path_2)) | 26 self.assertFalse(crash_util.IsSameFilePath(path_1, path_2)) |
| 27 self.assertFalse(crash_util.IsSameFilePath(None, path_2)) |
| 28 self.assertFalse(crash_util.IsSameFilePath(path_1, None)) |
| OLD | NEW |