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

Side by Side Diff: content/public/test/content_test_suite_base.cc

Issue 594603003: Infrastructure for reading V8's initial snapshot from external files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android tests Created 6 years, 2 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/content_test_suite_base.h" 5 #include "content/public/test/content_test_suite_base.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/metrics/statistics_recorder.h" 10 #include "base/metrics/statistics_recorder.h"
(...skipping 19 matching lines...) Expand all
30 #include "content/browser/android/browser_jni_registrar.h" 30 #include "content/browser/android/browser_jni_registrar.h"
31 #include "content/common/android/common_jni_registrar.h" 31 #include "content/common/android/common_jni_registrar.h"
32 #include "media/base/android/media_jni_registrar.h" 32 #include "media/base/android/media_jni_registrar.h"
33 #include "net/android/net_jni_registrar.h" 33 #include "net/android/net_jni_registrar.h"
34 #include "ui/base/android/ui_base_jni_registrar.h" 34 #include "ui/base/android/ui_base_jni_registrar.h"
35 #include "ui/gfx/android/gfx_jni_registrar.h" 35 #include "ui/gfx/android/gfx_jni_registrar.h"
36 #include "ui/gl/android/gl_jni_registrar.h" 36 #include "ui/gl/android/gl_jni_registrar.h"
37 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h" 37 #include "ui/shell_dialogs/android/shell_dialogs_jni_registrar.h"
38 #endif 38 #endif
39 39
40 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
41 #include "gin/public/isolate_holder.h"
42 #endif
43
40 namespace content { 44 namespace content {
41 45
42 class ContentTestSuiteBaseListener : public testing::EmptyTestEventListener { 46 class ContentTestSuiteBaseListener : public testing::EmptyTestEventListener {
43 public: 47 public:
44 ContentTestSuiteBaseListener() { 48 ContentTestSuiteBaseListener() {
45 } 49 }
46 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { 50 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE {
47 BrowserThreadImpl::FlushThreadPoolHelperForTesting(); 51 BrowserThreadImpl::FlushThreadPoolHelperForTesting();
48 } 52 }
49 private: 53 private:
50 DISALLOW_COPY_AND_ASSIGN(ContentTestSuiteBaseListener); 54 DISALLOW_COPY_AND_ASSIGN(ContentTestSuiteBaseListener);
51 }; 55 };
52 56
53 ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv) 57 ContentTestSuiteBase::ContentTestSuiteBase(int argc, char** argv)
54 : base::TestSuite(argc, argv) { 58 : base::TestSuite(argc, argv) {
55 } 59 }
56 60
57 void ContentTestSuiteBase::Initialize() { 61 void ContentTestSuiteBase::Initialize() {
58 base::TestSuite::Initialize(); 62 base::TestSuite::Initialize();
59 63
60 // Initialize the histograms subsystem, so that any histograms hit in tests 64 // Initialize the histograms subsystem, so that any histograms hit in tests
61 // are correctly registered with the statistics recorder and can be queried 65 // are correctly registered with the statistics recorder and can be queried
62 // by tests. 66 // by tests.
63 base::StatisticsRecorder::Initialize(); 67 base::StatisticsRecorder::Initialize();
64 68
69 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
70 gin::IsolateHolder::LoadV8Snapshot();
rmcilroy 2014/10/06 15:41:03 I'm not sure if this is the right place for this -
baixo 2014/10/07 14:53:27 Moved this to content/public/test/render_view_test
71 #endif
72
65 #if defined(OS_ANDROID) 73 #if defined(OS_ANDROID)
66 // Register JNI bindings for android. 74 // Register JNI bindings for android.
67 JNIEnv* env = base::android::AttachCurrentThread(); 75 JNIEnv* env = base::android::AttachCurrentThread();
68 content::android::RegisterCommonJni(env); 76 content::android::RegisterCommonJni(env);
69 content::android::RegisterBrowserJni(env); 77 content::android::RegisterBrowserJni(env);
70 gfx::android::RegisterJni(env); 78 gfx::android::RegisterJni(env);
71 media::RegisterJni(env); 79 media::RegisterJni(env);
72 net::android::RegisterJni(env); 80 net::android::RegisterJni(env);
73 ui::android::RegisterJni(env); 81 ui::android::RegisterJni(env);
74 ui::shell_dialogs::RegisterJni(env); 82 ui::shell_dialogs::RegisterJni(env);
(...skipping 14 matching lines...) Expand all
89 #if !defined(OS_IOS) 97 #if !defined(OS_IOS)
90 UtilityProcessHostImpl::RegisterUtilityMainThreadFactory( 98 UtilityProcessHostImpl::RegisterUtilityMainThreadFactory(
91 CreateInProcessUtilityThread); 99 CreateInProcessUtilityThread);
92 RenderProcessHostImpl::RegisterRendererMainThreadFactory( 100 RenderProcessHostImpl::RegisterRendererMainThreadFactory(
93 CreateInProcessRendererThread); 101 CreateInProcessRendererThread);
94 GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread); 102 GpuProcessHost::RegisterGpuMainThreadFactory(CreateInProcessGpuThread);
95 #endif 103 #endif
96 } 104 }
97 105
98 } // namespace content 106 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698