OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 | 7 |
8 import pyauto_functional # must be imported before pyauto | 8 import pyauto_functional # must be imported before pyauto |
9 import pyauto | 9 import pyauto |
10 | 10 |
11 | 11 |
12 class ChromeosHTMLTerminalTest(pyauto.PyUITest): | 12 class ChromeosHTMLTerminalTest(pyauto.PyUITest): |
13 """Basic tests for ChromeOS HTML Terminal. | 13 """Basic tests for ChromeOS HTML Terminal. |
14 | 14 |
15 Requires ChromeOS to be logged in. | 15 Requires ChromeOS to be logged in. |
16 """ | 16 """ |
17 | 17 |
18 def _GetExtensionInfoById(self, extensions, id): | 18 def _GetExtensionInfoById(self, extensions, id): |
19 for x in extensions: | 19 for x in extensions: |
20 if x['id'] == id: | 20 if x['id'] == id: |
21 return x | 21 return x |
22 return None | 22 return None |
23 | 23 |
24 def testInstallHTMLTerminal(self): | 24 def testInstallHTMLTerminal(self): |
25 """Basic installation test for HTML Terminal on ChromeOS.""" | 25 """Basic installation test for HTML Terminal on ChromeOS.""" |
26 crx_file_path = os.path.abspath( | 26 crx_file_path = os.path.abspath( |
27 os.path.join(self.DataDir(), 'pyauto_private', 'apps', | 27 os.path.join(self.DataDir(), 'pyauto_private', 'apps', |
28 'hterm-dev-0.7.6.3.crx')) | 28 'SecureShell-dev-0.7.9.3.crx')) |
Nirnimesh
2012/04/25 01:08:16
Please add the file first.
| |
29 ext_id = self.InstallExtension(crx_file_path) | 29 ext_id = self.InstallExtension(crx_file_path) |
30 self.assertTrue(ext_id, 'Failed to install extension.') | 30 self.assertTrue(ext_id, 'Failed to install extension.') |
31 extension = self._GetExtensionInfoById(self.GetExtensionsInfo(), ext_id) | 31 extension = self._GetExtensionInfoById(self.GetExtensionsInfo(), ext_id) |
32 self.assertTrue(extension['is_enabled'], | 32 self.assertTrue(extension['is_enabled'], |
33 msg='Extension was not enabled on installation.') | 33 msg='Extension was not enabled on installation.') |
34 self.assertFalse(extension['allowed_in_incognito'], | 34 self.assertFalse(extension['allowed_in_incognito'], |
35 msg='Extension was allowed in incognito on installation.') | 35 msg='Extension was allowed in incognito on installation.') |
36 | 36 |
37 | 37 |
38 if __name__ == '__main__': | 38 if __name__ == '__main__': |
39 pyauto_functional.Main() | 39 pyauto_functional.Main() |
OLD | NEW |