Commit e689f18b authored by dyu@chromium.org's avatar dyu@chromium.org

Adding pyAuto tests for Chrome Instant features for:

1. testInstantDisabledInIncognito - instant should be disabled in incognito mode
2. testInstantOverlayNotStoredInHistory - instant overlay page not stored in history
3. testInstantDisabledForJavaScript - instant disabled for javascript urls

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6325003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71490 0039d316-1c4b-4281-b951-d872f2087c98
parent 3f03f1f2
......@@ -4,6 +4,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import pyauto_functional # Must be imported before pyauto
import pyauto
......@@ -40,6 +42,27 @@ class InstantTest(pyauto.PyUITest):
self.assertTrue('google.com' in location,
msg='No google.com in %s' % location)
def testInstantDisabledInIncognito(self):
"""Test that instant is disabled in Incognito mode."""
self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
self.SetOmniboxText('google.com', windex=1)
self.assertFalse(self.GetInstantInfo()['active'],
'Instant enabled in Incognito mode.')
def testInstantOverlayNotStoredInHistory(self):
"""Test that instant overlay page is not stored in history."""
url = self.GetFileURLForPath(os.path.join(self.DataDir(), 'title2.html'))
self.SetOmniboxText(url)
self.assertTrue(self.WaitUntil(self._DoneLoading))
history = self.GetHistoryInfo().History()
self.assertEqual(0, len(history))
def testInstantDisabledForJavaScript(self):
"""Test that instant is disabled for javascript URLs."""
self.SetOmniboxText('javascript:')
self.assertFalse(self.GetInstantInfo()['active'],
'Instant enabled for javascript URL.')
if __name__ == '__main__':
pyauto_functional.Main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment