| OLD | NEW |
| 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2014 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 import unittest | 5 import unittest |
| 6 | 6 |
| 7 import chromium_deps | 7 import chromium_deps |
| 8 | 8 |
| 9 | 9 |
| 10 class ChromiumDEPSTest(unittest.TestCase): | 10 class ChromiumDEPSTest(unittest.TestCase): |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 'repository': 'http://src.chromium.org/blink/trunk', | 77 'repository': 'http://src.chromium.org/blink/trunk', |
| 78 'revision': webkit_revision | 78 'revision': webkit_revision |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 components = chromium_deps.GetChromiumComponents( | 82 components = chromium_deps.GetChromiumComponents( |
| 83 chromium_revision, deps_file_downloader=_GetContentOfDEPS) | 83 chromium_revision, deps_file_downloader=_GetContentOfDEPS) |
| 84 self.assertEqual(expected_results, components) | 84 self.assertEqual(expected_results, components) |
| 85 | 85 |
| 86 def testGetChromiumComponentRange(self): | 86 def testGetChromiumComponentRange(self): |
| 87 chromium_revision1 = '283296' | 87 chromium_revision1 = '283200' |
| 88 webkit_revision1 = '178200' | 88 webkit_revision1 = '178084' |
| 89 breakpad_revision1 = '1345' | 89 breakpad_revision1 = '1345' |
| 90 liblouis_commit_hashcode1 = '3c2daee56250162e5a75830871601d74328d39f5' | 90 liblouis_commit_hashcode1 = '3c2daee56250162e5a75830871601d74328d39f5' |
| 91 | 91 |
| 92 chromium_revision2 = '283200' | 92 chromium_revision2 = '283296' |
| 93 webkit_revision2 = '178084' | 93 webkit_revision2 = '178200' |
| 94 breakpad_revision2 = '1345' | 94 breakpad_revision2 = '1345' |
| 95 liblouis_commit_hashcode2 = '3c2daee56250162e5a75830871601d74328d39f5' | 95 liblouis_commit_hashcode2 = '3c2daee56250162e5a75830871601d74328d39f5' |
| 96 | 96 |
| 97 def _GetContentOfDEPS(chromium_revision): | 97 def _GetContentOfDEPS(chromium_revision): |
| 98 chromium_revision = str(chromium_revision) | 98 chromium_revision = str(chromium_revision) |
| 99 if chromium_revision == chromium_revision1: | 99 if chromium_revision == chromium_revision1: |
| 100 return self.DEPS_TEMPLATE % (webkit_revision1, breakpad_revision1, | 100 return self.DEPS_TEMPLATE % (webkit_revision1, breakpad_revision1, |
| 101 liblouis_commit_hashcode1) | 101 liblouis_commit_hashcode1) |
| 102 else: | 102 else: |
| 103 self.assertEqual(chromium_revision2, chromium_revision) | 103 self.assertEqual(chromium_revision2, chromium_revision) |
| 104 return self.DEPS_TEMPLATE % (webkit_revision2, breakpad_revision2, | 104 return self.DEPS_TEMPLATE % (webkit_revision2, breakpad_revision2, |
| 105 liblouis_commit_hashcode2) | 105 liblouis_commit_hashcode2) |
| 106 | 106 |
| 107 expected_results = { | 107 expected_results = { |
| 108 'src/breakpad/src/': { | 108 'src/breakpad/src/': { |
| 109 'old_revision': breakpad_revision2, | 109 'old_revision': breakpad_revision1, |
| 110 'name': 'breakpad', | 110 'name': 'breakpad', |
| 111 'repository': 'http://google-breakpad.googlecode.com/svn/trunk/src', | 111 'repository': 'http://google-breakpad.googlecode.com/svn/trunk/src', |
| 112 'rolled': False, | 112 'rolled': False, |
| 113 'new_revision': breakpad_revision1, | 113 'new_revision': breakpad_revision2, |
| 114 'path': 'src/breakpad/src/', | 114 'path': 'src/breakpad/src/', |
| 115 'repository_type': 'svn' | 115 'repository_type': 'svn' |
| 116 }, | 116 }, |
| 117 'src/third_party/liblouis/src/': { | 117 'src/third_party/liblouis/src/': { |
| 118 'old_revision': liblouis_commit_hashcode2, | 118 'old_revision': liblouis_commit_hashcode1, |
| 119 'name': 'liblouis', | 119 'name': 'liblouis', |
| 120 'repository': | 120 'repository': |
| 121 'https://chromium.googlesource.com/external/liblouis.git', | 121 'https://chromium.googlesource.com/external/liblouis.git', |
| 122 'rolled': False, | 122 'rolled': False, |
| 123 'new_revision': liblouis_commit_hashcode1, | 123 'new_revision': liblouis_commit_hashcode2, |
| 124 'path': 'src/third_party/liblouis/src/', | 124 'path': 'src/third_party/liblouis/src/', |
| 125 'repository_type': 'git' | 125 'repository_type': 'git' |
| 126 }, | 126 }, |
| 127 'src/': { | 127 'src/': { |
| 128 'old_revision': chromium_revision2, | 128 'old_revision': chromium_revision1, |
| 129 'name': 'chromium', | 129 'name': 'chromium', |
| 130 'repository': 'https://src.chromium.org/chrome/trunk', | 130 'repository': 'https://src.chromium.org/chrome/trunk', |
| 131 'rolled': True, | 131 'rolled': True, |
| 132 'new_revision': chromium_revision1, | 132 'new_revision': chromium_revision2, |
| 133 'path': 'src/', | 133 'path': 'src/', |
| 134 'repository_type': 'svn' | 134 'repository_type': 'svn' |
| 135 }, | 135 }, |
| 136 'src/third_party/WebKit/': { | 136 'src/third_party/WebKit/': { |
| 137 'old_revision': webkit_revision2, | 137 'old_revision': webkit_revision1, |
| 138 'name': 'blink', | 138 'name': 'blink', |
| 139 'repository': 'http://src.chromium.org/blink/trunk', | 139 'repository': 'http://src.chromium.org/blink/trunk', |
| 140 'rolled': True, | 140 'rolled': True, |
| 141 'new_revision': webkit_revision1, | 141 'new_revision': webkit_revision2, |
| 142 'path': 'src/third_party/WebKit/', | 142 'path': 'src/third_party/WebKit/', |
| 143 'repository_type': 'svn' | 143 'repository_type': 'svn' |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 components = chromium_deps.GetChromiumComponentRange( | 147 components = chromium_deps.GetChromiumComponentRange( |
| 148 chromium_revision1, chromium_revision2, | 148 chromium_revision1, chromium_revision2, |
| 149 deps_file_downloader=_GetContentOfDEPS) | 149 deps_file_downloader=_GetContentOfDEPS) |
| 150 self.assertEqual(expected_results, components) | 150 self.assertEqual(expected_results, components) |
| 151 |
| 152 def testGetSvnRevision(self): |
| 153 deps = chromium_deps.GetChromiumComponents(284750) |
| 154 self.assertTrue(isinstance(deps, dict)) |
| OLD | NEW |