summaryrefslogtreecommitdiffstats
path: root/chrome/test/functional
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 20:22:17 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 20:22:17 +0000
commitb172783e9129bb9c8c34130d16e3b777f7fca3ea (patch)
tree3724aabfe509af020deb55013dd7bd9d41b0271c /chrome/test/functional
parentb84194157dcf0044df4634ebd279d05a5107bb7e (diff)
downloadchromium_src-b172783e9129bb9c8c34130d16e3b777f7fca3ea.zip
chromium_src-b172783e9129bb9c8c34130d16e3b777f7fca3ea.tar.gz
chromium_src-b172783e9129bb9c8c34130d16e3b777f7fca3ea.tar.bz2
Expose BrowserProxy and TabProxy methods directly to PyAuto
- Swig scoped_refptr so as to make BrowserProxy and TabProxy objects directly visible and callable, although the use of scoped_refptr is transparent to pyauto user - Fix a crash in BookmarkModel.FindByID() while operating on leaf nodes - Expose methods to set preferences - Expose methods to handle http auth prompts - Add a pyauto test to verify the restore-on-start preference - Fix path so that pydoc continues to work on pyauto.py Review URL: http://codereview.chromium.org/1536001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional')
-rw-r--r--chrome/test/functional/prefs.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/chrome/test/functional/prefs.py b/chrome/test/functional/prefs.py
new file mode 100644
index 0000000..c02332b
--- /dev/null
+++ b/chrome/test/functional/prefs.py
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import logging
+
+import pyauto_functional # Must be imported before pyauto
+import pyauto
+
+
+class PrefsTest(pyauto.PyUITest):
+ """TestCase for Preferences."""
+
+ def testSessionRestore(self):
+ url1 = 'http://www.google.com/'
+ url2 = 'http://news.google.com/'
+ self.NavigateToURL(url1)
+ self.AppendTab(pyauto.GURL(url2))
+ num_tabs = self.GetTabCount()
+ # Set pref to restore session on startup
+ browser = self.GetBrowserWindow(0)
+ browser.SetIntPreference(pyauto.kRestoreOnStartup, 1)
+ logging.debug('Setting %s to 1' % pyauto.kRestoreOnStartup)
+ self.CloseBrowserAndServer() # Close browser
+ self.set_clear_profile(False) # Do not clear profile on next startup
+ self.LaunchBrowserAndServer() # Reopen browser
+ self.assertEqual(num_tabs, self.GetTabCount())
+ self.ActivateTab(0)
+ self.assertEqual(url1, self.GetActiveTabURL().spec())
+ self.ActivateTab(1)
+ self.assertEqual(url2, self.GetActiveTabURL().spec())
+ self.set_clear_profile(True) # Restore the flag to clear profile next
+
+
+if __name__ == '__main__':
+ pyauto_functional.Main()
+