| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 self.DownloadAndWaitForStart(file_url) | 152 self.DownloadAndWaitForStart(file_url) |
| 153 self.WaitForAllDownloadsToComplete() | 153 self.WaitForAllDownloadsToComplete() |
| 154 os.path.exists(downloaded_file) and os.remove(downloaded_file) | 154 os.path.exists(downloaded_file) and os.remove(downloaded_file) |
| 155 # We shouldn't have any history | 155 # We shouldn't have any history |
| 156 history = self.GetHistoryInfo().History() | 156 history = self.GetHistoryInfo().History() |
| 157 self.assertEqual(0, len(history)) | 157 self.assertEqual(0, len(history)) |
| 158 | 158 |
| 159 def testRedirectHistory(self): | 159 def testRedirectHistory(self): |
| 160 """HTTP meta-refresh redirects should have separate history entries.""" | 160 """HTTP meta-refresh redirects should have separate history entries.""" |
| 161 assert not self.GetHistoryInfo().History(), 'Expecting clean history.' | 161 assert not self.GetHistoryInfo().History(), 'Expecting clean history.' |
| 162 test_dir = os.path.join(os.path.abspath(self.DataDir()), 'history') | 162 test_dir = os.path.join(os.path.abspath(self.DataDir()), 'History') |
| 163 file_url = self.GetFileURLForPath(os.path.join(test_dir, 'redirector.html')) | 163 file_url = self.GetFileURLForPath(os.path.join(test_dir, 'redirector.html')) |
| 164 landing_url = self.GetFileURLForPath(os.path.join(test_dir, 'landing.html')) | 164 landing_url = self.GetFileURLForPath(os.path.join(test_dir, 'landing.html')) |
| 165 tab = self.GetBrowserWindow(0).GetTab(0) | 165 tab = self.GetBrowserWindow(0).GetTab(0) |
| 166 tab.NavigateToURLBlockUntilNavigationsComplete(pyauto.GURL(file_url), 2) | 166 tab.NavigateToURLBlockUntilNavigationsComplete(pyauto.GURL(file_url), 2) |
| 167 self.assertEqual(landing_url, self.GetActiveTabURL().spec()) | 167 self.assertEqual(landing_url, self.GetActiveTabURL().spec()) |
| 168 # We should have two history items | 168 # We should have two history items |
| 169 history = self.GetHistoryInfo().History() | 169 history = self.GetHistoryInfo().History() |
| 170 self.assertEqual(2, len(history)) | 170 self.assertEqual(2, len(history)) |
| 171 self.assertEqual(landing_url, history[0]['url']) | 171 self.assertEqual(landing_url, history[0]['url']) |
| 172 | 172 |
| 173 | 173 |
| 174 if __name__ == '__main__': | 174 if __name__ == '__main__': |
| 175 pyauto_functional.Main() | 175 pyauto_functional.Main() |
| OLD | NEW |