| 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 "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 18 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 #include "components/content_settings/core/common/content_settings_pattern.h" | 20 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 21 #include "content/public/test/test_launcher.h" | 21 #include "content/public/test/test_launcher.h" |
| 22 #include "extensions/common/constants.h" | 22 #include "extensions/common/constants.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 | 24 |
| 25 #if defined(OS_ANDROID) |
| 26 #include "base/android/jni_android.h" |
| 27 #include "chrome/browser/android/chrome_jni_registrar.h" |
| 28 #endif |
| 29 |
| 25 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
| 26 #include "base/process/process_metrics.h" | 31 #include "base/process/process_metrics.h" |
| 27 #include "chromeos/chromeos_paths.h" | 32 #include "chromeos/chromeos_paths.h" |
| 28 #endif | 33 #endif |
| 29 | 34 |
| 30 #if defined(OS_MACOSX) | 35 #if defined(OS_MACOSX) |
| 31 #include "base/mac/bundle_locations.h" | 36 #include "base/mac/bundle_locations.h" |
| 32 #include "base/mac/scoped_nsautorelease_pool.h" | 37 #include "base/mac/scoped_nsautorelease_pool.h" |
| 33 #if !defined(OS_IOS) | 38 #if !defined(OS_IOS) |
| 34 #include "chrome/browser/chrome_browser_application_mac.h" | 39 #include "chrome/browser/chrome_browser_application_mac.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #if !defined(OS_IOS) | 75 #if !defined(OS_IOS) |
| 71 chrome_browser_application_mac::RegisterBrowserCrApp(); | 76 chrome_browser_application_mac::RegisterBrowserCrApp(); |
| 72 #endif // !defined(OS_IOS) | 77 #endif // !defined(OS_IOS) |
| 73 #endif | 78 #endif |
| 74 | 79 |
| 75 if (!browser_dir_.empty()) { | 80 if (!browser_dir_.empty()) { |
| 76 PathService::Override(base::DIR_EXE, browser_dir_); | 81 PathService::Override(base::DIR_EXE, browser_dir_); |
| 77 PathService::Override(base::DIR_MODULE, browser_dir_); | 82 PathService::Override(base::DIR_MODULE, browser_dir_); |
| 78 } | 83 } |
| 79 | 84 |
| 85 #if defined(OS_ANDROID) |
| 86 ASSERT_TRUE(chrome::android::RegisterBrowserJNI( |
| 87 base::android::AttachCurrentThread())); |
| 88 #endif |
| 89 |
| 80 #if !defined(OS_IOS) | 90 #if !defined(OS_IOS) |
| 81 // Disable external libraries load if we are under python process in | 91 // Disable external libraries load if we are under python process in |
| 82 // ChromeOS. That means we are autotest and, if ASAN is used, | 92 // ChromeOS. That means we are autotest and, if ASAN is used, |
| 83 // external libraries load crashes. | 93 // external libraries load crashes. |
| 84 if (!IsCrosPythonProcess()) | 94 if (!IsCrosPythonProcess()) |
| 85 media::InitializeMediaLibrary(); | 95 media::InitializeMediaLibrary(); |
| 86 #endif | 96 #endif |
| 87 | 97 |
| 88 // Initialize after overriding paths as some content paths depend on correct | 98 // Initialize after overriding paths as some content paths depend on correct |
| 89 // values for DIR_EXE and DIR_MODULE. | 99 // values for DIR_EXE and DIR_MODULE. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 101 #endif | 111 #endif |
| 102 } | 112 } |
| 103 | 113 |
| 104 void ChromeTestSuite::Shutdown() { | 114 void ChromeTestSuite::Shutdown() { |
| 105 #if defined(OS_MACOSX) && !defined(OS_IOS) | 115 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 106 base::mac::SetOverrideFrameworkBundle(NULL); | 116 base::mac::SetOverrideFrameworkBundle(NULL); |
| 107 #endif | 117 #endif |
| 108 | 118 |
| 109 content::ContentTestSuiteBase::Shutdown(); | 119 content::ContentTestSuiteBase::Shutdown(); |
| 110 } | 120 } |
| OLD | NEW |