summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 20:43:30 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 20:43:30 +0000
commit84ab80a72ab70e823d3331955e36c1759ec95f1f (patch)
treef8085d1648972b9fcace7dc6f95d03d527c7e903 /chrome/test/functional
parentceaf8f1cf5f8166f4583db7957eadcacf073aab9 (diff)
downloadchromium_src-84ab80a72ab70e823d3331955e36c1759ec95f1f.zip
chromium_src-84ab80a72ab70e823d3331955e36c1759ec95f1f.tar.gz
chromium_src-84ab80a72ab70e823d3331955e36c1759ec95f1f.tar.bz2
Fixed a minor issue within test_utils that was causing find_in_page download test to fail.
Remove private download function from browsing_data and referenced it to test_utils. Review URL: http://codereview.chromium.org/4191007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65107 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional')
-rw-r--r--chrome/test/functional/PYAUTO_TESTS11
-rw-r--r--chrome/test/functional/browsing_data.py25
-rw-r--r--chrome/test/functional/test_utils.py4
3 files changed, 15 insertions, 25 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS
index dad55c1..5f4d2a1 100644
--- a/chrome/test/functional/PYAUTO_TESTS
+++ b/chrome/test/functional/PYAUTO_TESTS
@@ -50,11 +50,12 @@
# 'sync', crbug.com/60970
'test_basic.SimpleTest.testCanOpenGoogle',
'themes',
- 'translate',
- # This test fails due to crbug.com/35485
- '-translate.TranslateTest.testBarNotVisibleOnSSLErrorPage',
- # This test fails due to crbug.com/50706
- '-translate.TranslateTest.testToggleTranslateOption',
+ # Disable translate test until it can run fine on golo. crbug.com/61256
+ # 'translate',
+ ## This test fails due to crbug.com/35485
+ # '-translate.TranslateTest.testBarNotVisibleOnSSLErrorPage',
+ ## This test fails due to crbug.com/50706
+ # '-translate.TranslateTest.testToggleTranslateOption',
],
'win': [
diff --git a/chrome/test/functional/browsing_data.py b/chrome/test/functional/browsing_data.py
index c569807..3cc4b09 100644
--- a/chrome/test/functional/browsing_data.py
+++ b/chrome/test/functional/browsing_data.py
@@ -8,25 +8,12 @@ import time
import pyauto_functional # Must be imported before pyauto
import pyauto
+import test_utils
class BrowsingDataTest(pyauto.PyUITest):
"""Tests that clearing browsing data works correctly."""
- def _DownloadTestFile(self, file_name):
- """Downloads the specified file from the 'downloads' directory and waits
- for downloads to complete.
- """
- test_dir = os.path.join(self.DataDir(), 'downloads')
- file_path = os.path.join(test_dir, file_name)
- file_url = self.GetFileURLForPath(file_path)
- downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(),
- file_name)
- os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
- self.DownloadAndWaitForStart(file_url)
- self.WaitForAllDownloadsToComplete()
- os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg)
-
def _GetURLForFile(self, file_name):
"""Returns the url for the file in the 'data' directory."""
return self.GetFileURLForPath(os.path.join(self.DataDir(), file_name))
@@ -55,8 +42,9 @@ class BrowsingDataTest(pyauto.PyUITest):
def testClearDownloads(self):
"""Verify clearing downloads."""
+ zip_file = 'a_zip_file.zip'
# First build up some data with downloads.
- self._DownloadTestFile('a_zip_file.zip')
+ test_utils.DownloadFileFromDownloadsDataDir(self, zip_file)
self.assertEqual(1, len(self.GetDownloadsInfo().Downloads()))
# Clear the downloads and verify they're gone.
self.ClearBrowsingData(['DOWNLOADS'], 'EVERYTHING')
@@ -92,9 +80,10 @@ class BrowsingDataTest(pyauto.PyUITest):
def testClearHistoryAndDownloads(self):
"""Verify that we can clear history and downloads at the same time."""
+ zip_file = 'a_zip_file.zip'
# First build up some history and download something.
self.NavigateToURL(self._GetURLForFile('title2.html'))
- self._DownloadTestFile('a_zip_file.zip')
+ test_utils.DownloadFileFromDownloadsDataDir(self, zip_file)
# Verify that the history and download exist.
self.assertEqual(1, len(self.GetHistoryInfo().History()))
@@ -109,10 +98,10 @@ class BrowsingDataTest(pyauto.PyUITest):
def testClearingAccuracy(self):
"""Verify that clearing one thing does not clear another."""
+ zip_file = 'a_zip_file.zip'
# First build up some history and download something.
self.NavigateToURL(self._GetURLForFile('title2.html'))
- self._DownloadTestFile('a_zip_file.zip')
-
+ test_utils.DownloadFileFromDownloadsDataDir(self, zip_file)
# Verify that the history and download exist.
self.assertEqual(1, len(self.GetHistoryInfo().History()))
self.assertEqual(1, len(self.GetDownloadsInfo().Downloads()))
diff --git a/chrome/test/functional/test_utils.py b/chrome/test/functional/test_utils.py
index 838e85e..a5fd8ee 100644
--- a/chrome/test/functional/test_utils.py
+++ b/chrome/test/functional/test_utils.py
@@ -24,9 +24,9 @@ def DownloadFileFromDownloadsDataDir(test, file_name):
file_url = test.GetFileURLForPath(file_path)
downloaded_pkg = os.path.join(test.GetDownloadDirectory().value(),
file_name)
- # Check if zip file already exists. If so then delete it.
+ # Check if file already exists. If so then delete it.
if os.path.exists(downloaded_pkg):
- self.RemoveDownloadedTestFile(test, file_name)
+ RemoveDownloadedTestFile(test, file_name)
test.DownloadAndWaitForStart(file_url)
test.WaitForAllDownloadsToComplete()