summaryrefslogtreecommitdiffstats
path: root/tools/findit/chromium_deps_unittest.py
diff options
context:
space:
mode:
authorstgao <stgao@chromium.org>2014-08-26 14:53:20 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-26 21:54:30 +0000
commit6b6cd502e50d93232afee8f993dc47a563f74c84 (patch)
tree59bdc17fa1b65da8ea18ad90587acde53881472f /tools/findit/chromium_deps_unittest.py
parent54c3719d6bd03e7f2a644b8ce611e68a67bc341f (diff)
downloadchromium_src-6b6cd502e50d93232afee8f993dc47a563f74c84.zip
chromium_src-6b6cd502e50d93232afee8f993dc47a563f74c84.tar.gz
chromium_src-6b6cd502e50d93232afee8f993dc47a563f74c84.tar.bz2
[Findit] Improve output format and cherry-pick bugs fix.
1. For DEPS file parsing, switching from svn to git. 2. For output of testcase https://cluster-fuzz.appspot.com/testcase?key=5097237064450048, now it is: Lines 1103-1112 of file ThreadState.cpp which potentially caused crash are changed in this cl (frame #2, function "blink::ThreadState::performPendingSweep()"). Lines 1120-1136, 1170-1174 of file Heap.cpp which potentially caused crash are changed in this cl (frame #0, function "blink::ThreadHeap<blink::FinalizedHeapObjectHeader>::sweepNormalPages(blink::HeapStats*)"; frame #1, function "blink::ThreadHeap<blink::FinalizedHeapObjectHeader>::sweep(blink::HeapStats*)"). Minimum distance from crashed line to changed line: 0. (File: ThreadState.cpp, Crashed on: 1100, Changed: 1100). NOTRY=true Review URL: https://codereview.chromium.org/504443004 Cr-Commit-Position: refs/heads/master@{#291987}
Diffstat (limited to 'tools/findit/chromium_deps_unittest.py')
-rw-r--r--tools/findit/chromium_deps_unittest.py57
1 files changed, 46 insertions, 11 deletions
diff --git a/tools/findit/chromium_deps_unittest.py b/tools/findit/chromium_deps_unittest.py
index a26ac9c..7f64a12 100644
--- a/tools/findit/chromium_deps_unittest.py
+++ b/tools/findit/chromium_deps_unittest.py
@@ -5,6 +5,7 @@
import unittest
import chromium_deps
+from common import utils
class ChromiumDEPSTest(unittest.TestCase):
@@ -38,12 +39,13 @@ deps_os = {
def testGetChromiumComponents(self):
chromium_revision = '283296'
+ chromium_revision_git_hash = 'b041fda2e8493dcb26aac08deb493943df240cbb'
webkit_revision = '178200'
breakpad_revision = '1345'
liblouis_commit_hashcode = '3c2daee56250162e5a75830871601d74328d39f5'
def _GetContentOfDEPS(chromium_revision_tmp):
- self.assertEqual(chromium_revision_tmp, chromium_revision)
+ self.assertEqual(chromium_revision_tmp, chromium_revision_git_hash)
return self.DEPS_TEMPLATE % (webkit_revision, breakpad_revision,
liblouis_commit_hashcode)
@@ -65,10 +67,10 @@ deps_os = {
},
'src/': {
'path': 'src/',
- 'repository_type': 'svn',
+ 'repository_type': 'git',
'name': 'chromium',
- 'repository': 'https://src.chromium.org/chrome/trunk',
- 'revision': chromium_revision
+ 'repository': 'https://chromium.googlesource.com/chromium/src/',
+ 'revision': chromium_revision_git_hash
},
'src/third_party/WebKit/': {
'path': 'src/third_party/WebKit/',
@@ -85,22 +87,24 @@ deps_os = {
def testGetChromiumComponentRange(self):
chromium_revision1 = '283200'
+ chromium_revision_git_hash1 = 'c53c387f46a2ff0cf7c072222b826cff0817a80f'
webkit_revision1 = '178084'
breakpad_revision1 = '1345'
liblouis_commit_hashcode1 = '3c2daee56250162e5a75830871601d74328d39f5'
chromium_revision2 = '283296'
+ chromium_revision_git_hash2 = 'b041fda2e8493dcb26aac08deb493943df240cbb'
webkit_revision2 = '178200'
breakpad_revision2 = '1345'
liblouis_commit_hashcode2 = '3c2daee56250162e5a75830871601d74328d39f5'
def _GetContentOfDEPS(chromium_revision):
chromium_revision = str(chromium_revision)
- if chromium_revision == chromium_revision1:
+ if chromium_revision == chromium_revision_git_hash1:
return self.DEPS_TEMPLATE % (webkit_revision1, breakpad_revision1,
liblouis_commit_hashcode1)
else:
- self.assertEqual(chromium_revision2, chromium_revision)
+ self.assertEqual(chromium_revision, chromium_revision_git_hash2)
return self.DEPS_TEMPLATE % (webkit_revision2, breakpad_revision2,
liblouis_commit_hashcode2)
@@ -125,13 +129,13 @@ deps_os = {
'repository_type': 'git'
},
'src/': {
- 'old_revision': chromium_revision1,
+ 'old_revision': chromium_revision_git_hash1,
'name': 'chromium',
- 'repository': 'https://src.chromium.org/chrome/trunk',
+ 'repository': 'https://chromium.googlesource.com/chromium/src/',
'rolled': True,
- 'new_revision': chromium_revision2,
+ 'new_revision': chromium_revision_git_hash2,
'path': 'src/',
- 'repository_type': 'svn'
+ 'repository_type': 'git'
},
'src/third_party/WebKit/': {
'old_revision': webkit_revision1,
@@ -149,6 +153,37 @@ deps_os = {
deps_file_downloader=_GetContentOfDEPS)
self.assertEqual(expected_results, components)
+ def _VerifyGitHashForAllComponents(self, deps):
+ self.assertTrue(deps)
+ self.assertTrue(isinstance(deps, dict))
+ for component in deps.values():
+ for key in ['revision', 'old_revision', 'new_revision']:
+ if key in component:
+ self.assertTrue(utils.IsGitHash(component[key]))
+
+ def testComponentRangeCrossGitMigrationPoint(self):
+ # The old revision is from svn.
+ # The new revision is from git.
+ deps = chromium_deps.GetChromiumComponentRange(
+ '291440',
+ '744746cc51ef81c8f8d727fafa46b14d1c03fe44')
+ self._VerifyGitHashForAllComponents(deps)
+
def testGetSvnRevision(self):
+ # For this case, svn revision needs converting to git hash and there will be
+ # .DEPS.git and DEPS.
deps = chromium_deps.GetChromiumComponents(284750)
- self.assertTrue(isinstance(deps, dict))
+ self._VerifyGitHashForAllComponents(deps)
+
+ def testGetGitRevisionWithoutDEPS_dot_GIT(self):
+ # For this case, there is only DEPS, not .DEPS.git.
+ deps = chromium_deps.GetChromiumComponents(
+ 'f8b3fe9660d8dda318800f55d5e29799bbfd43f7')
+ self._VerifyGitHashForAllComponents(deps)
+
+
+ def testGetGitRevisionWithDEPS_dot_GIT(self):
+ # For this case, there will be .DEPS.git.
+ deps = chromium_deps.GetChromiumComponents(
+ '8ae88241aa9f224e8ce97250f32469d616e437aa')
+ self._VerifyGitHashForAllComponents(deps)