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

Unified Diff: functional/omnibox.py

Issue 5115007: Omnibox tests for,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 10 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: functional/omnibox.py
===================================================================
--- functional/omnibox.py (revision 66899)
+++ functional/omnibox.py (working copy)
@@ -3,10 +3,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import glob
import os
import re
import shutil
import tempfile
+import time
import pyauto_functional # Must be imported before pyauto
import pyauto
@@ -213,6 +215,34 @@
# Verify there are no suggest results
self.assertFalse([x for x in matches if x['type'] == 'search-suggest'])
+ def testContentHisotry(self):
+ """Verify the history page in omnibox based on content
+ of the visited page"""
+ search_text = "British throne"
+ url = self.GetFileURLForPath(
+ os.path.join(self.DataDir(), 'find_in_page', 'largepage.html'))
+ self.AppendTab(pyauto.GURL(url))
+ # To store page content in the history table, Chrome needs at least
+ # 1 sec of delay.
+ time.sleep(1)
Nirnimesh 2010/11/22 19:48:14 no sleep please. use WaitUntil
+ matches = self._GetOmniboxMatchesFor(search_text)
+ matches_description = [x for x in matches if x['destination_url'] == url]
+ self.assertEqual(1, len(matches_description))
+ def testRecentPageHistory(self):
+ """Verify that omnibox shows recent history option in the visited
+ url list."""
+ sites = glob.glob(os.path.join(self.DataDir(), 'find_in_page', '*.html'))
+ for site in sites:
+ self.NavigateToURL(self.GetFileURLForPath(site))
+ # Chrome takes around 40 seconds to create the recent history option
+ # in the omnibox visited urls list.
+ time.sleep(40)
Nirnimesh 2010/11/22 19:48:14 no sleep please. Use waitUntil so that you end up
+ matches = self._GetOmniboxMatchesFor("file")
+ matches_description = [x for x in matches if x['type'] ==
+ 'open-history-page']
+ self.assertEqual(1, len(matches_description))
+
+
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698