Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Bug module that is necessary for the layout analyzer.""" | 5 """Bug module that is necessary for the layout analyzer.""" |
| 6 | 6 |
| 7 import re | 7 import re |
| 8 | 8 |
| 9 from webkitpy.layout_tests.models.test_expectations import * | 9 from webkitpy.layout_tests.models.test_expectations import * |
| 10 | 10 |
| 11 | 11 |
| 12 class Bug(object): | 12 class Bug(object): |
| 13 """A class representing a bug. | 13 """A class representing a bug. |
| 14 | 14 |
| 15 TODO(imasaki): add more functionalities here if bug-tracker API is available. | 15 TODO(imasaki): add more functionalities here if bug-tracker API is available. |
| 16 For example, you can get the name of a bug owner. | 16 For example, you can get the name of a bug owner. |
| 17 """ | 17 """ |
| 18 # Type enum for the bug. | 18 # Type enum for the bug. |
| 19 WEBKIT = 0 | 19 WEBKIT = 0 |
| 20 CHROMIUM = 1 | 20 CHROMIUM = 1 |
| 21 OTHERS = 2 | 21 OTHERS = 2 |
| 22 | 22 |
| 23 def __init__(self, bug_modifier): | 23 def __init__(self, bug_modifier): |
| 24 """Initialize the object using raw bug text (such as BUGWK2322). | 24 """Initialize the object using raw bug text (such as BUGWK2322). |
| 25 | 25 |
| 26 The bug modifier used in the test expectation file. | 26 The bug modifier used in the test expectation file. |
| 27 | 27 |
| 28 Args: | 28 Args: |
| 29 bug_modifier: a string representing a bug modifier. According to | 29 bug_modifier: a string representing a bug modifier. According to |
| 30 http://www.chromium.org/developers/testing/webkit-layout-tests/\ | 30 https://chromium.googlesource.com/chromium/src/+/master/docs/testing/lay out_test_expectations.md |
|
Dirk Pranke
2016/11/15 22:24:55
I would change this to //docs/testing/layout_test_
| |
| 31 testexpectations | |
| 32 Bug identifiers are of the form "webkit.org/b/12345", "crbug.com/12345", | 31 Bug identifiers are of the form "webkit.org/b/12345", "crbug.com/12345", |
| 33 "code.google.com/p/v8/issues/detail?id=12345" or "Bug(username)" | 32 "code.google.com/p/v8/issues/detail?id=12345" or "Bug(username)" |
| 34 """ | 33 """ |
| 35 match = re.match('Bug\((\w+)\)$', bug_modifier) | 34 match = re.match('Bug\((\w+)\)$', bug_modifier) |
| 36 if match: | 35 if match: |
| 37 self.type = self.OTHERS | 36 self.type = self.OTHERS |
| 38 self.url = 'mailto:%s@chromium.org' % match.group(1).lower() | 37 self.url = 'mailto:%s@chromium.org' % match.group(1).lower() |
| 39 self.bug_txt = bug_modifier | 38 self.bug_txt = bug_modifier |
| 40 return | 39 return |
| 41 | 40 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 52 return self.CHROMIUM; | 51 return self.CHROMIUM; |
| 53 return self.OTHERS | 52 return self.OTHERS |
| 54 | 53 |
| 55 def __str__(self): | 54 def __str__(self): |
| 56 """Get a string representation of a bug object. | 55 """Get a string representation of a bug object. |
| 57 | 56 |
| 58 Returns: | 57 Returns: |
| 59 a string for HTML link representation of a bug. | 58 a string for HTML link representation of a bug. |
| 60 """ | 59 """ |
| 61 return '<a href="%s">%s</a>' % (self.url, self.bug_txt) | 60 return '<a href="%s">%s</a>' % (self.url, self.bug_txt) |
| OLD | NEW |