Chromium Code Reviews| 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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 } | 37 } |
| 38 | 38 |
| 39 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { | 39 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { |
| 40 content_client_.reset(new ShellContentClient); | 40 content_client_.reset(new ShellContentClient); |
| 41 browser_content_client_.reset(new ShellContentBrowserClient()); | 41 browser_content_client_.reset(new ShellContentBrowserClient()); |
| 42 SetContentClient(content_client_.get()); | 42 SetContentClient(content_client_.get()); |
| 43 SetBrowserClientForTesting(browser_content_client_.get()); | 43 SetBrowserClientForTesting(browser_content_client_.get()); |
| 44 } | 44 } |
| 45 | 45 |
| 46 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { | 46 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { |
| 47 #if !defined(OS_ANDROID) | |
|
jam
2013/11/18 05:41:10
nit: please add a comment about why this is done
| |
| 47 browser_content_client_.reset(); | 48 browser_content_client_.reset(); |
| 48 content_client_.reset(); | 49 content_client_.reset(); |
| 49 SetContentClient(NULL); | 50 SetContentClient(NULL); |
| 51 #endif | |
| 50 } | 52 } |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 scoped_ptr<ShellContentClient> content_client_; | 55 scoped_ptr<ShellContentClient> content_client_; |
| 54 scoped_ptr<ShellContentBrowserClient> browser_content_client_; | 56 scoped_ptr<ShellContentBrowserClient> browser_content_client_; |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(ContentShellTestSuiteInitializer); | 58 DISALLOW_COPY_AND_ASSIGN(ContentShellTestSuiteInitializer); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 #if defined(OS_ANDROID) | 61 #if defined(OS_ANDROID) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); | 127 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); |
| 126 }; | 128 }; |
| 127 | 129 |
| 128 } // namespace content | 130 } // namespace content |
| 129 | 131 |
| 130 int main(int argc, char** argv) { | 132 int main(int argc, char** argv) { |
| 131 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); | 133 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); |
| 132 content::ContentTestLauncherDelegate launcher_delegate; | 134 content::ContentTestLauncherDelegate launcher_delegate; |
| 133 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); | 135 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
| 134 } | 136 } |
| OLD | NEW |