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

Unified Diff: chrome/test/functional/protector.py

Issue 10298012: [protector] Disable the UI by default, flip --no-protector to --protector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/protector.py
diff --git a/chrome/test/functional/protector.py b/chrome/test/functional/protector.py
index 2b9fab6f2acf99deae6c8b0dd8243932fa653f02..65cc3945a6c2b872e27cc21482730066f0e2169d 100755
--- a/chrome/test/functional/protector.py
+++ b/chrome/test/functional/protector.py
@@ -34,6 +34,20 @@ class BaseProtectorTest(pyauto.PyUITest):
# _GetDefaultSearchEngine call.
self._new_default_search_keyword = None
+ def _IsEnabled(self):
+ """Whether protector should be enabled for the test suite."""
+ return True
+
+ def ExtraChromeFlags(self):
+ """Adds required Protector-related flags.
+
+ Returns:
+ A list of extra flags to pass to Chrome when it is launched.
+ """
+ return super(BaseProtectorTest, self).ExtraChromeFlags() + [
+ '--protector' if self._IsEnabled() else '--no-protector'
+ ]
+
def _GetDefaultSearchEngine(self):
"""Returns the default search engine, if any; None otherwise.
@@ -659,21 +673,9 @@ class ProtectorHomepageTest(BaseProtectorTest):
class ProtectorDisabledTest(BaseProtectorTest):
"""Test suite for Protector in disabled state."""
- def ExtraChromeFlags(self):
- """Ensures Protector is disabled.
-
- Returns:
- A list of extra flags to pass to Chrome when it is launched.
- """
- return super(ProtectorDisabledTest, self).ExtraChromeFlags() + [
- '--no-protector'
- ]
-
- def testInfobarIsPresent(self):
- """Verify that an infobar is present when running Chrome with --no-protector
- flag.
- """
- self.assertTrue(self.GetBrowserInfo()['windows'][0]['tabs'][0]['infobars'])
+ def _IsEnabled(self):
+ """Overriden from BaseProtectorTest to disable Protector."""
+ return False
def testNoSearchEngineChangeReported(self):
"""Test that the default search engine change is neither reported to user
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698