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

Side by Side Diff: chrome/test/functional/history.py

Issue 9696018: Update pyauto tests to work with the uber page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: rebase Created 8 years, 9 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 | « chrome/test/functional/extensions.py ('k') | chrome/test/functional/policy.py » ('j') | 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/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 os 6 import os
7 import time 7 import time
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 'SUCCESS', 320 'SUCCESS',
321 self.GetDOMValue('document.getElementById("result").innerHTML')) 321 self.GetDOMValue('document.getElementById("result").innerHTML'))
322 self._CheckHistory('Target Page', url2, 2) 322 self._CheckHistory('Target Page', url2, 2)
323 323
324 def testOneHistoryTabPerWindow(self): 324 def testOneHistoryTabPerWindow(self):
325 """Verify history shortcut opens only one history tab per window. 325 """Verify history shortcut opens only one history tab per window.
326 326
327 Also, make sure that existing history tab is activated. 327 Also, make sure that existing history tab is activated.
328 """ 328 """
329 command_line = self.GetBrowserInfo()['properties']['command_line_string'] 329 command_line = self.GetBrowserInfo()['properties']['command_line_string']
330 if '--disable-uber-page' in command_line.split(): 330 history_url = 'chrome://history-frame/'
331 history_url = 'chrome://history-frame/'
332 else:
333 history_url = 'chrome://chrome/history/'
334 331
335 # Invoke History. 332 # Invoke History.
336 self.RunCommand(pyauto.IDC_SHOW_HISTORY) 333 self.RunCommand(pyauto.IDC_SHOW_HISTORY)
337 self.assertEqual('History', self.GetActiveTabTitle(), 334 self.assertEqual('History', self.GetActiveTabTitle(),
338 msg='History page was not opened.') 335 msg='History page was not opened.')
339 336
340 # Open new tab, invoke History again. 337 # Open new tab, invoke History again.
341 self.RunCommand(pyauto.IDC_NEW_TAB) 338 self.RunCommand(pyauto.IDC_NEW_TAB)
342 self.RunCommand(pyauto.IDC_SHOW_HISTORY) 339 self.RunCommand(pyauto.IDC_SHOW_HISTORY)
343 340
344 # Verify there is only one history tab, and that it is activated. 341 # Verify there is only one history tab, and that it is activated.
345 tab0url = self.GetBrowserInfo()['windows'][0]['tabs'][0]['url'] 342 tab0url = self.GetBrowserInfo()['windows'][0]['tabs'][0]['url']
346 self.assertEqual( 343 self.assertEqual(
347 history_url, tab0url, msg='Tab 0: expected = %s, actual = %s.' 344 history_url, tab0url, msg='Tab 0: expected = %s, actual = %s.'
348 % (history_url, tab0url)) 345 % (history_url, tab0url))
349 346
350 tab1url = self.GetBrowserInfo()['windows'][0]['tabs'][1]['url'] 347 tab1url = self.GetBrowserInfo()['windows'][0]['tabs'][1]['url']
351 self.assertNotEqual( 348 self.assertNotEqual(
352 history_url, tab1url, 349 history_url, tab1url,
353 msg='Tab 1: History page not expected.') 350 msg='Tab 1: History page not expected.')
354 351
355 self.assertEqual('History', self.GetActiveTabTitle(), 352 self.assertEqual('History', self.GetActiveTabTitle(),
356 msg='History page is not activated.') 353 msg='History page is not activated.')
357 354
358 355
359 if __name__ == '__main__': 356 if __name__ == '__main__':
360 pyauto_functional.Main() 357 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/test/functional/extensions.py ('k') | chrome/test/functional/policy.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698