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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 setUp: function() { | 58 setUp: function() { |
59 testing.Test.prototype.setUp.call(this); | 59 testing.Test.prototype.setUp.call(this); |
60 | 60 |
61 // Enforce accessibility auditing, but suppress some false positives. | 61 // Enforce accessibility auditing, but suppress some false positives. |
62 this.accessibilityIssuesAreErrors = true; | 62 this.accessibilityIssuesAreErrors = true; |
63 // False positive because a unicode character is used to draw a square. | 63 // False positive because a unicode character is used to draw a square. |
64 // If it was actual text it'd be too low-contrast, but a square is fine. | 64 // If it was actual text it'd be too low-contrast, but a square is fine. |
65 this.accessibilityAuditConfig.ignoreSelectors( | 65 this.accessibilityAuditConfig.ignoreSelectors( |
66 'lowContrastElements', '#timeline-view-selection-ul label'); | 66 'lowContrastElements', '#timeline-view-selection-ul label'); |
67 // Suppress this error; the black-on-gray button is readable. | |
68 this.accessibilityAuditConfig.ignoreSelectors( | |
69 'lowContrastElements', '#export-view-save-log-file'); | |
70 // False positive because the background color highlights and then | 67 // False positive because the background color highlights and then |
71 // fades out with a transition when there's an error. | 68 // fades out with a transition when there's an error. |
72 this.accessibilityAuditConfig.ignoreSelectors( | 69 this.accessibilityAuditConfig.ignoreSelectors( |
73 'lowContrastElements', '#hsts-view-query-output span'); | 70 'lowContrastElements', '#hsts-view-query-output span'); |
74 // False positives for unknown reason. | 71 // False positives for unknown reason. |
75 this.accessibilityAuditConfig.ignoreSelectors( | 72 this.accessibilityAuditConfig.ignoreSelectors( |
76 'focusableElementNotVisibleAndNotAriaHidden', | 73 'focusableElementNotVisibleAndNotAriaHidden', |
77 '#hsts-view-tab-content *'); | 74 '#hsts-view-tab-content *'); |
78 | 75 |
79 // TODO(aboxhall): enable when this bug is fixed: | 76 // TODO(aboxhall): enable when this bug is fixed: |
80 // https://github.com/GoogleChrome/accessibility-developer-tools/issues/69 | 77 // https://github.com/GoogleChrome/accessibility-developer-tools/issues/69 |
81 this.accessibilityAuditConfig.auditRulesToIgnore.push( | 78 this.accessibilityAuditConfig.auditRulesToIgnore.push( |
82 'focusableElementNotVisibleAndNotAriaHidden'); | 79 'focusableElementNotVisibleAndNotAriaHidden'); |
83 | 80 |
84 var controlsWithoutLabelSelectors = [ | 81 var controlsWithoutLabelSelectors = [ |
85 '#export-view-user-comments', | |
86 '#hsts-view-add-input', | 82 '#hsts-view-add-input', |
87 '#hsts-view-delete-input', | 83 '#hsts-view-delete-input', |
88 '#hsts-view-query-input', | 84 '#hsts-view-query-input', |
89 ]; | 85 ]; |
90 | 86 |
91 // Enable when failure is resolved. | 87 // Enable when failure is resolved. |
92 // AX_TEXT_01: http://crbug.com/559203 | 88 // AX_TEXT_01: http://crbug.com/559203 |
93 this.accessibilityAuditConfig.ignoreSelectors( | 89 this.accessibilityAuditConfig.ignoreSelectors( |
94 'controlsWithoutLabel', | 90 'controlsWithoutLabel', |
95 controlsWithoutLabelSelectors); | 91 controlsWithoutLabelSelectors); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 */ | 293 */ |
298 NetInternalsTest.getTabId = function(hash) { | 294 NetInternalsTest.getTabId = function(hash) { |
299 /** | 295 /** |
300 * Map of tab ids to location hashes. Since the text fixture must be | 296 * Map of tab ids to location hashes. Since the text fixture must be |
301 * runnable independent of net-internals, for generating the test's cc | 297 * runnable independent of net-internals, for generating the test's cc |
302 * files, must be careful to only create this map while a test is running. | 298 * files, must be careful to only create this map while a test is running. |
303 * @type {object.<string, string>} | 299 * @type {object.<string, string>} |
304 */ | 300 */ |
305 var hashToTabIdMap = { | 301 var hashToTabIdMap = { |
306 capture: CaptureView.TAB_ID, | 302 capture: CaptureView.TAB_ID, |
307 export: ExportView.TAB_ID, | |
308 import: ImportView.TAB_ID, | 303 import: ImportView.TAB_ID, |
309 proxy: ProxyView.TAB_ID, | 304 proxy: ProxyView.TAB_ID, |
310 events: EventsView.TAB_ID, | 305 events: EventsView.TAB_ID, |
311 timeline: TimelineView.TAB_ID, | 306 timeline: TimelineView.TAB_ID, |
312 dns: DnsView.TAB_ID, | 307 dns: DnsView.TAB_ID, |
313 sockets: SocketsView.TAB_ID, | 308 sockets: SocketsView.TAB_ID, |
314 http2: SpdyView.TAB_ID, | 309 http2: SpdyView.TAB_ID, |
315 'alt-svc': AltSvcView.TAB_ID, | 310 'alt-svc': AltSvcView.TAB_ID, |
316 quic: QuicView.TAB_ID, | 311 quic: QuicView.TAB_ID, |
317 sdch: SdchView.TAB_ID, | 312 sdch: SdchView.TAB_ID, |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 ]; | 745 ]; |
751 | 746 |
752 for (var i = 0; i < allIds.length; ++i) { | 747 for (var i = 0; i < allIds.length; ++i) { |
753 var curId = allIds[i]; | 748 var curId = allIds[i]; |
754 expectEquals(nodeId == curId, NetInternalsTest.nodeIsVisible($(curId))); | 749 expectEquals(nodeId == curId, NetInternalsTest.nodeIsVisible($(curId))); |
755 } | 750 } |
756 }; | 751 }; |
757 | 752 |
758 return NetInternalsTest; | 753 return NetInternalsTest; |
759 })(); | 754 })(); |
OLD | NEW |