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

Side by Side Diff: functional/extensions.py

Issue 7794011: Add new test for top extension adblock crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 9 years, 3 months 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
« no previous file with comments | « data/extensions/adblock.crx ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 """ 6 """
7 This module is a simple qa tool that installs extensions and tests whether the 7 This module is a simple qa tool that installs extensions and tests whether the
8 browser crashes while visiting a list of urls. 8 browser crashes while visiting a list of urls.
9 9
10 Usage: python extensions.py -v 10 Usage: python extensions.py -v
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 # Allow extension in incognito mode and verify. 178 # Allow extension in incognito mode and verify.
179 self.SetExtensionStateById(ext_id, enable=True, allow_in_incognito=True) 179 self.SetExtensionStateById(ext_id, enable=True, allow_in_incognito=True)
180 extension = self._GetExtensionInfoById(self.GetExtensionsInfo(), ext_id) 180 extension = self._GetExtensionInfoById(self.GetExtensionsInfo(), ext_id)
181 self.assertTrue(extension['allowed_in_incognito']) 181 self.assertTrue(extension['allowed_in_incognito'])
182 182
183 # Disallow extension in incognito mode and verify. 183 # Disallow extension in incognito mode and verify.
184 self.SetExtensionStateById(ext_id, enable=True, allow_in_incognito=False) 184 self.SetExtensionStateById(ext_id, enable=True, allow_in_incognito=False)
185 extension = self._GetExtensionInfoById(self.GetExtensionsInfo(), ext_id) 185 extension = self._GetExtensionInfoById(self.GetExtensionsInfo(), ext_id)
186 self.assertFalse(extension['allowed_in_incognito']) 186 self.assertFalse(extension['allowed_in_incognito'])
187 187
188 def testAdblockExtensionCrash(self):
189 """Test AdBlock extension successfully installed and enabled, and do not
190 cause browser crash.
191 """
192 crx_file_path = os.path.abspath(
193 os.path.join(self.DataDir(), 'extensions', 'adblock.crx'))
194 ext_id = self.InstallExtension(crx_file_path, False);
195 self.assertTrue(ext_id, msg='Failed to install extension.')
196
197 self.RestartBrowser(clear_profile=False)
198 extension = self._GetExtensionInfoById(self.GetExtensionsInfo(), ext_id)
199 self.assertTrue(extension['is_enabled'])
200 self.assertFalse(extension['allowed_in_incognito'])
201
188 202
189 if __name__ == '__main__': 203 if __name__ == '__main__':
190 pyauto_functional.Main() 204 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « data/extensions/adblock.crx ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698