Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: content/test/content_test_launcher.cc

Issue 1011133006: Move V8 snapshot loading code from isolate_holder to gin/v8_startup_data.{h,cc}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review comments. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/process/memory.h" 12 #include "base/process/memory.h"
13 #include "base/sys_info.h" 13 #include "base/sys_info.h"
14 #include "base/test/test_suite.h" 14 #include "base/test/test_suite.h"
15 #include "base/test/test_timeouts.h" 15 #include "base/test/test_timeouts.h"
16 #include "content/public/common/content_switches.h" 16 #include "content/public/common/content_switches.h"
17 #include "content/public/test/content_test_suite_base.h" 17 #include "content/public/test/content_test_suite_base.h"
18 #include "content/shell/app/shell_main_delegate.h" 18 #include "content/shell/app/shell_main_delegate.h"
19 #include "content/shell/common/shell_switches.h" 19 #include "content/shell/common/shell_switches.h"
20 #include "media/base/media_switches.h" 20 #include "media/base/media_switches.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 22
23 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 23 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
24 #include "gin/public/isolate_holder.h" 24 #include "gin/v8_initializer.h"
25 #endif 25 #endif
26 26
27 #if defined(OS_ANDROID) 27 #if defined(OS_ANDROID)
28 #include "base/message_loop/message_loop.h" 28 #include "base/message_loop/message_loop.h"
29 #include "content/app/mojo/mojo_init.h" 29 #include "content/app/mojo/mojo_init.h"
30 #include "content/common/url_schemes.h" 30 #include "content/common/url_schemes.h"
31 #include "content/public/common/content_paths.h" 31 #include "content/public/common/content_paths.h"
32 #include "content/public/test/nested_message_pump_android.h" 32 #include "content/public/test/nested_message_pump_android.h"
33 #include "content/shell/browser/shell_content_browser_client.h" 33 #include "content/shell/browser/shell_content_browser_client.h"
34 #include "content/shell/common/shell_content_client.h" 34 #include "content/shell/common/shell_content_client.h"
(...skipping 15 matching lines...) Expand all
50 } 50 }
51 ~ContentBrowserTestSuite() override {} 51 ~ContentBrowserTestSuite() override {}
52 52
53 protected: 53 protected:
54 void Initialize() override { 54 void Initialize() override {
55 #if defined(OS_ANDROID) 55 #if defined(OS_ANDROID)
56 base::i18n::AllowMultipleInitializeCallsForTesting(); 56 base::i18n::AllowMultipleInitializeCallsForTesting();
57 base::i18n::InitializeICU(); 57 base::i18n::InitializeICU();
58 58
59 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 59 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
60 gin::IsolateHolder::LoadV8Snapshot(); 60 gin::V8Initializer::LoadV8Snapshot();
61 #endif 61 #endif
62 62
63 // This needs to be done before base::TestSuite::Initialize() is called, 63 // This needs to be done before base::TestSuite::Initialize() is called,
64 // as it also tries to set MessagePumpForUIFactory. 64 // as it also tries to set MessagePumpForUIFactory.
65 if (!base::MessageLoop::InitMessagePumpForUIFactory( 65 if (!base::MessageLoop::InitMessagePumpForUIFactory(
66 &CreateMessagePumpForUI)) 66 &CreateMessagePumpForUI))
67 VLOG(0) << "MessagePumpForUIFactory already set, unable to override."; 67 VLOG(0) << "MessagePumpForUIFactory already set, unable to override.";
68 68
69 // For all other platforms, we call ContentMain for browser tests which goes 69 // For all other platforms, we call ContentMain for browser tests which goes
70 // through the normal browser initialization paths. For Android, we must set 70 // through the normal browser initialization paths. For Android, we must set
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); 121 DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate);
122 }; 122 };
123 123
124 } // namespace content 124 } // namespace content
125 125
126 int main(int argc, char** argv) { 126 int main(int argc, char** argv) {
127 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2); 127 int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2);
128 content::ContentTestLauncherDelegate launcher_delegate; 128 content::ContentTestLauncherDelegate launcher_delegate;
129 return LaunchTests(&launcher_delegate, default_jobs, argc, argv); 129 return LaunchTests(&launcher_delegate, default_jobs, argc, argv);
130 } 130 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698