Chromium Code Reviews| 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] == 5 and (winver[1] == 1 or winver[1] == 2): | 23 if winver[0] == 6 and (winver[1] == 0): |
| 24 return '-vista' | |
| 25 elif winver[0] == 5 and (winver[1] == 1 or winver[1] == 2): | |
|
darin (slow to review)
2009/09/15 16:23:57
nit: no need for else after return. just do "if"
| |
| 24 return '-xp' | 26 return '-xp' |
| 25 return '' | 27 return '' |
| 26 | 28 |
| 27 def BaselineSearchPath(): | 29 def BaselineSearchPath(): |
| 28 """Returns the list of directories to search for baselines/results, in | 30 """Returns the list of directories to search for baselines/results, in |
| 29 order of preference. Paths are relative to the top of the source tree.""" | 31 order of preference. Paths are relative to the top of the source tree.""" |
| 30 dirs = [] | 32 dirs = [] |
| 33 if PlatformVersion() in ("-vista", "-xp"): | |
| 34 dirs.append(path_utils.ChromiumBaselinePath('chromium-win-vista')) | |
| 31 if PlatformVersion() == "-xp": | 35 if PlatformVersion() == "-xp": |
| 32 dirs.append(path_utils.ChromiumBaselinePath('chromium-win-xp')) | 36 dirs.append(path_utils.ChromiumBaselinePath('chromium-win-xp')) |
| 33 dirs.append(path_utils.ChromiumBaselinePath('chromium-win')) | 37 dirs.append(path_utils.ChromiumBaselinePath('chromium-win')) |
| 34 dirs.append(path_utils.WebKitBaselinePath('win')) | 38 dirs.append(path_utils.WebKitBaselinePath('win')) |
| 35 dirs.append(path_utils.WebKitBaselinePath('mac')) | 39 dirs.append(path_utils.WebKitBaselinePath('mac')) |
| 36 return dirs | 40 return dirs |
| 37 | 41 |
| 38 def WDiffPath(): | 42 def WDiffPath(): |
| 39 """Path to the WDiff executable, whose binary is checked in on Win""" | 43 """Path to the WDiff executable, whose binary is checked in on Win""" |
| 40 return path_utils.PathFromBase('third_party', 'cygwin', 'bin', 'wdiff.exe') | 44 return path_utils.PathFromBase('third_party', 'cygwin', 'bin', 'wdiff.exe') |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 | 104 |
| 101 def _FindBinary(target, binary): | 105 def _FindBinary(target, binary): |
| 102 """On Windows, we look for binaries that we compile in potentially | 106 """On Windows, we look for binaries that we compile in potentially |
| 103 two places: src/webkit/$target (preferably, which we get if we | 107 two places: src/webkit/$target (preferably, which we get if we |
| 104 built using webkit.gyp), or src/chrome/$target (if compiled some other | 108 built using webkit.gyp), or src/chrome/$target (if compiled some other |
| 105 way).""" | 109 way).""" |
| 106 try: | 110 try: |
| 107 return path_utils.PathFromBase('webkit', target, binary) | 111 return path_utils.PathFromBase('webkit', target, binary) |
| 108 except path_utils.PathNotFound: | 112 except path_utils.PathNotFound: |
| 109 return path_utils.PathFromBase('chrome', target, binary) | 113 return path_utils.PathFromBase('chrome', target, binary) |
| OLD | NEW |