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): | |
| 67 """Test that instant does not preview pron words until | |
| 68 user presses Enter key.""" | |
| 69 porn_words = ['porn', 'xxx', 'sex videos', 'sex clips'] | |
| 70 for search_word in porn_words: | |
| 71 self.SetOmniboxText(search_word) | |
| 72 self.assertTrue(self.WaitUntil(self._DoneLoading)) | |
|
Allen
2011/01/19 22:43:25
a note: this pass condition isn't the expected beh
| |
| 73 self.assertTrue(self.GetInstantInfo()['showing'], | |
| 74 'User can preview porn words without enter key') | |
|
Nirnimesh
2011/01/18 20:05:50
Be consistent. use msg=
| |
| 75 | |
| 76 def testFindInCanDismissInstant(self): | |
| 77 """Test that instant preview is dismissed by find-in-page.""" | |
| 78 self.SetOmniboxText('google.com') | |
| 79 self.assertTrue(self.WaitUntil(self._DoneLoading)) | |
| 80 location = self.GetInstantInfo()['location'] | |
| 81 self.assertTrue('google.com' in location, | |
| 82 msg='No google.com in %s' % location) | |
| 83 self.OpenFindInPage() | |
| 84 self.assertEqual(self.GetActiveTabTitle(), '') | |
| 66 | 85 |
| 67 if __name__ == '__main__': | 86 if __name__ == '__main__': |
| 68 pyauto_functional.Main() | 87 pyauto_functional.Main() |
| OLD | NEW |