summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 17:04:42 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 17:04:42 +0000
commit9bade09ac71236e99865278def63b5212b7cf6b6 (patch)
tree9a578185c9a32cfcfe6cdce4bb343a0a697a2c42 /chrome/browser/browser_main.cc
parente5263916f2e000b2b53d8385a452d4fd5a4106b1 (diff)
downloadchromium_src-9bade09ac71236e99865278def63b5212b7cf6b6.zip
chromium_src-9bade09ac71236e99865278def63b5212b7cf6b6.tar.gz
chromium_src-9bade09ac71236e99865278def63b5212b7cf6b6.tar.bz2
Write a test for loading libcros.so on startup of Chrome. You just pass the
--test-load-libcros on the command line. The browser will exit immediately and the error code (and error messages) will indicate success or failure. I also renamed loaded() static functions related to loading this library. These are not simple getters since they will actually load the library if its not loaded yet. I renamed it to EnsureLoaded. TEST=This is a test BUG=none Review URL: http://codereview.chromium.org/387014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 78e35dc..dc82b1fd 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -122,6 +122,7 @@
#endif
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/cros_library.h"
#include "chrome/browser/chromeos/external_cookie_handler.h"
#endif
@@ -129,7 +130,7 @@ namespace {
// This function provides some ways to test crash and assertion handling
// behavior of the program.
-void HandleErrorTestParameters(const CommandLine& command_line) {
+void HandleTestParameters(const CommandLine& command_line) {
// This parameter causes an assertion.
if (command_line.HasSwitch(switches::kBrowserAssertTest)) {
DCHECK(false);
@@ -140,6 +141,14 @@ void HandleErrorTestParameters(const CommandLine& command_line) {
int* bad_pointer = NULL;
*bad_pointer = 0;
}
+
+#if defined(OS_CHROMEOS)
+ // Test loading libcros and exit. We return 0 if the library could be loaded,
+ // and 1 if it can't be. This is for validation that the library is installed
+ // and versioned properly for Chrome to find.
+ if (command_line.HasSwitch(switches::kTestLoadLibcros))
+ exit(!chromeos::CrosLibrary::EnsureLoaded());
+#endif
}
void RunUIMessageLoop(BrowserProcess* browser_process) {
@@ -844,7 +853,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
}
#endif
- HandleErrorTestParameters(parsed_command_line);
+ HandleTestParameters(parsed_command_line);
Platform::RecordBreakpadStatusUMA(metrics);
// Start up the extensions service. This should happen before Start().
profile->InitExtensions();