Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: chrome/test/functional/codesign.py

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import commands
7 import glob
8 import logging
9 import os
10 import sys
11 import unittest
12
13 import pyauto_functional # Must import before pyauto
14 import pyauto
15
16 class CodesignTest(pyauto.PyUITest):
17 """Test if the build is code signed"""
18
19 def testCodeSign(self):
20 """Check the app for codesign and bail out if it's non-branded."""
21 browser_info = self.GetBrowserInfo()
22
23 # bail out if not a branded build
24 if browser_info['properties']['branding'] != 'Google Chrome':
25 return
26
27 # TODO: Add functionality for other operating systems (see crbug.com/47902)
28 if self.IsMac():
29 self._MacCodeSign(browser_info)
30
31 def _MacCodeSign(self, browser_info):
32 valid_text = 'valid on disk'
33 app_name = 'Google Chrome.app'
34
35 # Codesign of the app @ xcodebuild/Release/Google Chrome.app/
36 app_path = browser_info['child_process_path']
37 app_path = app_path[:app_path.find(app_name)]
38 app_path = app_path + app_name
39 self.assertTrue(valid_text in self._checkCodeSign(app_path))
40
41 # Codesign of the frameWork
42 framework_path = glob.glob(os.path.join(app_path, 'Contents', 'Versions',
43 '*.*.*.*'))[0]
44 framework_path = os.path.join(framework_path,
45 'Google Chrome Framework.framework')
46 self.assertTrue(valid_text in self._checkCodeSign(framework_path))
47
48 def _checkCodeSign(self, file_path):
49 """Return the output of the codesign"""
50 return commands.getoutput('codesign -vvv "%s"' % file_path)
51
52
53 if __name__ == '__main__':
54 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/test/functional/chromoting/me2me_enable.py ('k') | chrome/test/functional/crash_reporter.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698