Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: chrome/test/functional/ntp.py

Issue 8649004: Allow chromedriver to install an extension and get all installed extension IDs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import copy 6 import copy
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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 398 }
399 ] 399 ]
400 expected_app_info.extend(self._EXPECTED_DEFAULT_APPS) 400 expected_app_info.extend(self._EXPECTED_DEFAULT_APPS)
401 self._VerifyAppInfo(app_info, expected_app_info) 401 self._VerifyAppInfo(app_info, expected_app_info)
402 402
403 def testGetAppsWhenInstallNonApps(self): 403 def testGetAppsWhenInstallNonApps(self):
404 """Ensures installed non-apps are not reflected in the NTP app info.""" 404 """Ensures installed non-apps are not reflected in the NTP app info."""
405 # Install a regular extension and a theme. 405 # Install a regular extension and a theme.
406 ext_crx_file = os.path.abspath(os.path.join(self.DataDir(), 'extensions', 406 ext_crx_file = os.path.abspath(os.path.join(self.DataDir(), 'extensions',
407 'page_action.crx')) 407 'page_action.crx'))
408 self.assertTrue(self.InstallExtension(ext_crx_file, False), 408 self.InstallExtension(ext_crx_file)
409 msg='Extension install failed.')
410 theme_crx_file = os.path.abspath(os.path.join(self.DataDir(), 'extensions', 409 theme_crx_file = os.path.abspath(os.path.join(self.DataDir(), 'extensions',
411 'theme.crx')) 410 'theme.crx'))
412 self.assertTrue(self.SetTheme(theme_crx_file), msg='Theme install failed.') 411 self.SetTheme(theme_crx_file)
413 # Verify that no apps are listed on the NTP except for the Web Store. 412 # Verify that no apps are listed on the NTP except for the Web Store.
414 app_info = self.GetNTPApps() 413 app_info = self.GetNTPApps()
415 self._VerifyAppInfo(app_info, self._EXPECTED_DEFAULT_APPS) 414 self._VerifyAppInfo(app_info, self._EXPECTED_DEFAULT_APPS)
416 415
417 def testUninstallApp(self): 416 def testUninstallApp(self):
418 """Ensures that an uninstalled app is reflected in the NTP app info.""" 417 """Ensures that an uninstalled app is reflected in the NTP app info."""
419 # First, install an app and verify that it exists in the NTP app info. 418 # First, install an app and verify that it exists in the NTP app info.
420 installed_app_id = self._InstallAndVerifySamplePackagedApp() 419 installed_app_id = self._InstallAndVerifySamplePackagedApp()
421 app_info = self.GetNTPApps() 420 app_info = self.GetNTPApps()
422 expected_app_info = [ 421 expected_app_info = [
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 info = self.GetBrowserInfo() 523 info = self.GetBrowserInfo()
525 self.assertTrue(len(info['windows']) == 2, 524 self.assertTrue(len(info['windows']) == 2,
526 msg='A second window does not exist.') 525 msg='A second window does not exist.')
527 actual_tab_url = info['windows'][1]['tabs'][0]['url'] 526 actual_tab_url = info['windows'][1]['tabs'][0]['url']
528 expected_app_url_start = 'chrome-extension://' + installed_app_id 527 expected_app_url_start = 'chrome-extension://' + installed_app_id
529 self.assertTrue(actual_tab_url.startswith(expected_app_url_start), 528 self.assertTrue(actual_tab_url.startswith(expected_app_url_start),
530 msg='The app was not launched in the new window.') 529 msg='The app was not launched in the new window.')
531 530
532 if __name__ == '__main__': 531 if __name__ == '__main__':
533 pyauto_functional.Main() 532 pyauto_functional.Main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698