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