OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 os | 5 import os |
6 | 6 |
7 import common | 7 import common |
8 from common import TestDriver | 8 from common import TestDriver |
9 from common import IntegrationTest | 9 from common import IntegrationTest |
10 from common import NotAndroid | 10 from decorators import NotAndroid |
11 | 11 |
12 | 12 |
13 class DataUseAscription(IntegrationTest): | 13 class DataUseAscription(IntegrationTest): |
14 | 14 |
15 # This test uses a desktop extension and cannot be run on Android. | 15 # This test uses a desktop extension and cannot be run on Android. |
16 @NotAndroid | 16 @NotAndroid |
17 def testDataUseAscription(self): | 17 def testDataUseAscription(self): |
18 ext_path = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, | 18 ext_path = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, |
19 os.pardir, 'chrome', 'test', 'data', | 19 os.pardir, 'chrome', 'test', 'data', |
20 'chromeproxy', 'extension') | 20 'chromeproxy', 'extension') |
(...skipping 14 matching lines...) Expand all Loading... |
35 'contains(text(),\'check.googlezip.net\')]') | 35 'contains(text(),\'check.googlezip.net\')]') |
36 js_xpath_query = ("document.evaluate(\"%s\", document, null, " | 36 js_xpath_query = ("document.evaluate(\"%s\", document, null, " |
37 "XPathResult.ANY_UNORDERED_NODE_TYPE, null )" | 37 "XPathResult.ANY_UNORDERED_NODE_TYPE, null )" |
38 ".singleNodeValue;" % xpath) | 38 ".singleNodeValue;" % xpath) |
39 has_expected_host = bool(t.ExecuteJavascriptStatement(js_xpath_query)) | 39 has_expected_host = bool(t.ExecuteJavascriptStatement(js_xpath_query)) |
40 self.assertTrue(has_expected_host, | 40 self.assertTrue(has_expected_host, |
41 "Test host failed to appear in data use page") | 41 "Test host failed to appear in data use page") |
42 | 42 |
43 if __name__ == '__main__': | 43 if __name__ == '__main__': |
44 IntegrationTest.RunAllTests() | 44 IntegrationTest.RunAllTests() |
OLD | NEW |