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/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 class ContentBrowserTestSuite : public ContentTestSuiteBase { | 43 class ContentBrowserTestSuite : public ContentTestSuiteBase { |
44 public: | 44 public: |
45 ContentBrowserTestSuite(int argc, char** argv) | 45 ContentBrowserTestSuite(int argc, char** argv) |
46 : ContentTestSuiteBase(argc, argv) { | 46 : ContentTestSuiteBase(argc, argv) { |
47 } | 47 } |
48 virtual ~ContentBrowserTestSuite() { | 48 virtual ~ContentBrowserTestSuite() { |
49 } | 49 } |
50 | 50 |
51 protected: | 51 protected: |
52 virtual void Initialize() OVERRIDE { | 52 virtual void Initialize() override { |
53 | 53 |
54 #if defined(OS_ANDROID) | 54 #if defined(OS_ANDROID) |
55 base::i18n::AllowMultipleInitializeCallsForTesting(); | 55 base::i18n::AllowMultipleInitializeCallsForTesting(); |
56 base::i18n::InitializeICU(); | 56 base::i18n::InitializeICU(); |
57 | 57 |
58 // This needs to be done before base::TestSuite::Initialize() is called, | 58 // This needs to be done before base::TestSuite::Initialize() is called, |
59 // as it also tries to set MessagePumpForUIFactory. | 59 // as it also tries to set MessagePumpForUIFactory. |
60 if (!base::MessageLoop::InitMessagePumpForUIFactory( | 60 if (!base::MessageLoop::InitMessagePumpForUIFactory( |
61 &CreateMessagePumpForUI)) | 61 &CreateMessagePumpForUI)) |
62 VLOG(0) << "MessagePumpForUIFactory already set, unable to override."; | 62 VLOG(0) << "MessagePumpForUIFactory already set, unable to override."; |
(...skipping 23 matching lines...) Expand all Loading... |
86 #endif | 86 #endif |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(ContentBrowserTestSuite); | 88 DISALLOW_COPY_AND_ASSIGN(ContentBrowserTestSuite); |
89 }; | 89 }; |
90 | 90 |
91 class ContentTestLauncherDelegate : public TestLauncherDelegate { | 91 class ContentTestLauncherDelegate : public TestLauncherDelegate { |
92 public: | 92 public: |
93 ContentTestLauncherDelegate() {} | 93 ContentTestLauncherDelegate() {} |
94 virtual ~ContentTestLauncherDelegate() {} | 94 virtual ~ContentTestLauncherDelegate() {} |
95 | 95 |
96 virtual int RunTestSuite(int argc, char** argv) OVERRIDE { | 96 virtual int RunTestSuite(int argc, char** argv) override { |
97 return ContentBrowserTestSuite(argc, argv).Run(); | 97 return ContentBrowserTestSuite(argc, argv).Run(); |
98 } | 98 } |
99 | 99 |
100 virtual bool AdjustChildProcessCommandLine( | 100 virtual bool AdjustChildProcessCommandLine( |
101 CommandLine* command_line, const base::FilePath& temp_data_dir) OVERRIDE { | 101 CommandLine* command_line, const base::FilePath& temp_data_dir) override { |
102 command_line->AppendSwitchPath(switches::kContentShellDataPath, | 102 command_line->AppendSwitchPath(switches::kContentShellDataPath, |
103 temp_data_dir); | 103 temp_data_dir); |
104 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 104 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
105 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); | 105 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 protected: | 109 protected: |
110 virtual ContentMainDelegate* CreateContentMainDelegate() OVERRIDE { | 110 virtual ContentMainDelegate* CreateContentMainDelegate() override { |
111 return new ShellMainDelegate(); | 111 return new ShellMainDelegate(); |
112 } | 112 } |
113 | 113 |
114 private: | 114 private: |
115 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); | 115 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); |
116 }; | 116 }; |
117 | 117 |
118 } // namespace content | 118 } // namespace content |
119 | 119 |
120 int main(int argc, char** argv) { | 120 int main(int argc, char** argv) { |
121 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); | 121 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); |
122 content::ContentTestLauncherDelegate launcher_delegate; | 122 content::ContentTestLauncherDelegate launcher_delegate; |
123 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); | 123 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); |
124 } | 124 } |
OLD | NEW |