diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-05-15 10:20:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-05-15 10:28:57 +0000 |
commit | d17ea114e5ef69ad5d5d7413280a13e6428098aa (patch) | |
tree | 2c01a75df69f30d27b1432467cfe7c1467a498da /chromium/PRESUBMIT_test_mocks.py | |
parent | 8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec (diff) | |
download | qtwebengine-chromium-d17ea114e5ef69ad5d5d7413280a13e6428098aa.tar.gz |
BASELINE: Update Chromium to 67.0.3396.47
Change-Id: Idcb1341782e417561a2473eeecc82642dafda5b7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/PRESUBMIT_test_mocks.py')
-rw-r--r-- | chromium/PRESUBMIT_test_mocks.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chromium/PRESUBMIT_test_mocks.py b/chromium/PRESUBMIT_test_mocks.py index 732da0ea38c..3b491d963ed 100644 --- a/chromium/PRESUBMIT_test_mocks.py +++ b/chromium/PRESUBMIT_test_mocks.py @@ -51,6 +51,7 @@ class MockCannedChecks(object): return errors + class MockInputApi(object): """Mock class for the InputApi class. @@ -75,6 +76,9 @@ class MockInputApi(object): self.change = MockChange([]) self.presubmit_local_path = os.path.dirname(__file__) + def CreateMockFileInPath(self, f_list): + self.os_path.exists = lambda x: x in f_list + def AffectedFiles(self, file_filter=None, include_deletes=False): for file in self.files: if file_filter and not file_filter(file): @@ -88,17 +92,19 @@ class MockInputApi(object): def FilterSourceFile(self, file, white_list=(), black_list=()): local_path = file.LocalPath() + found_in_white_list = not white_list if white_list: for pattern in white_list: compiled_pattern = re.compile(pattern) if compiled_pattern.search(local_path): - return True + found_in_white_list = True + break if black_list: for pattern in black_list: compiled_pattern = re.compile(pattern) if compiled_pattern.search(local_path): return False - return True + return found_in_white_list def LocalPaths(self): return self.files |