From 54903eaa08bde272797e0f2a6befa213dd93b9b6 Mon Sep 17 00:00:00 2001 From: "davemoore@chromium.org" Date: Thu, 6 May 2010 16:55:31 +0000 Subject: Allows browser tests to run with recent change http://codereview.chromium.org/2003001 broke browser tests for login / wizard screens. This fixes them. Review URL: http://codereview.chromium.org/1995005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46575 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/chrome_dll_main.cc | 6 ++++-- chrome/browser/chromeos/boot_times_loader.cc | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 9e2becc..2e2a209 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -399,8 +399,10 @@ int ChromeMain(int argc, char** argv) { #endif #if defined(OS_CHROMEOS) // Output our start times. - system("set -o noclobber ; cat /proc/uptime > /tmp/uptime-chrome-main"); - system("set -o noclobber ; cat /sys/block/sda/stat > /tmp/disk-chrome-main"); + system("if [ ! -f /tmp/uptime-chrome-main ]; " + "then cat /proc/uptime > /tmp/uptime-chrome-main ; fi"); + system("if [ ! -f /tmp/disk-chrome-main ]; " + "then cat /sys/block/sda/stat > /tmp/disk-chrome-main ; fi"); #endif #if defined(OS_MACOSX) // TODO(mark): Some of these things ought to be handled in chrome_exe_main.mm. diff --git a/chrome/browser/chromeos/boot_times_loader.cc b/chrome/browser/chromeos/boot_times_loader.cc index c169298..1d06fad 100644 --- a/chrome/browser/chromeos/boot_times_loader.cc +++ b/chrome/browser/chromeos/boot_times_loader.cc @@ -14,6 +14,7 @@ #include "base/string_util.h" #include "base/thread.h" #include "chrome/browser/browser_process.h" +#include "chrome/common/chrome_switches.h" namespace chromeos { @@ -38,6 +39,13 @@ BootTimesLoader::Handle BootTimesLoader::GetBootTimes( return 0; } + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kTestType)) { + // TODO(davemoore) This avoids boottimes for tests. This needs to be + // replaced with a mock of BootTimesLoader. + return 0; + } + scoped_refptr > request( new CancelableRequest(callback)); AddRequest(request, consumer); -- cgit v1.1