| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 typedef std::list<std::string> ResultsList; | 46 typedef std::list<std::string> ResultsList; |
| 47 typedef std::set<std::string> ResultsSet; | 47 typedef std::set<std::string> ResultsSet; |
| 48 | 48 |
| 49 // Parses a selenium results string, which is of the form: | 49 // Parses a selenium results string, which is of the form: |
| 50 // "5.selectFrame,6.click,24.selectAndWait,24.verifyTitle" | 50 // "5.selectFrame,6.click,24.selectAndWait,24.verifyTitle" |
| 51 void ParseResults(const std::string& input, ResultsSet* output) { | 51 void ParseResults(const std::string& input, ResultsSet* output) { |
| 52 if (input.empty()) | 52 if (input.empty()) |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 std::vector<std::string> tokens; | 55 std::vector<std::string> tokens; |
| 56 SplitString(input, ',', &tokens); | 56 base::SplitString(input, ',', &tokens); |
| 57 for (size_t i = 0; i < tokens.size(); ++i) { | 57 for (size_t i = 0; i < tokens.size(); ++i) { |
| 58 TrimWhitespaceASCII(tokens[i], TRIM_ALL, &tokens[i]); | 58 TrimWhitespaceASCII(tokens[i], TRIM_ALL, &tokens[i]); |
| 59 output->insert(tokens[i]); | 59 output->insert(tokens[i]); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Find the elements of "b" that are not in "a" | 63 // Find the elements of "b" that are not in "a" |
| 64 void CompareSets(const ResultsSet& a, const ResultsSet& b, | 64 void CompareSets(const ResultsSet& a, const ResultsSet& b, |
| 65 ResultsList* only_in_b) { | 65 ResultsList* only_in_b) { |
| 66 ResultsSet::const_iterator it = b.begin(); | 66 ResultsSet::const_iterator it = b.begin(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 | 169 |
| 170 if (!new_passes_list.empty()) { | 170 if (!new_passes_list.empty()) { |
| 171 printf("new tests passing:\n"); | 171 printf("new tests passing:\n"); |
| 172 ResultsList::const_iterator it = new_passes_list.begin(); | 172 ResultsList::const_iterator it = new_passes_list.begin(); |
| 173 for (; it != new_passes_list.end(); ++it) | 173 for (; it != new_passes_list.end(); ++it) |
| 174 printf(" %s\n", it->c_str()); | 174 printf(" %s\n", it->c_str()); |
| 175 printf("\n"); | 175 printf("\n"); |
| 176 } | 176 } |
| 177 } | 177 } |
| OLD | NEW |