Chromium Code Reviews| 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..f9031ce074de4aaceae8937a5c4d516ca55b68b9 |
| --- /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://www.ianfette.org/') |
|
Robert Ogden
2017/03/01 16:57:07
Go ahead and use http://testsafebrowsing.appspot.c
dougarnett
2017/03/01 21:56:47
Done.
|
| + 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://www.ianfette.org/') |
|
Robert Ogden
2017/03/01 16:57:07
Go ahead and use http://testsafebrowsing.appspot.c
dougarnett
2017/03/01 21:56:47
Done.
|
| + responses = t.GetHTTPResponses() |
| + self.assertEqual(1, len(responses)) |
| + for response in responses: |
| + self.assertEqual('http://www.ianfette.org/', response.url) |
|
Robert Ogden
2017/03/01 16:57:07
Instead of checking the URL, check that is used th
dougarnett
2017/03/01 21:56:47
Done.
|
| + |
| +if __name__ == '__main__': |
| + IntegrationTest.RunAllTests() |