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 cgi | 6 import cgi |
7 import os | 7 import os |
8 | 8 |
9 import pyauto_functional # Must be imported before pyauto | 9 import pyauto_functional # Must be imported before pyauto |
10 import pyauto | 10 import pyauto |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 """Test that instant preview is dismissed by find-in-page.""" | 160 """Test that instant preview is dismissed by find-in-page.""" |
161 self._BringUpInstant() | 161 self._BringUpInstant() |
162 self.OpenFindInPage() | 162 self.OpenFindInPage() |
163 self.assertEqual(self.GetActiveTabTitle(), 'New Tab') | 163 self.assertEqual(self.GetActiveTabTitle(), 'New Tab') |
164 | 164 |
165 def testNTPCanDismissInstant(self): | 165 def testNTPCanDismissInstant(self): |
166 """Test that instant preview is dismissed by adding new tab page.""" | 166 """Test that instant preview is dismissed by adding new tab page.""" |
167 self.NavigateToURL('about:blank'); | 167 self.NavigateToURL('about:blank'); |
168 self._BringUpInstant() | 168 self._BringUpInstant() |
169 self.AppendTab(pyauto.GURL('chrome://newtab')) | 169 self.AppendTab(pyauto.GURL('chrome://newtab')) |
170 self.GetBrowserWindow(0).GetTab(1).Close(True) | 170 self.CloseTab(tab_index=1) |
171 self.assertEqual(self.GetActiveTabTitle(), 'about:blank') | 171 self.assertEqual(self.GetActiveTabTitle(), 'about:blank') |
172 | 172 |
173 def testExtnPageCanDismissInstant(self): | 173 def testExtnPageCanDismissInstant(self): |
174 """Test that instant preview is dismissed by extension page.""" | 174 """Test that instant preview is dismissed by extension page.""" |
175 self._BringUpInstant() | 175 self._BringUpInstant() |
176 self.AppendTab(pyauto.GURL('chrome://extensions')) | 176 self.AppendTab(pyauto.GURL('chrome://extensions')) |
177 self.GetBrowserWindow(0).GetTab(1).Close(True) | 177 self.CloseTab(tab_index=1) |
178 self.assertEqual(self.GetActiveTabTitle(), 'New Tab') | 178 self.assertEqual(self.GetActiveTabTitle(), 'New Tab') |
179 | 179 |
180 def testNewWindowCanDismissInstant(self): | 180 def testNewWindowCanDismissInstant(self): |
181 """Test that instant preview is dismissed by New Window.""" | 181 """Test that instant preview is dismissed by New Window.""" |
182 self._BringUpInstant() | 182 self._BringUpInstant() |
183 self.OpenNewBrowserWindow(True) | 183 self.OpenNewBrowserWindow(True) |
184 self.CloseBrowserWindow(1) | 184 self.CloseBrowserWindow(1) |
185 self.assertEqual(self.GetActiveTabTitle(), 'New Tab') | 185 self.assertEqual(self.GetActiveTabTitle(), 'New Tab') |
186 | 186 |
187 def testPreFetchInstantURLNotInHistory(self): | 187 def testPreFetchInstantURLNotInHistory(self): |
(...skipping 21 matching lines...) Expand all Loading... |
209 self._AssertInstantDoesNotDownloadFile(os.path.join('zip', 'test.zip')) | 209 self._AssertInstantDoesNotDownloadFile(os.path.join('zip', 'test.zip')) |
210 | 210 |
211 def testInstantDoesNotDownloadPDFFile(self): | 211 def testInstantDoesNotDownloadPDFFile(self): |
212 """Test that instant does not download PDF file.""" | 212 """Test that instant does not download PDF file.""" |
213 self._AssertInstantDoesNotDownloadFile(os.path.join('printing', | 213 self._AssertInstantDoesNotDownloadFile(os.path.join('printing', |
214 'cloud_print_unittest.pdf')) | 214 'cloud_print_unittest.pdf')) |
215 | 215 |
216 | 216 |
217 if __name__ == '__main__': | 217 if __name__ == '__main__': |
218 pyauto_functional.Main() | 218 pyauto_functional.Main() |
OLD | NEW |