From 2dda85c0ef5601441f6be0a9746d582cd5d9c1a2 Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Thu, 8 Nov 2012 23:37:54 +0000 Subject: [PATCH] pyauto: Remove omnibox app search tests. Because omnibox no longer provides app search as in r166388. Tests removed: - testBasicAppSearch - testAppNameWithSpaceSearch - testAppNameWithNumberSearch - testAppComboNameWithSpecialCharSearch - testAppSearchWithVeryLongAppName - testIncognitoAppNameWithSpaceSearch - testIncognitoAppComboNameWithSpecialCharSearch - testIncognitoAppSearchWithVeryLongAppName - testRepeatedlyAppLaunchInTabs - testEndPartAppNameSearchInNewTab - testBeginningPartAppNameSearchInNewTab BUG=160086 TEST=Verify pyauto functional tests should pass. Review URL: https://codereview.chromium.org/11366158 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166800 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/functional/omnibox.py | 176 -------------------------------------- 1 file changed, 176 deletions(-) diff --git a/chrome/test/functional/omnibox.py b/chrome/test/functional/omnibox.py index 4efc36755793..75f6aac27b26 100755 --- a/chrome/test/functional/omnibox.py +++ b/chrome/test/functional/omnibox.py @@ -335,182 +335,6 @@ class OmniboxTest(pyauto.PyUITest): matches = test_utils.GetOmniboxMatchesFor(self, search_string) self.assertTrue(verify_string in matches[-1]['contents']) - def _InstallAndVerifyApp(self, app_name): - """Installs a sample packaged app and verifies the install is successful. - - Args: - app_name: The name of the app to be installed. - - Returns: - The string ID of the installed app. - """ - app_crx_file = os.path.abspath(os.path.join(self.DataDir(), - 'pyauto_private', 'apps', app_name)) - return self.InstallExtension(app_crx_file) - - def _VerifyOminiboxMatches(self, search_str, app_url, is_incognito): - """Verify app matches in omnibox. - - Args: - search_str: Search keyword to find app matches. - app_url: Chrome app launch URL. - is_incognito: A boolean indicating if omnibox matches are from an - incognito window. - """ - def OminiboxMatchFound(): - if is_incognito: - matches = test_utils.GetOmniboxMatchesFor(self, search_str, windex=2) - else: - matches = test_utils.GetOmniboxMatchesFor(self, search_str) - for x in matches: - if x['destination_url'] == app_url: - return True - return False - self.assertTrue(self.WaitUntil(OminiboxMatchFound), - msg='Timed out waiting to verify omnibox matches.') - - def _VerifyAppSearchCurrentWindow(self, app_name, search_str, app_url): - """Verify app can be searched and launched in omnibox of current window. - - Args: - app_name: The name of an installed app. - search_str: The search string to find the app from auto suggest. - app_url: Chrome app launch URL. - """ - # Assume current window is at index 0. - self._InstallAndVerifyApp(app_name) - # Get app match in omnibox of the current window. - self._VerifyOminiboxMatches(search_str, app_url, False) - # Launch app from omnibox and verify it succeeds. - self.OmniboxAcceptInput() # Blocks until the page loads. - self.assertTrue(re.search(app_url, self.GetActiveTabURL().spec())) - - def _VerifyAppSearchIncognitoWindow(self, app_name, search_str, app_url): - """Verify app can be searched and launched in omnibox of incognito window. - - Args: - app_name: The name of installed app. - search_str: The search string to find the app from auto suggest. - app_url: Chrome app launch URL. - """ - # Assume current window is at index 0. - self._InstallAndVerifyApp(app_name) - - # Get app matches in omnibox of the 3rd (incognito) window, assume - # pre-exist 1st window. We have to launch 2 incognito windows here, - # since there is an issue (crbug.com/99925) with app search in pyauto - # launched 1st incognito window on Mac. - # TODO(vivianz@): remove additional incognito window after issue 99925 is - # fixed. - self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) - self.WaitUntilOmniboxReadyHack(windex=1) - self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) - self.WaitUntilOmniboxReadyHack(windex=2) - # Get app match in omnibox of 3rd (incognito) window. - self._VerifyOminiboxMatches(search_str, app_url, True) - # Launch app from omnibox and verify it succeeds. - self.OmniboxAcceptInput(windex=2) # Blocks until the page loads. - self.assertTrue(re.search(app_url, self.GetActiveTabURL(2).spec())) - - def _VerifyAppSearchNewTab(self, app_name, search_str, app_url): - """Verify app can be searched in new tab. - - Args: - app_name: The name of installed app. - search_str: The search string to find the app from auto suggest. - app_url: Chrome app launch URL. - """ - self._InstallAndVerifyApp(app_name) - # Get app matches in omnibox of the 2nd tab. - self.AppendTab(pyauto.GURL()) - self._VerifyOminiboxMatches(search_str, app_url, False) - - def testBasicAppSearch(self): - """Verify that we can search for installed apps.""" - app_name = 'countdown.crx' - search_str = 'countdown' - app_url = 'chrome-extension:' \ - '//aeabikdlfbfeihglecobdkdflahfgcpd/launchLocalPath.html' - self._VerifyAppSearchCurrentWindow(app_name, search_str, app_url) - - def testAppNameWithSpaceSearch(self): - """Verify that we can search for apps with space in app name.""" - app_name = 'cargo_bridge.crx' - search_str = 'Cargo Bridge' - app_url = 'http://webstore.limexgames.com/cargo_bridge' - self._VerifyAppSearchCurrentWindow(app_name, search_str, app_url) - - def testAppNameWithNumberSearch(self): - """Verify that we can search for apps with number in app name.""" - app_name = '3d_stunt_pilot.crx' - search_str = '3D Stunt Pilot' - app_url = 'chrome-extension://cjhglkpjpcechghgbkdfoofgbphpgjde/index.html' - self._VerifyAppSearchCurrentWindow(app_name, search_str, app_url) - - def testAppComboNameWithSpecialCharSearch(self): - """Verify launch special character named app in regular window.""" - app_name = 'atari_lunar_lander.crx' - search_str = 'Atari - Lunar Lander' - app_url = 'http://chrome.atari.com/lunarlander/' - self._VerifyAppSearchCurrentWindow(app_name, search_str, app_url) - - def testAppSearchWithVeryLongAppName(self): - """Verify that we can search app with very long app name.""" - app_name = '20_thing_I_learn_from_browser_and_web.crx' - search_str = '20 Things I Learned About Browsers & the Web' - app_url = 'http://www.20thingsilearned.com/' - self._VerifyAppSearchCurrentWindow(app_name, search_str, app_url) - - def testIncognitoAppNameWithSpaceSearch(self): - """Verify search for apps with space in app name in incognito window.""" - app_name = 'cargo_bridge.crx' - search_str = 'Cargo Bridge' - app_url = 'http://webstore.limexgames.com/cargo_bridge' - self._VerifyAppSearchIncognitoWindow(app_name, search_str, app_url) - - def testIncognitoAppComboNameWithSpecialCharSearch(self): - """Verify launch special character named app in incognito window.""" - app_name = 'atari_lunar_lander.crx' - search_str = 'Atari - Lunar Lander' - app_url = 'http://chrome.atari.com/lunarlander/' - self._VerifyAppSearchIncognitoWindow(app_name, search_str, app_url) - - def testIncognitoAppSearchWithVeryLongAppName(self): - """Verify that we can launch app with very long app name.""" - app_name = '20_thing_I_learn_from_browser_and_web.crx' - search_str = '20 Things I Learned About Browsers & the Web' - app_url = 'http://www.20thingsilearned.com/' - self._VerifyAppSearchIncognitoWindow(app_name, search_str, app_url) - - def testRepeatedlyAppLaunchInTabs(self): - """Verify that we can repeatedly launch app in tabs.""" - app_name = '3d_stunt_pilot.crx' - search_str = '3D Stunt Pilot' - app_url = 'chrome-extension://cjhglkpjpcechghgbkdfoofgbphpgjde/index.html' - self._VerifyAppSearchNewTab(app_name, search_str, app_url) - # Launch app twice and verify it succeeds. - self.OmniboxAcceptInput() - self.assertTrue(re.search(app_url, self.GetActiveTabURL().spec())) - self.AppendTab(pyauto.GURL()) - self.SetOmniboxText(search_str) - self.OmniboxAcceptInput() - self.assertTrue(re.search(app_url, self.GetActiveTabURL().spec())) - - def testEndPartAppNameSearchInNewTab(self): - """Verify that we can search app with partial app name (end part).""" - app_name = 'countdown.crx' - search_str = 'own' - app_url = 'chrome-extension:' \ - '//aeabikdlfbfeihglecobdkdflahfgcpd/launchLocalPath.html' - self._VerifyAppSearchNewTab(app_name, search_str, app_url) - - def testBeginningPartAppNameSearchInNewTab(self): - """Verify that we can search app with partial app name (beginning part).""" - app_name = 'cargo_bridge.crx' - search_str = 'Car' - app_url = 'http://webstore.limexgames.com/cargo_bridge' - self._VerifyAppSearchNewTab(app_name, search_str, app_url) - class OmniboxLiveTest(pyauto.PyUITest): """Test cases for the omnibox that hit live servers (such as Google).""" -- 2.11.4.GIT