| 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 "content/public/test/test_launcher.h" | 5 #include "content/public/test/test_launcher.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return new ChromeMainDelegate(); | 114 return new ChromeMainDelegate(); |
| 115 #else | 115 #else |
| 116 // This delegate is only guaranteed to link on linux and windows, so just | 116 // This delegate is only guaranteed to link on linux and windows, so just |
| 117 // bail out if we are on any other platform. | 117 // bail out if we are on any other platform. |
| 118 NOTREACHED(); | 118 NOTREACHED(); |
| 119 return NULL; | 119 return NULL; |
| 120 #endif | 120 #endif |
| 121 } | 121 } |
| 122 | 122 |
| 123 virtual void AdjustDefaultParallelJobs(int* default_jobs) OVERRIDE { | 123 virtual void AdjustDefaultParallelJobs(int* default_jobs) OVERRIDE { |
| 124 #if defined(OS_WIN) && defined(USE_AURA) | 124 #if defined(OS_WIN) |
| 125 if (CommandLine::ForCurrentProcess()->HasSwitch( | 125 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 126 switches::kAshBrowserTests)) { | 126 switches::kAshBrowserTests)) { |
| 127 *default_jobs = 1; | 127 *default_jobs = 1; |
| 128 fprintf(stdout, | 128 fprintf(stdout, |
| 129 "Disabling test parallelization for --ash-browsertests.\n"); | 129 "Disabling test parallelization for --ash-browsertests.\n"); |
| 130 fflush(stdout); | 130 fflush(stdout); |
| 131 } | 131 } |
| 132 #endif // defined(OS_WIN) && defined(USE_AURA) | 132 #endif // defined(OS_WIN) |
| 133 } | 133 } |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 #if !defined(USE_AURA) && defined(TOOLKIT_VIEWS) | 136 #if !defined(USE_AURA) && defined(TOOLKIT_VIEWS) |
| 137 std::stack<linked_ptr<views::AcceleratorHandler> > handlers_; | 137 std::stack<linked_ptr<views::AcceleratorHandler> > handlers_; |
| 138 #endif | 138 #endif |
| 139 | 139 |
| 140 DISALLOW_COPY_AND_ASSIGN(ChromeTestLauncherDelegate); | 140 DISALLOW_COPY_AND_ASSIGN(ChromeTestLauncherDelegate); |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 } // namespace | 143 } // namespace |
| 144 | 144 |
| 145 int LaunchChromeTests(int default_jobs, int argc, char** argv) { | 145 int LaunchChromeTests(int default_jobs, int argc, char** argv) { |
| 146 #if defined(OS_MACOSX) | 146 #if defined(OS_MACOSX) |
| 147 chrome_browser_application_mac::RegisterBrowserCrApp(); | 147 chrome_browser_application_mac::RegisterBrowserCrApp(); |
| 148 #endif | 148 #endif |
| 149 | 149 |
| 150 #if defined(OS_LINUX) || defined(OS_ANDROID) | 150 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| 151 // We leak this pointer intentionally. The breakpad client needs to outlive | 151 // We leak this pointer intentionally. The breakpad client needs to outlive |
| 152 // all other code. | 152 // all other code. |
| 153 chrome::ChromeBreakpadClient* breakpad_client = | 153 chrome::ChromeBreakpadClient* breakpad_client = |
| 154 new chrome::ChromeBreakpadClient(); | 154 new chrome::ChromeBreakpadClient(); |
| 155 ANNOTATE_LEAKING_OBJECT_PTR(breakpad_client); | 155 ANNOTATE_LEAKING_OBJECT_PTR(breakpad_client); |
| 156 breakpad::SetBreakpadClient(breakpad_client); | 156 breakpad::SetBreakpadClient(breakpad_client); |
| 157 #endif | 157 #endif |
| 158 | 158 |
| 159 ChromeTestLauncherDelegate launcher_delegate; | 159 ChromeTestLauncherDelegate launcher_delegate; |
| 160 return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); | 160 return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
| 161 } | 161 } |
| OLD | NEW |