Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 #include <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 printf("\n"); | 131 printf("\n"); |
| 132 printf("Final accessibility tree after events fired:\n"); | 132 printf("Final accessibility tree after events fired:\n"); |
| 133 printf("%s\n", base::UTF16ToUTF8(final_tree_).c_str()); | 133 printf("%s\n", base::UTF16ToUTF8(final_tree_).c_str()); |
| 134 printf("\n"); | 134 printf("\n"); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void DumpAccessibilityEventsTest::RunEventTest( | 137 void DumpAccessibilityEventsTest::RunEventTest( |
| 138 const base::FilePath::CharType* file_path) { | 138 const base::FilePath::CharType* file_path) { |
| 139 base::FilePath dir_test_data; | 139 base::FilePath dir_test_data; |
| 140 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); | 140 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); |
| 141 base::FilePath test_path( | 141 |
| 142 dir_test_data.AppendASCII("accessibility/event")); | 142 const char* file_dir = "accessibility/event"; |
|
dmazzoni
2015/01/05 09:04:59
Use the FilePath class (base/files/file_path.h) to
| |
| 143 ASSERT_TRUE(base::PathExists(test_path)) | 143 #if defined(OS_WIN) |
| 144 << test_path.LossyDisplayName(); | 144 file_dir = "accessibility\\event"; |
| 145 #endif | |
| 146 base::FilePath test_path(dir_test_data.AppendASCII(file_dir)); | |
| 147 ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName(); | |
| 145 | 148 |
| 146 base::FilePath event_file = test_path.Append(base::FilePath(file_path)); | 149 base::FilePath event_file = test_path.Append(base::FilePath(file_path)); |
|
dmazzoni
2015/01/05 09:04:59
It might be easiest to rewrite the code to append
| |
| 147 RunTest(event_file, "accessibility/event"); | 150 RunTest(event_file, file_dir); |
| 148 } | 151 } |
| 149 | 152 |
| 150 // TODO(dmazzoni): port these tests to run on all platforms. | 153 // TODO(dmazzoni): port these tests to run on all platforms. |
| 151 #if defined(OS_WIN) || defined(OS_MACOSX) | 154 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 152 | 155 |
| 153 IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest, | 156 IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest, |
| 154 AccessibilityEventsCheckedStateChanged) { | 157 AccessibilityEventsCheckedStateChanged) { |
| 155 RunEventTest(FILE_PATH_LITERAL("events-checked-state-changed.html")); | 158 RunEventTest(FILE_PATH_LITERAL("events-checked-state-changed.html")); |
| 156 } | 159 } |
| 157 | 160 |
| 158 IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest, | 161 IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest, |
| 159 AccessibilityEventsInputTypeTextValueChanged) { | 162 AccessibilityEventsInputTypeTextValueChanged) { |
| 160 RunEventTest(FILE_PATH_LITERAL("events-input-type-text-value-changed.html")); | 163 RunEventTest(FILE_PATH_LITERAL("events-input-type-text-value-changed.html")); |
| 161 } | 164 } |
| 162 | 165 |
| 163 #endif // defined(OS_WIN) | 166 #endif // defined(OS_WIN) |
| 164 | 167 |
| 165 } // namespace content | 168 } // namespace content |
| OLD | NEW |