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

Side by Side Diff: functional/enterprise.py

Issue 7558006: Use the pyauto API to get the default download directory since XP has a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 9 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698