| # Copyright 2017 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| class MockChromiumCommit: |
| position='refs/heads/master@{#123}', |
| patch='Fake patch contents'): |
| self.sha = hashlib.sha1(position.encode('utf-8')).hexdigest() |
| self._change_id = change_id |
| return f'{self.short_sha} "{self.subject()}"' |
| def filtered_changed_files(self): |
| 'third_party/blink/web_tests/external/wpt/one.html', |
| 'third_party/blink/web_tests/external/wpt/two.html', |
| return 'https://fake-chromium-commit-viewer.org/+/%s' % self.short_sha |
| # The final newline is intentionally added to match the real behavior. |
| return self._body + '\n\nChange-Id: ' + self.change_id() + '\n' |
| return self.subject() + '\n\n' + self.body() |