| 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 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/scoped_nsautorelease_pool.h" |
| 9 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 10 #include "base/scoped_nsautorelease_pool.h" | |
| 11 #include "base/scoped_temp_dir.h" | 11 #include "base/scoped_temp_dir.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/test/test_suite.h" | 13 #include "base/test/test_suite.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/test/test_launcher/test_runner.h" | 15 #include "chrome/test/test_launcher/test_runner.h" |
| 16 #include "chrome/test/unit/chrome_test_suite.h" | 16 #include "chrome/test/unit/chrome_test_suite.h" |
| 17 | 17 |
| 18 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
| 19 #include "base/base_switches.h" | 19 #include "base/base_switches.h" |
| 20 #include "chrome/common/chrome_constants.h" | 20 #include "chrome/common/chrome_constants.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool Init() { | 58 bool Init() { |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Returns true if the test succeeded, false if it failed. | 62 // Returns true if the test succeeded, false if it failed. |
| 63 bool RunTest(const std::string& test_name) { | 63 bool RunTest(const std::string& test_name) { |
| 64 // Some of the below method calls will leak objects if there is no | 64 // Some of the below method calls will leak objects if there is no |
| 65 // autorelease pool in place. | 65 // autorelease pool in place. |
| 66 base::ScopedNSAutoreleasePool pool; | 66 base::mac::ScopedNSAutoreleasePool pool; |
| 67 | 67 |
| 68 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 68 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 69 CommandLine new_cmd_line(cmd_line->GetProgram()); | 69 CommandLine new_cmd_line(cmd_line->GetProgram()); |
| 70 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); | 70 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); |
| 71 | 71 |
| 72 // Strip out gtest_output flag because otherwise we would overwrite results | 72 // Strip out gtest_output flag because otherwise we would overwrite results |
| 73 // of the previous test. We will generate the final output file later | 73 // of the previous test. We will generate the final output file later |
| 74 // in RunTests(). | 74 // in RunTests(). |
| 75 switches.erase(kGTestOutputFlag); | 75 switches.erase(kGTestOutputFlag); |
| 76 | 76 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 exit_code = 1; | 267 exit_code = 1; |
| 268 break; | 268 break; |
| 269 } | 269 } |
| 270 | 270 |
| 271 // Special value "-1" means "repeat indefinitely". | 271 // Special value "-1" means "repeat indefinitely". |
| 272 if (cycles != -1) | 272 if (cycles != -1) |
| 273 cycles--; | 273 cycles--; |
| 274 } | 274 } |
| 275 return exit_code; | 275 return exit_code; |
| 276 } | 276 } |
| OLD | NEW |