Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import os | 7 import os |
| 8 | 8 |
| 9 import pyauto_functional # Must be imported before pyauto | 9 import pyauto_functional # Must be imported before pyauto |
| 10 import pyauto | 10 import pyauto |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 self.assertTrue(self.WaitUntil(self._DoneLoading)) | 56 self.assertTrue(self.WaitUntil(self._DoneLoading)) |
| 57 history = self.GetHistoryInfo().History() | 57 history = self.GetHistoryInfo().History() |
| 58 self.assertEqual(0, len(history)) | 58 self.assertEqual(0, len(history)) |
| 59 | 59 |
| 60 def testInstantDisabledForJavaScript(self): | 60 def testInstantDisabledForJavaScript(self): |
| 61 """Test that instant is disabled for javascript URLs.""" | 61 """Test that instant is disabled for javascript URLs.""" |
| 62 self.SetOmniboxText('javascript:') | 62 self.SetOmniboxText('javascript:') |
| 63 self.assertFalse(self.GetInstantInfo()['active'], | 63 self.assertFalse(self.GetInstantInfo()['active'], |
| 64 'Instant enabled for javascript URL.') | 64 'Instant enabled for javascript URL.') |
| 65 | 65 |
| 66 def testPornNavigation(self): | |
|
Nirnimesh
2011/01/15 00:14:34
Yeah baby!
| |
| 67 """Test that instant does not navigate porn sites until | |
| 68 user presses Enter key.""" | |
| 69 self.SetOmniboxText('porn') | |
| 70 self.assertTrue(self.WaitUntil(self._DoneLoading)) | |
| 71 self.assertTrue(self.GetInstantInfo()['active'], | |
| 72 'Press Enter to search') | |
|
Nirnimesh
2011/01/15 00:14:34
This error mesg is unclear
| |
| 73 self.SetOmniboxText('xxx') | |
|
Nirnimesh
2011/01/15 00:14:34
Instead of repeating these 3 lines (which's basica
| |
| 74 self.assertTrue(self.WaitUntil(self._DoneLoading)) | |
| 75 self.assertTrue(self.GetInstantInfo()['active'], | |
| 76 'Press Enter to search') | |
| 77 | |
| 78 def testFindInCanDismissInstant(self): | |
| 79 """Test that instant previvew is dismissed by find-in-page.""" | |
|
Nirnimesh
2011/01/15 00:14:34
s/previvew/preview/
| |
| 80 self.SetOmniboxText('google.com') | |
| 81 self.assertTrue(self.WaitUntil(self._DoneLoading)) | |
| 82 location = self.GetInstantInfo()['location'] | |
| 83 self.assertTrue('google.com' in location, | |
| 84 msg='No google.com in %s' % location) | |
| 85 self.OpenFindInPage() | |
| 86 self.assertEqual(self.GetActiveTabTitle(), '') | |
| 66 | 87 |
| 67 if __name__ == '__main__': | 88 if __name__ == '__main__': |
| 68 pyauto_functional.Main() | 89 pyauto_functional.Main() |
| OLD | NEW |