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

Unified Diff: tools/chrome_proxy/webdriver/safebrowsing.py

Issue 2724503002: ChromeDriver test replacements for SafebrowserOn/SafebrowserOff (Closed)
Patch Set: Verify Chrome proxy used for Off test Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/safebrowsing.py
diff --git a/tools/chrome_proxy/webdriver/safebrowsing.py b/tools/chrome_proxy/webdriver/safebrowsing.py
new file mode 100644
index 0000000000000000000000000000000000000000..cdfe2ec055b98801ded6574b14d8fbc9f7400f34
--- /dev/null
+++ b/tools/chrome_proxy/webdriver/safebrowsing.py
@@ -0,0 +1,33 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import common
+from common import TestDriver
+from common import IntegrationTest
+from common import AndroidOnly
+from common import NotAndroid
+
+
+class SafeBrowsing(IntegrationTest):
+
+ @AndroidOnly
+ def testSafeBrowsingOn(self):
+ with TestDriver() as t:
+ t.AddChromeArg('--enable-spdy-proxy-auth')
+ t.LoadURL('http://testsafebrowsing.appspot.com/s/malware.html')
+ responses = t.GetHTTPResponses()
+ self.assertEqual(0, len(responses))
+
+ @NotAndroid
+ def testSafeBrowsingOff(self):
+ with TestDriver() as t:
+ t.AddChromeArg('--enable-spdy-proxy-auth')
+ t.LoadURL('http://testsafebrowsing.appspot.com/s/malware.html')
+ responses = t.GetHTTPResponses()
+ self.assertEqual(1, len(responses))
+ for response in responses:
+ self.assertHasChromeProxyViaHeader(response)
+
+if __name__ == '__main__':
+ IntegrationTest.RunAllTests()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698