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

Side by Side Diff: tools/chrome_proxy/webdriver/safebrowsing.py

Issue 2823253002: Refactor decorators into thier own python class (Closed)
Patch Set: Forgot to add new decorators class Created 3 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 unified diff | Download patch
OLDNEW
1 # Copyright 2017 The Chromium Authors. All rights reserved. 1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import common 5 import common
6 from common import TestDriver 6 from common import TestDriver
7 from common import IntegrationTest 7 from common import IntegrationTest
8 from common import AndroidOnly 8 from decorators import AndroidOnly
9 from common import NotAndroid 9 from decorators import NotAndroid
10 10
11 11
12 class SafeBrowsing(IntegrationTest): 12 class SafeBrowsing(IntegrationTest):
13 13
14 @AndroidOnly 14 @AndroidOnly
15 def testSafeBrowsingOn(self): 15 def testSafeBrowsingOn(self):
16 with TestDriver() as t: 16 with TestDriver() as t:
17 t.AddChromeArg('--enable-spdy-proxy-auth') 17 t.AddChromeArg('--enable-spdy-proxy-auth')
18 t.LoadURL('http://testsafebrowsing.appspot.com/s/malware.html') 18 t.LoadURL('http://testsafebrowsing.appspot.com/s/malware.html')
19 responses = t.GetHTTPResponses() 19 responses = t.GetHTTPResponses()
20 self.assertEqual(0, len(responses)) 20 self.assertEqual(0, len(responses))
21 21
22 @NotAndroid 22 @NotAndroid
23 def testSafeBrowsingOff(self): 23 def testSafeBrowsingOff(self):
24 with TestDriver() as t: 24 with TestDriver() as t:
25 t.AddChromeArg('--enable-spdy-proxy-auth') 25 t.AddChromeArg('--enable-spdy-proxy-auth')
26 t.LoadURL('http://testsafebrowsing.appspot.com/s/malware.html') 26 t.LoadURL('http://testsafebrowsing.appspot.com/s/malware.html')
27 responses = t.GetHTTPResponses() 27 responses = t.GetHTTPResponses()
28 self.assertEqual(1, len(responses)) 28 self.assertEqual(1, len(responses))
29 for response in responses: 29 for response in responses:
30 self.assertHasChromeProxyViaHeader(response) 30 self.assertHasChromeProxyViaHeader(response)
31 31
32 if __name__ == '__main__': 32 if __name__ == '__main__':
33 IntegrationTest.RunAllTests() 33 IntegrationTest.RunAllTests()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698