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

Unified Diff: chrome/test/pyautolib/history_info.py

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/pyautolib/generate_docs.py ('k') | chrome/test/pyautolib/mock_pref_pane.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/history_info.py
===================================================================
--- chrome/test/pyautolib/history_info.py (revision 261231)
+++ chrome/test/pyautolib/history_info.py (working copy)
@@ -1,77 +0,0 @@
-# Copyright (c) 2011 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.
-
-"""History: python representation for history.
-
-Obtain one of these from PyUITestSuite::GetHistoryInfo() call.
-
-Example:
-class MyTest(pyauto.PyUITest):
- def testBasic(self):
- url = 'http://www.google.com/'
- self.NavigateToURL(url)
- history = self.GetHistoryInfo()
- self.assertEqual(1, len(history))
- self.assertEqual(url, history[0]['url'])
-
-See more tests in chrome/test/functional/history.py.
-"""
-
-import simplejson as json
-
-from pyauto_errors import JSONInterfaceError
-
-
-class HistoryInfo(object):
- """Represent info about browsing history.
-
- The info is represented as a list of history items containing url, title,
- time, etc.
- """
- def __init__(self, history_dict):
- """Initialize a HistoryInfo from a string of json.
-
- Args:
- json_string: a dictionary as returned by the IPC command 'GetHistoryInfo'.
- A typical dict representing history info looks like:
- {'history': [
- {'url': 'http://www.google.com/',
- 'title': 'Google',
- ...,
- ...,
- }, ] }
-
- Raises:
- pyauto_errors.JSONInterfaceError if the automation call returns an error.
- """
- # JSON string prepared in GetHistoryInfo() in automation_provider.cc
- self.historydict = history_dict
-
- def History(self):
- """Get history list.
-
- History is ordered latest first, that is in the same order as
- chrome://history/ would list.
-
- Example:
- [ { u'snippet': u'',
- u'starred': False,
- u'time': 1271781612,
- u'title': u'Google News',
- u'url': u'http://news.google.com/'},
- { u'snippet': u'',
- u'starred': True,
- u'time': 1271781602,
- u'title': u'Google',
- u'url': u'http://www.google.com/'}]
-
- The snippet attribute will be empty in most cases. If GetHistoryInfo() is
- provided a non-empty search_text arg, the snippet attribute will contain the
- snippet as it would be visible when searching for that text in the
- chrome://history/ UI.
-
- Returns:
- [item1, item2, ...]
- """
- return self.historydict.get('history', [])
« no previous file with comments | « chrome/test/pyautolib/generate_docs.py ('k') | chrome/test/pyautolib/mock_pref_pane.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698