| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 base::FilePath GetDomCheckerDir() { | 106 base::FilePath GetDomCheckerDir() { |
| 107 base::FilePath test_dir; | 107 base::FilePath test_dir; |
| 108 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); | 108 PathService::Get(chrome::DIR_TEST_DATA, &test_dir); |
| 109 return test_dir.AppendASCII("dom_checker"); | 109 return test_dir.AppendASCII("dom_checker"); |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool ReadExpectedResults(const std::string& failures_file, | 112 bool ReadExpectedResults(const std::string& failures_file, |
| 113 std::string* results) { | 113 std::string* results) { |
| 114 base::FilePath results_path = GetDomCheckerDir(); | 114 base::FilePath results_path = GetDomCheckerDir(); |
| 115 results_path = results_path.AppendASCII(failures_file); | 115 results_path = results_path.AppendASCII(failures_file); |
| 116 return file_util::ReadFileToString(results_path, results); | 116 return base::ReadFileToString(results_path, results); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void ParseExpectedFailures(const std::string& input, ResultsSet* output) { | 119 void ParseExpectedFailures(const std::string& input, ResultsSet* output) { |
| 120 if (input.empty()) | 120 if (input.empty()) |
| 121 return; | 121 return; |
| 122 | 122 |
| 123 std::vector<std::string> tokens; | 123 std::vector<std::string> tokens; |
| 124 base::SplitString(input, '\n', &tokens); | 124 base::SplitString(input, '\n', &tokens); |
| 125 | 125 |
| 126 std::vector<std::string>::const_iterator it = tokens.begin(); | 126 std::vector<std::string>::const_iterator it = tokens.begin(); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 TEST_F(DomCheckerTest, DISABLED_Http) { | 250 TEST_F(DomCheckerTest, DISABLED_Http) { |
| 251 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDomCheckerTest)) | 251 if (!CommandLine::ForCurrentProcess()->HasSwitch(kRunDomCheckerTest)) |
| 252 return; | 252 return; |
| 253 | 253 |
| 254 ResultsList new_passes, new_failures; | 254 ResultsList new_passes, new_failures; |
| 255 RunTest(true, &new_passes, &new_failures); | 255 RunTest(true, &new_passes, &new_failures); |
| 256 PrintResults(new_passes, new_failures); | 256 PrintResults(new_passes, new_failures); |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace | 259 } // namespace |
| OLD | NEW |