From 765f31094cf6cb7ea4962486c63a5fdffcbfeb65 Mon Sep 17 00:00:00 2001 From: "nirnimesh@chromium.org" Date: Tue, 13 Apr 2010 18:39:02 +0000 Subject: Add tests to verify special tabs like chrome://history chrome://downloads, ... Most tests from krisr Review URL: http://codereview.chromium.org/1541009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44374 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/functional/special_tabs.py | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 chrome/test/functional/special_tabs.py (limited to 'chrome/test/functional/special_tabs.py') diff --git a/chrome/test/functional/special_tabs.py b/chrome/test/functional/special_tabs.py new file mode 100644 index 0000000..654d147 --- /dev/null +++ b/chrome/test/functional/special_tabs.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import pyauto_functional # Must be imported before pyauto +import pyauto + + +class SpecialTabsTest(pyauto.PyUITest): + """TestCase for Special Tabs like about:version, chrome://history, etc.""" + + special_accelerator_tabs = { + pyauto.IDC_SHOW_HISTORY: 'History', + pyauto.IDC_MANAGE_EXTENSIONS: 'Extensions', + pyauto.IDC_SHOW_DOWNLOADS: 'Downloads', + } + + special_url_tabs = { + 'about:': 'About Version', + 'about:dns': 'About DNS', + 'about:histograms': 'About Histograms', + 'about:plugins': 'Plug-ins', + 'about:sync': 'About Sync', + 'about:version': 'About Version', + 'chrome://downloads': 'Downloads', + 'chrome://extensions': 'Extensions', + 'chrome://history': 'History', + 'chrome://net-internals': 'Network internals', + } + + def testSpecialAccleratorTabs(self): + """Test special tabs created by acclerators like IDC_SHOW_HISTORY, + IDC_SHOW_DOWNLOADS.""" + for accel, title in self.special_accelerator_tabs.iteritems(): + self.RunCommand(accel) + self.assertEqual(title, self.GetActiveTabTitle()) + + def testSpecialURLTabs(self): + """Test special tabs created by URLs like chrome://downloads, + chrome://extensions, chrome://history, etc.""" + for url, title in self.special_url_tabs.iteritems(): + self.NavigateToURL(url) + self.assertEqual(title, self.GetActiveTabTitle()) + + +if __name__ == '__main__': + pyauto_functional.Main() + -- cgit v1.1