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

Side by Side Diff: content/browser/accessibility/dump_accessibility_events_browsertest.cc

Issue 826323002: Add proper path separator(\) for testing AX test cases on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « no previous file | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698