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

Side by Side Diff: chrome/test/data/webui/a11y_audit_browsertest.js

Issue 11363170: Add an accessibility audit test for WebUI pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added some test cases for the test test Created 8 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 function WebUIA11yAuditBrowserTest() {}
6
7 WebUIA11yAuditBrowserTest.prototype = {
8 __proto__: testing.Test.prototype,
9
10 browsePreload: 'chrome://terms',
11
12 runA11yChecks: true,
13 a11yIssuesAreErrors: true,
14 };
15
16 function addAuditFailures() {
17 var style = document.createElement('style');
18 style.innerText = 'p { color: #ffffff }';
19 document.head.appendChild(style);
20 }
21
22 function expectAuditWillNotRun() {
23 axs.AuditRule.prototype.run = function() {
24 assertTrue(false, 'AuditRule.run should not be executed');
25 };
26 }
27
28 RUNTIME_TEST_F('WebUIA11yAuditBrowserTest', 'testWithAuditFailures', function() {
29 addAuditFailures();
30 });
31
32 RUNTIME_TEST_F('WebUIA11yAuditBrowserTest',
33 'testWithAuditFailures_a11yChecksDisabled',
34 function() {
35 expectAuditWillNotRun();
36 disableA11yChecks();
37 a11yIssuesAreErrors(false);
38 addAuditFailures();
39 });
40
41 function WebUIA11yAuditBrowserTest_TestsDisabledInFixture() {}
42
43 WebUIA11yAuditBrowserTest_TestsDisabledInFixture.prototype = {
44 __proto__: WebUIA11yAuditBrowserTest.prototype,
45
46 runA11yChecks: false,
47 };
48
49 RUNTIME_TEST_F('WebUIA11yAuditBrowserTest_TestsDisabledInFixture',
50 'testWithAuditFailures',
51 function() {
52 enableA11yChecks();
53 addAuditFailures();
54 });
55
56 RUNTIME_TEST_F('WebUIA11yAuditBrowserTest_TestsDisabledInFixture',
57 'testWithAuditFailures_a11yChecksNotEnabled',
58 function() {
59 expectAuditWillNotRun();
60 addAuditFailures();
61 });
62
63 function WebUIA11yAuditBrowserTest_IssuesAreWarnings() {}
64
65 WebUIA11yAuditBrowserTest_IssuesAreWarnings.prototype = {
66 __proto__: WebUIA11yAuditBrowserTest.prototype,
67
68 runA11yChecks: false,
69 };
70
71 RUNTIME_TEST_F('WebUIA11yAuditBrowserTest_IssuesAreWarnings',
72 'testWithAuditFailures',
73 function() {
74 enableA11yChecks();
75 addAuditFailures();
76 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698