diff options
author | dennisjeffrey@google.com <dennisjeffrey@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 23:02:38 +0000 |
---|---|---|
committer | dennisjeffrey@google.com <dennisjeffrey@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 23:02:38 +0000 |
commit | 03dac83aaa429772c8123cc4124c489cd53c7f20 (patch) | |
tree | ddf8442835c1149871c9211f7b16370774e61557 /chrome | |
parent | 6abed3d861ff00f89b7407a902c2c19e5ae60a16 (diff) | |
download | chromium_src-03dac83aaa429772c8123cc4124c489cd53c7f20.zip chromium_src-03dac83aaa429772c8123cc4124c489cd53c7f20.tar.gz chromium_src-03dac83aaa429772c8123cc4124c489cd53c7f20.tar.bz2 |
Fix NTP PyAuto tests on ChromeOS related to menu/thumbnail mode.
Fix and re-enable PyAuto tests that were failing on ChromeOS due to differences in default menu/thumbnail mode preferences between Chrome and ChromeOS.
BUG=crosbug.com/14150
TEST=None.
Review URL: http://codereview.chromium.org/6878060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/test/functional/PYAUTO_TESTS | 5 | ||||
-rw-r--r-- | chrome/test/functional/ntp.py | 77 |
2 files changed, 36 insertions, 46 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS index a0fac42..6506086 100644 --- a/chrome/test/functional/PYAUTO_TESTS +++ b/chrome/test/functional/PYAUTO_TESTS @@ -257,11 +257,6 @@ '-https.HTTPSTest.testSSLPageBasic', '-instant', '-notifications', - '-ntp.NTPTest.testGetMenuModeInNewProfile', - '-ntp.NTPTest.testGetThumbnailModeInNewProfile', - '-ntp.NTPTest.testLaunchAppFullScreen', - '-ntp.NTPTest.testSetMenuModeOn', - '-ntp.NTPTest.testSetThumbnailModeOff', '-omnibox.OmniboxTest.testBookmarkResultInNewTabAndWindow', '-omnibox.OmniboxTest.testContentHistory', '-omnibox.OmniboxTest.testDifferentTypesOfResults', diff --git a/chrome/test/functional/ntp.py b/chrome/test/functional/ntp.py index ea7a02f..b6f12aa 100644 --- a/chrome/test/functional/ntp.py +++ b/chrome/test/functional/ntp.py @@ -20,6 +20,29 @@ class NTPTest(pyauto.PyUITest): if pyauto.PyUITest.IsChromeOS(): _EXPECTED_DEFAULT_APPS.append({u'name': u'Get Started'}) + # Default menu and thumbnail mode preferences are set in + # ShownSectionsHandler::RegisterUserPrefs. + if pyauto.PyUITest.IsChromeOS(): + _EXPECTED_DEFAULT_THUMB_INFO = { + u'apps': True, + u'most_visited': False + } + _EXPECTED_DEFAULT_MENU_INFO = { + u'apps': False, + u'most_visited': True, + u'recently_closed': True + } + else: + _EXPECTED_DEFAULT_THUMB_INFO = { + u'apps': False, + u'most_visited': True + } + _EXPECTED_DEFAULT_MENU_INFO = { + u'apps': False, + u'most_visited': False, + u'recently_closed': False + } + def Debug(self): """Test method for experimentation. @@ -527,18 +550,14 @@ class NTPTest(pyauto.PyUITest): def testGetThumbnailModeInNewProfile(self): """Ensures only the most visited thumbnails are present in a new profile.""" thumb_info = self.GetNTPThumbnailMode() - expected_thumb_info = { - u'apps': False, - u'most_visited': True - } - self._VerifyThumbnailOrMenuMode(thumb_info, expected_thumb_info) + self._VerifyThumbnailOrMenuMode(thumb_info, + self._EXPECTED_DEFAULT_THUMB_INFO) def testSetThumbnailModeOn(self): """Ensures that we can turn on thumbnail mode properly.""" - # Initially, only the Most Visited section should be in thumbnail mode. # Turn on thumbnail mode for the Apps section and verify that only this - # section is in thumbnail mode (thumbnail mode for the Most Visited section - # should be turned off). + # section is in thumbnail mode (since at most one section can be in + # thumbnail mode at any given time). self.SetNTPThumbnailMode('apps', True) thumb_info = self.GetNTPThumbnailMode() expected_thumb_info = { @@ -570,8 +589,8 @@ class NTPTest(pyauto.PyUITest): def testSetThumbnailModeOff(self): """Ensures that we can turn off thumbnail mode properly.""" - # Initially, only the Most Visited section should be in thumbnail mode. - # Verify this. + # First, ensure that only the Most Visited section is in thumbnail mode. + self.SetNTPThumbnailMode('most_visited', True) thumb_info = self.GetNTPThumbnailMode() expected_thumb_info = { u'apps': False, @@ -592,33 +611,20 @@ class NTPTest(pyauto.PyUITest): # remains off. self.SetNTPThumbnailMode('most_visited', False) thumb_info = self.GetNTPThumbnailMode() - expected_thumb_info = { - u'apps': False, - u'most_visited': False - } self._VerifyThumbnailOrMenuMode(thumb_info, expected_thumb_info) def testGetMenuModeInNewProfile(self): """Ensures that all NTP sections are not in menu mode in a fresh profile.""" menu_info = self.GetNTPMenuMode() - expected_menu_info = { - u'apps': False, - u'most_visited': False, - u'recently_closed': False - } - self._VerifyThumbnailOrMenuMode(menu_info, expected_menu_info) + self._VerifyThumbnailOrMenuMode(menu_info, self._EXPECTED_DEFAULT_MENU_INFO) def testSetMenuModeOn(self): """Ensures that we can turn on menu mode properly.""" - # Initially, all NTP sections have menu mode turned off. # Turn on menu mode for the Apps section and verify that it's turned on. self.SetNTPMenuMode('apps', True) menu_info = self.GetNTPMenuMode() - expected_menu_info = { - u'apps': True, - u'most_visited': False, - u'recently_closed': False - } + expected_menu_info = self._EXPECTED_DEFAULT_MENU_INFO + expected_menu_info[u'apps'] = True self._VerifyThumbnailOrMenuMode(menu_info, expected_menu_info) # Turn on menu mode for the remaining sections and verify that they're all @@ -626,11 +632,8 @@ class NTPTest(pyauto.PyUITest): self.SetNTPMenuMode('most_visited', True) self.SetNTPMenuMode('recently_closed', True) menu_info = self.GetNTPMenuMode() - expected_menu_info = { - u'apps': True, - u'most_visited': True, - u'recently_closed': True - } + expected_menu_info[u'most_visited'] = True + expected_menu_info[u'recently_closed'] = True self._VerifyThumbnailOrMenuMode(menu_info, expected_menu_info) def testSetMenuModeOff(self): @@ -652,22 +655,14 @@ class NTPTest(pyauto.PyUITest): self.SetNTPMenuMode('most_visited', False) self.SetNTPMenuMode('recently_closed', False) menu_info = self.GetNTPMenuMode() - expected_menu_info = { - u'apps': False, - u'most_visited': False, - u'recently_closed': False - } + expected_menu_info[u'most_visited'] = False + expected_menu_info[u'recently_closed'] = False self._VerifyThumbnailOrMenuMode(menu_info, expected_menu_info) # Turn off menu mode for the Apps section again, and verify that it # remains off. self.SetNTPMenuMode('apps', False) menu_info = self.GetNTPMenuMode() - expected_menu_info = { - u'apps': False, - u'most_visited': False, - u'recently_closed': False - } self._VerifyThumbnailOrMenuMode(menu_info, expected_menu_info) def testSetThumbnailModeDoesNotAffectMenuModeAndViceVersa(self): |