OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
Paweł Hajdan Jr.
2015/01/29 13:01:19
nit: 2015
hcarmona
2015/01/30 22:19:47
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_TEST_BASE_ACCESSIBILITY_TEST_HELPER_H_ | |
6 #define CHROME_TEST_BASE_ACCESSIBILITY_TEST_HELPER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "content/public/browser/render_frame_host.h" | |
11 #include "content/public/browser/web_contents.h" | |
12 | |
13 /* | |
14 * This class will allow any browser test to run the accessibility tests. | |
15 * The TearDownOnMainThread method is probably the best place to use this class | |
16 * because it will apply to all test cases, but it can be run on select cases by | |
17 * using it in the test method. | |
18 */ | |
19 | |
20 class AccessibilityTestHelper { | |
21 public: | |
22 // These are the expected results of an accessibility test. | |
23 static const std::string kExpectedResults; | |
24 | |
25 // This is the script that will run the accessibility test. | |
26 static const std::string kAccessibilityTestString; | |
27 | |
28 // This method loads the javascript accessibility library. | |
29 // Returns false on loading error. Test will fail if library is not loaded. | |
30 bool LoadLibrary(content::WebContents* web_contents); | |
Paweł Hajdan Jr.
2015/01/29 13:01:19
nit: Please use WARN_UNUSED_RESULT, applies to oth
hcarmona
2015/01/30 22:19:47
Done.
| |
31 | |
32 // Should be called after loading libraries. Load method is separate to allow | |
33 // better error reporting. This method returns true if test was run, | |
34 // regardless of result. Return value of false means we were not able to test | |
35 // for accessibility. | |
36 bool RunAccessibilityTest(content::RenderFrameHost* focused_frame); | |
37 | |
38 // Get the results of an accessibility test. | |
39 // This should be compared to kExpectedResults | |
40 std::string accessibility_message(); | |
Paweł Hajdan Jr.
2015/01/29 13:01:18
nit: If this is not inline (why?) it should not be
hcarmona
2015/01/30 22:19:47
Done.
| |
41 | |
42 private: | |
43 // Holds the results of an accessibility test. | |
44 std::string accessibility_message_; | |
Paweł Hajdan Jr.
2015/01/29 13:01:19
Is this member variable the only reason for making
hcarmona
2015/01/30 22:19:47
That makes sense. I've moved these functions into
| |
45 | |
46 // This should be used to load libraries. | |
47 // All library paths should be relative to the source root. | |
48 bool LoadScript(content::WebContents* web_contents, base::FilePath path); | |
49 }; | |
50 | |
51 #endif // CHROME_TEST_BASE_ACCESSIBILITY_TEST_HELPER_H_ | |
52 | |
OLD | NEW |