OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This is a gTest-based test that runs the Selenium Core testsuite in Chrome | 5 // This is a gTest-based test that runs the Selenium Core testsuite in Chrome |
6 // using the UITest automation. The number of total and failed tests are | 6 // using the UITest automation. The number of total and failed tests are |
7 // written to stdout. | 7 // written to stdout. |
8 // | 8 // |
9 // TODO(darin): output the names of the failed tests so we can easily track | 9 // TODO(darin): output the names of the failed tests so we can easily track |
10 // deviations from the expected output. | 10 // deviations from the expected output. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 bool ReadExpectedResults(std::string* results) { | 78 bool ReadExpectedResults(std::string* results) { |
79 std::wstring results_path = GetResultsFilePath(); | 79 std::wstring results_path = GetResultsFilePath(); |
80 return file_util::ReadFileToString(results_path, results); | 80 return file_util::ReadFileToString(results_path, results); |
81 } | 81 } |
82 | 82 |
83 void RunSelenium(std::wstring* total, std::wstring* failed) { | 83 void RunSelenium(std::wstring* total, std::wstring* failed) { |
84 #ifdef SIMULATE_RUN | 84 #ifdef SIMULATE_RUN |
85 *total = L"100"; | 85 *total = L"100"; |
86 const wchar_t* kBogusFailures[] = { | 86 const wchar_t* kBogusFailures[] = { |
87 L"5.selectFrame,6.click,24.selectAndWait,24.verifyTitle", | 87 L"5.selectFrame,6.click,24.selectAndWait,24.verifyTitle", |
88 L"5.selectFrame,6.click,13.verifyLocation,13.verifyLocation,13.click,24.se
lectAndWait,24.verifyTitle", | 88 L"5.selectFrame,6.click,13.verifyLocation,13.verifyLocation,13.click," |
| 89 L"24.selectAndWait,24.verifyTitle", |
89 L"5.selectFrame,6.click,24.selectAndWait" | 90 L"5.selectFrame,6.click,24.selectAndWait" |
90 }; | 91 }; |
91 *failed = kBogusFailures[base::RandInt(0, 2)]; | 92 *failed = kBogusFailures[base::RandInt(0, 2)]; |
92 #else | 93 #else |
93 std::wstring test_path; | 94 std::wstring test_path; |
94 PathService::Get(chrome::DIR_TEST_DATA, &test_path); | 95 PathService::Get(chrome::DIR_TEST_DATA, &test_path); |
95 file_util::UpOneDirectory(&test_path); | 96 file_util::UpOneDirectory(&test_path); |
96 file_util::UpOneDirectory(&test_path); | 97 file_util::UpOneDirectory(&test_path); |
97 file_util::UpOneDirectory(&test_path); | 98 file_util::UpOneDirectory(&test_path); |
98 file_util::AppendToPath(&test_path, L"data"); | 99 file_util::AppendToPath(&test_path, L"data"); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 164 |
164 if (!new_passes_list.empty()) { | 165 if (!new_passes_list.empty()) { |
165 printf("new tests passing:\n"); | 166 printf("new tests passing:\n"); |
166 ResultsList::const_iterator it = new_passes_list.begin(); | 167 ResultsList::const_iterator it = new_passes_list.begin(); |
167 for (; it != new_passes_list.end(); ++it) | 168 for (; it != new_passes_list.end(); ++it) |
168 printf(" %s\n", it->c_str()); | 169 printf(" %s\n", it->c_str()); |
169 printf("\n"); | 170 printf("\n"); |
170 } | 171 } |
171 } | 172 } |
172 | 173 |
OLD | NEW |