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

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

Issue 10534163: First pass at refactoring pyautolib in preparation for removing proxy dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Previous commit was reverted. Changed IPCs to be backwards compatible with old chrome binaries. Created 8 years, 5 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/automation/browser_proxy.cc ('k') | chrome/test/pyautolib/pyautolib.h » ('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 unittest 6 import unittest
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 import pyauto_errors 10 import pyauto_errors
(...skipping 24 matching lines...) Expand all
35 self.assertEqual(self.FindInPage(flag)['match_count'], 1, 35 self.assertEqual(self.FindInPage(flag)['match_count'], 1,
36 msg='Missing expected Chrome flag "%s"' % flag) 36 msg='Missing expected Chrome flag "%s"' % flag)
37 37
38 def testCallOnInvalidWindow(self): 38 def testCallOnInvalidWindow(self):
39 """Verify that exception is raised when a browser is missing/invalid.""" 39 """Verify that exception is raised when a browser is missing/invalid."""
40 self.assertEqual(1, self.GetBrowserWindowCount()) 40 self.assertEqual(1, self.GetBrowserWindowCount())
41 self.assertRaises( 41 self.assertRaises(
42 pyauto_errors.JSONInterfaceError, 42 pyauto_errors.JSONInterfaceError,
43 lambda: self.FindInPage('some text', windex=1)) # invalid window 43 lambda: self.FindInPage('some text', windex=1)) # invalid window
44 44
45 def testJSONInterfaceTimeout(self):
46 """Verify that an exception is raised when the JSON interface times out."""
47 self.ClearEventQueue()
48 self.AddDomEventObserver('foo')
49 self.assertRaises(
50 pyauto_errors.JSONInterfaceError,
51 lambda: self.GetNextEvent(timeout=2000)) # event queue is empty
52
53
45 54
46 if __name__ == '__main__': 55 if __name__ == '__main__':
47 pyauto_functional.Main() 56 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/test/automation/browser_proxy.cc ('k') | chrome/test/pyautolib/pyautolib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698