OLD | NEW |
1 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2009 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 """This is the Linux implementation of the layout_package.platform_utils | 5 """This is the Linux implementation of the layout_package.platform_utils |
6 package. This file should only be imported by that package.""" | 6 package. This file should only be imported by that package.""" |
7 | 7 |
8 import path_utils | 8 import path_utils |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
11 | 11 |
12 def PlatformName(): | 12 def PlatformName(): |
13 """Returns the name of the platform we're currently running on.""" | 13 """Returns the name of the platform we're currently running on.""" |
14 # We're not ready for version-specific results yet. When we uncomment | 14 # We're not ready for version-specific results yet. When we uncomment |
15 # this, we also need to add it to the BaselineSearchPath() | 15 # this, we also need to add it to the BaselineSearchPath() |
16 return 'chromium-win' + PlatformVersion() | 16 return 'chromium-win' + PlatformVersion() |
17 | 17 |
18 def PlatformVersion(): | 18 def PlatformVersion(): |
19 """Returns the version string for the platform, e.g. '-vista' or | 19 """Returns the version string for the platform, e.g. '-vista' or |
20 '-snowleopard'. If the platform does not distinguish between | 20 '-snowleopard'. If the platform does not distinguish between |
21 minor versions, it returns ''.""" | 21 minor versions, it returns ''.""" |
22 winver = sys.getwindowsversion() | 22 winver = sys.getwindowsversion() |
| 23 if winver[0] == 6 and (winver[1] == 1): |
| 24 return '-7' |
23 if winver[0] == 6 and (winver[1] == 0): | 25 if winver[0] == 6 and (winver[1] == 0): |
24 return '-vista' | 26 return '-vista' |
25 if winver[0] == 5 and (winver[1] == 1 or winver[1] == 2): | 27 if winver[0] == 5 and (winver[1] == 1 or winver[1] == 2): |
26 return '-xp' | 28 return '-xp' |
27 return '' | 29 return '' |
28 | 30 |
29 def BaselineSearchPath(all_versions=False): | 31 def BaselineSearchPath(all_versions=False): |
30 """Returns the list of directories to search for baselines/results, in | 32 """Returns the list of directories to search for baselines/results, in |
31 order of preference. Paths are relative to the top of the source tree. | 33 order of preference. Paths are relative to the top of the source tree. |
32 | 34 |
33 If all_versions is True, returns the full list of search directories | 35 If all_versions is True, returns the full list of search directories |
34 for all versions instead of the current version that the script | 36 for all versions instead of the current version that the script |
35 is running on. This is for case that the platform or version of | 37 is running on. This is for case that the platform or version of |
36 the search paths is different from the platform or version that the | 38 the search paths is different from the platform or version that the |
37 script is running on. For example, the rebaseline tool may run on Mac, | 39 script is running on. For example, the rebaseline tool may run on Mac, |
38 Linux or Windows Vista to rebaseline for Windows XP, in which case, | 40 Linux or Windows Vista to rebaseline for Windows XP, in which case, |
39 it gets a full list, finds the rebaselining dir (XP) and compares | 41 it gets a full list, finds the rebaselining dir (XP) and compares |
40 the XP baseline with fallback baselines. | 42 the XP baseline with fallback baselines. |
41 """ | 43 """ |
42 | 44 |
43 dirs = [] | 45 dirs = [] |
| 46 if all_versions or PlatformVersion() in ("-7", "-vista", "-xp"): |
| 47 dirs.append(path_utils.ChromiumBaselinePath('chromium-win-7')) |
44 if all_versions or PlatformVersion() in ("-vista", "-xp"): | 48 if all_versions or PlatformVersion() in ("-vista", "-xp"): |
45 dirs.append(path_utils.ChromiumBaselinePath('chromium-win-vista')) | 49 dirs.append(path_utils.ChromiumBaselinePath('chromium-win-vista')) |
46 if all_versions or PlatformVersion() == "-xp": | 50 if all_versions or PlatformVersion() == "-xp": |
47 dirs.append(path_utils.ChromiumBaselinePath('chromium-win-xp')) | 51 dirs.append(path_utils.ChromiumBaselinePath('chromium-win-xp')) |
48 dirs.append(path_utils.ChromiumBaselinePath('chromium-win')) | 52 dirs.append(path_utils.ChromiumBaselinePath('chromium-win')) |
49 dirs.append(path_utils.WebKitBaselinePath('win')) | 53 dirs.append(path_utils.WebKitBaselinePath('win')) |
50 dirs.append(path_utils.WebKitBaselinePath('mac')) | 54 dirs.append(path_utils.WebKitBaselinePath('mac')) |
51 return dirs | 55 return dirs |
52 | 56 |
53 def WDiffPath(): | 57 def WDiffPath(): |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 two places: src/webkit/$target (preferably, which we get if we | 138 two places: src/webkit/$target (preferably, which we get if we |
135 built using webkit.gyp), or src/chrome/$target (if compiled some other | 139 built using webkit.gyp), or src/chrome/$target (if compiled some other |
136 way).""" | 140 way).""" |
137 try: | 141 try: |
138 return path_utils.PathFromBase('webkit', target, binary) | 142 return path_utils.PathFromBase('webkit', target, binary) |
139 except path_utils.PathNotFound: | 143 except path_utils.PathNotFound: |
140 try: | 144 try: |
141 return path_utils.PathFromBase('chrome', target, binary) | 145 return path_utils.PathFromBase('chrome', target, binary) |
142 except path_utils.PathNotFound: | 146 except path_utils.PathNotFound: |
143 return path_utils.PathFromBase('build', target, binary) | 147 return path_utils.PathFromBase('build', target, binary) |
OLD | NEW |