| Index: PRESUBMIT_test.py
|
| diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
|
| index fdca995486edb691cee55783fb426ecec215ba7b..7f3ee91a4bbdbd2d71952a974c6e0e810ffdb21e 100755
|
| --- a/PRESUBMIT_test.py
|
| +++ b/PRESUBMIT_test.py
|
| @@ -3,7 +3,6 @@
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| -import os.path
|
| import re
|
| import subprocess
|
| import unittest
|
| @@ -470,77 +469,41 @@
|
|
|
|
|
| class CheckAddedDepsHaveTetsApprovalsTest(unittest.TestCase):
|
| -
|
| - def calculate(self, old_include_rules, old_specific_include_rules,
|
| - new_include_rules, new_specific_include_rules):
|
| - return PRESUBMIT._CalculateAddedDeps(
|
| - os.path, 'include_rules = %r\nspecific_include_rules = %r' % (
|
| - old_include_rules, old_specific_include_rules),
|
| - 'include_rules = %r\nspecific_include_rules = %r' % (
|
| - new_include_rules, new_specific_include_rules))
|
| -
|
| - def testCalculateAddedDeps(self):
|
| - old_include_rules = [
|
| - '+base',
|
| - '-chrome',
|
| - '+content',
|
| - '-grit',
|
| - '-grit/",',
|
| - '+jni/fooblat.h',
|
| - '!sandbox',
|
| - ]
|
| - old_specific_include_rules = {
|
| - 'compositor\.*': {
|
| - '+cc',
|
| - },
|
| - }
|
| -
|
| - new_include_rules = [
|
| - '-ash',
|
| - '+base',
|
| - '+chrome',
|
| - '+components',
|
| - '+content',
|
| - '+grit',
|
| - '+grit/generated_resources.h",',
|
| - '+grit/",',
|
| - '+jni/fooblat.h',
|
| - '+policy',
|
| - '+third_party/WebKit',
|
| - ]
|
| - new_specific_include_rules = {
|
| - 'compositor\.*': {
|
| - '+cc',
|
| - },
|
| - 'widget\.*': {
|
| - '+gpu',
|
| - },
|
| - }
|
| -
|
| + def testFilesToCheckForIncomingDeps(self):
|
| + changed_lines = [
|
| + '"+breakpad",',
|
| + '"+chrome/installer",',
|
| + '"+chrome/plugin/chrome_content_plugin_client.h",',
|
| + '"+chrome/utility/chrome_content_utility_client.h",',
|
| + '"+chromeos/chromeos_paths.h",',
|
| + '"+components/crash/content",',
|
| + '"+components/nacl/common",',
|
| + '"+content/public/browser/render_process_host.h",',
|
| + '"+jni/fooblat.h",',
|
| + '"+grit", # For generated headers',
|
| + '"+grit/generated_resources.h",',
|
| + '"+grit/",',
|
| + '"+policy", # For generated headers and source',
|
| + '"+sandbox",',
|
| + '"+tools/memory_watcher",',
|
| + '"+third_party/lss/linux_syscall_support.h",',
|
| + ]
|
| + files_to_check = PRESUBMIT._FilesToCheckForIncomingDeps(re, changed_lines)
|
| expected = set([
|
| - 'chrome/DEPS',
|
| - 'gpu/DEPS',
|
| - 'components/DEPS',
|
| - 'policy/DEPS',
|
| - 'third_party/WebKit/DEPS',
|
| + 'breakpad/DEPS',
|
| + 'chrome/installer/DEPS',
|
| + 'chrome/plugin/chrome_content_plugin_client.h',
|
| + 'chrome/utility/chrome_content_utility_client.h',
|
| + 'chromeos/chromeos_paths.h',
|
| + 'components/crash/content/DEPS',
|
| + 'components/nacl/common/DEPS',
|
| + 'content/public/browser/render_process_host.h',
|
| + 'policy/DEPS',
|
| + 'sandbox/DEPS',
|
| + 'tools/memory_watcher/DEPS',
|
| + 'third_party/lss/linux_syscall_support.h',
|
| ])
|
| - self.assertEqual(
|
| - expected,
|
| - self.calculate(old_include_rules, old_specific_include_rules,
|
| - new_include_rules, new_specific_include_rules))
|
| -
|
| - def testCalculateAddedDepsIgnoresPermutations(self):
|
| - old_include_rules = [
|
| - '+base',
|
| - '+chrome',
|
| - ]
|
| - new_include_rules = [
|
| - '+chrome',
|
| - '+base',
|
| - ]
|
| - self.assertEqual(set(),
|
| - self.calculate(old_include_rules, {}, new_include_rules,
|
| - {}))
|
| + self.assertEqual(expected, files_to_check);
|
|
|
|
|
| class JSONParsingTest(unittest.TestCase):
|
|
|