Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 glob | 6 import glob |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import shutil | 9 import shutil |
| 10 import tempfile | 10 import tempfile |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 294 | 294 |
| 295 Test verifies that visited page shows up in omnibox on entering page | 295 Test verifies that visited page shows up in omnibox on entering page |
| 296 content. | 296 content. |
| 297 """ | 297 """ |
| 298 url = self.GetFileURLForPath( | 298 url = self.GetFileURLForPath( |
| 299 os.path.join(self.DataDir(), 'find_in_page', 'largepage.html')) | 299 os.path.join(self.DataDir(), 'find_in_page', 'largepage.html')) |
| 300 self.NavigateToURL(url) | 300 self.NavigateToURL(url) |
| 301 self.assertTrue(self.WaitUntil( | 301 self.assertTrue(self.WaitUntil( |
| 302 lambda: self._GotContentHistory('British throne', url))) | 302 lambda: self._GotContentHistory('British throne', url))) |
| 303 | 303 |
| 304 def testOmniboxSearchHistory(self): | |
| 305 """Verify Page navigation/search from omnibox are added | |
|
Nirnimesh
2011/05/19 18:33:55
This should be a one liner.
| |
| 306 to the history.""" | |
| 307 url = self.GetFileURLForDataPath('title2.html') | |
| 308 self.NavigateToURL(url) | |
| 309 self.AppendTab(pyauto.GURL('about:blank')) | |
| 310 self.SetOmniboxText('venkat') | |
|
Nirnimesh
2011/05/19 18:33:55
don't use names. Use some other random string.
Ple
| |
| 311 self.OmniboxAcceptInput() | |
| 312 history = self.GetHistoryInfo().History() | |
| 313 self.assertEqual(2, len(history)) | |
| 314 self.assertEqual(url, history[1]['url']) | |
| 315 self.assertEqual('venkat - Google Search', history[0]['title']) | |
| 316 | |
| 304 def _VerifyHasBookmarkResult(self, matches): | 317 def _VerifyHasBookmarkResult(self, matches): |
| 305 """Verify that we have a bookmark result.""" | 318 """Verify that we have a bookmark result.""" |
| 306 matches_starred = [result for result in matches if result['starred']] | 319 matches_starred = [result for result in matches if result['starred']] |
| 307 self.assertTrue(matches_starred) | 320 self.assertTrue(matches_starred) |
| 308 self.assertEqual(1, len(matches_starred)) | 321 self.assertEqual(1, len(matches_starred)) |
| 309 | 322 |
| 310 def testBookmarkResultInNewTabAndWindow(self): | 323 def testBookmarkResultInNewTabAndWindow(self): |
| 311 """Verify that omnibox can recognize a bookmark within search options | 324 """Verify that omnibox can recognize a bookmark within search options |
| 312 in new tabs and windows.""" | 325 in new tabs and windows.""" |
| 313 url = self.GetFileURLForDataPath('title2.html') | 326 url = self.GetFileURLForDataPath('title2.html') |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 325 self.NavigateToURL(url, 1, 0) | 338 self.NavigateToURL(url, 1, 0) |
| 326 self._CheckBookmarkResultForVariousInputs(url, title, windex=1) | 339 self._CheckBookmarkResultForVariousInputs(url, title, windex=1) |
| 327 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) | 340 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) |
| 328 self.assertEqual(3, self.GetBrowserWindowCount()) | 341 self.assertEqual(3, self.GetBrowserWindowCount()) |
| 329 self.NavigateToURL(url, 2, 0) | 342 self.NavigateToURL(url, 2, 0) |
| 330 self._CheckBookmarkResultForVariousInputs(url, title, windex=2) | 343 self._CheckBookmarkResultForVariousInputs(url, title, windex=2) |
| 331 | 344 |
| 332 | 345 |
| 333 if __name__ == '__main__': | 346 if __name__ == '__main__': |
| 334 pyauto_functional.Main() | 347 pyauto_functional.Main() |
| OLD | NEW |