OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 logging | 6 import logging |
7 import os | 7 import os |
8 import subprocess | 8 import subprocess |
9 import re | 9 import re |
10 | 10 |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 self.FindInPage('encrypted.google.com', tab_index=0)['match_count'], | 536 self.FindInPage('encrypted.google.com', tab_index=0)['match_count'], |
537 msg='SPDY is not enabled.') | 537 msg='SPDY is not enabled.') |
538 | 538 |
539 def testSetDownloadDirectory(self): | 539 def testSetDownloadDirectory(self): |
540 """Verify that the downloads directory and prompt for download preferences | 540 """Verify that the downloads directory and prompt for download preferences |
541 can be modified. | 541 can be modified. |
542 """ | 542 """ |
543 if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome': | 543 if self.GetBrowserInfo()['properties']['branding'] != 'Google Chrome': |
544 return | 544 return |
545 if self.IsWin(): | 545 if self.IsWin(): |
546 download_default_dir = os.path.join(os.getenv('USERPROFILE'),'Downloads') | 546 download_default_dir = self.GetDownloadDirectory().value() |
547 self.assertEqual(download_default_dir, | 547 self.assertEqual(download_default_dir, |
548 self.GetPrefsInfo().Prefs()['download']['default_directory'], | 548 self.GetPrefsInfo().Prefs()['download']['default_directory'], |
549 msg='Downloads directory is not set correctly.') | 549 msg='Downloads directory is not set correctly.') |
550 # Check for changing the download directory location | 550 # Check for changing the download directory location |
551 self.SetPrefs(pyauto.kDownloadDefaultDirectory, | 551 self.SetPrefs(pyauto.kDownloadDefaultDirectory, |
552 os.getenv('USERPROFILE')) | 552 os.getenv('USERPROFILE')) |
553 elif self.IsLinux(): | 553 elif self.IsLinux(): |
554 download_default_dir = os.path.join(os.getenv('HOME'), 'Downloads') | 554 download_default_dir = os.path.join(os.getenv('HOME'), 'Downloads') |
555 self.assertEqual(download_default_dir, | 555 self.assertEqual(download_default_dir, |
556 self.GetPrefsInfo().Prefs()['download']['default_directory'], | 556 self.GetPrefsInfo().Prefs()['download']['default_directory'], |
(...skipping 25 matching lines...) Expand all Loading... |
582 return | 582 return |
583 url = self.GetFileURLForDataPath('plugin', 'java_new.html') | 583 url = self.GetFileURLForDataPath('plugin', 'java_new.html') |
584 self.NavigateToURL(url) | 584 self.NavigateToURL(url) |
585 self.assertTrue(self.WaitForInfobarCount(1)) | 585 self.assertTrue(self.WaitForInfobarCount(1)) |
586 pid = self._GetPluginPID('Java') | 586 pid = self._GetPluginPID('Java') |
587 self.assertFalse(pid, 'There is a plugin process for java') | 587 self.assertFalse(pid, 'There is a plugin process for java') |
588 | 588 |
589 | 589 |
590 if __name__ == '__main__': | 590 if __name__ == '__main__': |
591 pyauto_functional.Main() | 591 pyauto_functional.Main() |
OLD | NEW |