| 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 "chrome/test/base/chrome_test_launcher.h" | 5 #include "chrome/test/base/chrome_test_launcher.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/leak_annotations.h" | 8 #include "base/debug/leak_annotations.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 // file:// access for ChromeOS. | 79 // file:// access for ChromeOS. |
| 80 new_command_line.AppendSwitch(switches::kAllowFileAccess); | 80 new_command_line.AppendSwitch(switches::kAllowFileAccess); |
| 81 | 81 |
| 82 *command_line = new_command_line; | 82 *command_line = new_command_line; |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 virtual content::ContentMainDelegate* CreateContentMainDelegate() OVERRIDE { | 87 virtual content::ContentMainDelegate* CreateContentMainDelegate() OVERRIDE { |
| 88 #if defined(OS_WIN) || defined (OS_LINUX) | |
| 89 return new ChromeMainDelegate(); | 88 return new ChromeMainDelegate(); |
| 90 #else | |
| 91 // This delegate is only guaranteed to link on linux and windows, so just | |
| 92 // bail out if we are on any other platform. | |
| 93 NOTREACHED(); | |
| 94 return NULL; | |
| 95 #endif | |
| 96 } | 89 } |
| 97 | 90 |
| 98 virtual void AdjustDefaultParallelJobs(int* default_jobs) OVERRIDE { | 91 virtual void AdjustDefaultParallelJobs(int* default_jobs) OVERRIDE { |
| 99 #if defined(OS_WIN) | 92 #if defined(OS_WIN) |
| 100 if (CommandLine::ForCurrentProcess()->HasSwitch( | 93 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 101 switches::kAshBrowserTests)) { | 94 switches::kAshBrowserTests)) { |
| 102 *default_jobs = 1; | 95 *default_jobs = 1; |
| 103 fprintf(stdout, | 96 fprintf(stdout, |
| 104 "Disabling test parallelization for --ash-browsertests.\n"); | 97 "Disabling test parallelization for --ash-browsertests.\n"); |
| 105 fflush(stdout); | 98 fflush(stdout); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 128 // all other code. | 121 // all other code. |
| 129 chrome::ChromeBreakpadClient* breakpad_client = | 122 chrome::ChromeBreakpadClient* breakpad_client = |
| 130 new chrome::ChromeBreakpadClient(); | 123 new chrome::ChromeBreakpadClient(); |
| 131 ANNOTATE_LEAKING_OBJECT_PTR(breakpad_client); | 124 ANNOTATE_LEAKING_OBJECT_PTR(breakpad_client); |
| 132 breakpad::SetBreakpadClient(breakpad_client); | 125 breakpad::SetBreakpadClient(breakpad_client); |
| 133 #endif | 126 #endif |
| 134 | 127 |
| 135 ChromeTestLauncherDelegate launcher_delegate(runner); | 128 ChromeTestLauncherDelegate launcher_delegate(runner); |
| 136 return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); | 129 return content::LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
| 137 } | 130 } |
| OLD | NEW |