OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * @fileoverview The way these tests work is as follows: | 6 * @fileoverview The way these tests work is as follows: |
7 * C++ in net_internals_ui_browsertest.cc does any necessary setup, and then | 7 * C++ in net_internals_ui_browsertest.cc does any necessary setup, and then |
8 * calls the entry point for a test with RunJavascriptTest. The called | 8 * calls the entry point for a test with RunJavascriptTest. The called |
9 * function can then use the assert/expect functions defined in test_api.js. | 9 * function can then use the assert/expect functions defined in test_api.js. |
10 * All callbacks from the browser are wrapped in such a way that they can | 10 * All callbacks from the browser are wrapped in such a way that they can |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 */ | 49 */ |
50 typedefCppFixture: 'NetInternalsTest', | 50 typedefCppFixture: 'NetInternalsTest', |
51 | 51 |
52 /** @inheritDoc */ | 52 /** @inheritDoc */ |
53 browsePreload: 'chrome://net-internals/', | 53 browsePreload: 'chrome://net-internals/', |
54 | 54 |
55 /** @inheritDoc */ | 55 /** @inheritDoc */ |
56 isAsync: true, | 56 isAsync: true, |
57 | 57 |
58 setUp: function() { | 58 setUp: function() { |
| 59 // Enforce accessibility auditing, but suppress some false positives. |
| 60 this.accessibilityIssuesAreErrors = true; |
| 61 // False positive because a unicode character is used to draw a square. |
| 62 // If it was actual text it'd be too low-contrast, but a square is fine. |
| 63 this.accessibilityAuditConfig().ignoreSelectors( |
| 64 'lowContrastElements', '#timeline-view-selection-ul label'); |
| 65 // Suppress this error; the black-on-gray button is readable. |
| 66 this.accessibilityAuditConfig().ignoreSelectors( |
| 67 'lowContrastElements', '#export-view-save-log-file'); |
| 68 // False positive because the background color highlights and then |
| 69 // fades out with a transition when there's an error. |
| 70 this.accessibilityAuditConfig().ignoreSelectors( |
| 71 'lowContrastElements', '#hsts-view-query-output span'); |
| 72 // False positives for unknown reason. |
| 73 this.accessibilityAuditConfig().ignoreSelectors( |
| 74 'focusableElementNotVisibleAndNotAriaHidden', |
| 75 '#hsts-view-tab-content *'); |
| 76 |
59 // Wrap g_browser.receive around a test function so that assert and expect | 77 // Wrap g_browser.receive around a test function so that assert and expect |
60 // functions can be called from observers. | 78 // functions can be called from observers. |
61 g_browser.receive = | 79 g_browser.receive = |
62 this.continueTest(WhenTestDone.EXPECT, | 80 this.continueTest(WhenTestDone.EXPECT, |
63 BrowserBridge.prototype.receive.bind(g_browser)); | 81 BrowserBridge.prototype.receive.bind(g_browser)); |
64 | 82 |
65 g_browser.setPollInterval(TESTING_POLL_INTERVAL_MS); | 83 g_browser.setPollInterval(TESTING_POLL_INTERVAL_MS); |
66 | 84 |
67 var runTest = this.deferRunTest(WhenTestDone.EXPECT); | 85 var runTest = this.deferRunTest(WhenTestDone.EXPECT); |
68 | 86 |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 ]; | 722 ]; |
705 | 723 |
706 for (var i = 0; i < allIds.length; ++i) { | 724 for (var i = 0; i < allIds.length; ++i) { |
707 var curId = allIds[i]; | 725 var curId = allIds[i]; |
708 expectEquals(nodeId == curId, NetInternalsTest.nodeIsVisible($(curId))); | 726 expectEquals(nodeId == curId, NetInternalsTest.nodeIsVisible($(curId))); |
709 } | 727 } |
710 }; | 728 }; |
711 | 729 |
712 return NetInternalsTest; | 730 return NetInternalsTest; |
713 })(); | 731 })(); |
OLD | NEW |