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_suite.h" | 5 #include "chrome/test/base/chrome_test_suite.h" |
6 | 6 |
7 #if defined(OS_CHROMEOS) | 7 #if defined(OS_CHROMEOS) |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 #endif | 10 #endif |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
18 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
20 #include "chrome/common/features.h" | |
21 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
22 #include "components/content_settings/core/common/content_settings_pattern.h" | 21 #include "components/content_settings/core/common/content_settings_pattern.h" |
23 #include "content/public/test/test_launcher.h" | 22 #include "content/public/test/test_launcher.h" |
24 #include "extensions/common/constants.h" | 23 #include "extensions/common/constants.h" |
25 #include "media/base/media.h" | 24 #include "media/base/media.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
27 | 26 |
28 #if BUILDFLAG(ANDROID_JAVA_UI) | 27 #if defined(OS_ANDROID) |
29 #include "base/android/jni_android.h" | 28 #include "base/android/jni_android.h" |
30 #include "chrome/browser/android/chrome_jni_registrar.h" | 29 #include "chrome/browser/android/chrome_jni_registrar.h" |
31 #endif | 30 #endif |
32 | 31 |
33 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
34 #include "base/process/process_metrics.h" | 33 #include "base/process/process_metrics.h" |
35 #include "chromeos/chromeos_paths.h" | 34 #include "chromeos/chromeos_paths.h" |
36 #endif | 35 #endif |
37 | 36 |
38 #if defined(OS_MACOSX) | 37 #if defined(OS_MACOSX) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #if defined(OS_MACOSX) | 69 #if defined(OS_MACOSX) |
71 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 70 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
72 chrome_browser_application_mac::RegisterBrowserCrApp(); | 71 chrome_browser_application_mac::RegisterBrowserCrApp(); |
73 #endif | 72 #endif |
74 | 73 |
75 if (!browser_dir_.empty()) { | 74 if (!browser_dir_.empty()) { |
76 PathService::Override(base::DIR_EXE, browser_dir_); | 75 PathService::Override(base::DIR_EXE, browser_dir_); |
77 PathService::Override(base::DIR_MODULE, browser_dir_); | 76 PathService::Override(base::DIR_MODULE, browser_dir_); |
78 } | 77 } |
79 | 78 |
80 #if BUILDFLAG(ANDROID_JAVA_UI) | 79 #if defined(OS_ANDROID) |
81 ASSERT_TRUE( | 80 ASSERT_TRUE( |
82 android::RegisterBrowserJNI(base::android::AttachCurrentThread())); | 81 android::RegisterBrowserJNI(base::android::AttachCurrentThread())); |
83 #endif | 82 #endif |
84 | 83 |
85 // Disable external libraries load if we are under python process in | 84 // Disable external libraries load if we are under python process in |
86 // ChromeOS. That means we are autotest and, if ASAN is used, | 85 // ChromeOS. That means we are autotest and, if ASAN is used, |
87 // external libraries load crashes. | 86 // external libraries load crashes. |
88 if (!IsCrosPythonProcess()) | 87 if (!IsCrosPythonProcess()) |
89 media::InitializeMediaLibrary(); | 88 media::InitializeMediaLibrary(); |
90 | 89 |
(...skipping 13 matching lines...) Expand all Loading... |
104 #endif | 103 #endif |
105 } | 104 } |
106 | 105 |
107 void ChromeTestSuite::Shutdown() { | 106 void ChromeTestSuite::Shutdown() { |
108 #if defined(OS_MACOSX) | 107 #if defined(OS_MACOSX) |
109 base::mac::SetOverrideFrameworkBundle(NULL); | 108 base::mac::SetOverrideFrameworkBundle(NULL); |
110 #endif | 109 #endif |
111 | 110 |
112 content::ContentTestSuiteBase::Shutdown(); | 111 content::ContentTestSuiteBase::Shutdown(); |
113 } | 112 } |
OLD | NEW |