summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-18 00:42:48 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-18 00:42:48 +0000
commit85786f935163dd4c46dc2931111189e8d119d4d8 (patch)
tree41c674929dc600ac070fed446013754d87e34b83 /chrome/test
parent0effc1cb2317bc1e6ae41a8a1b831921e45d62bd (diff)
downloadchromium_src-85786f935163dd4c46dc2931111189e8d119d4d8.zip
chromium_src-85786f935163dd4c46dc2931111189e8d119d4d8.tar.gz
chromium_src-85786f935163dd4c46dc2931111189e8d119d4d8.tar.bz2
Retrial of the first step to port file_util::CountFilesCreatedAfter()
Submitting http://codereview.chromium.org/75033 on behalf of hamaji Review URL: http://codereview.chromium.org/67276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/automated_ui_tests/automated_ui_tests.cc7
-rw-r--r--chrome/test/automated_ui_tests/automated_ui_tests.h6
-rw-r--r--chrome/test/ui/ui_test.cc8
-rw-r--r--chrome/test/ui/ui_test.h7
4 files changed, 12 insertions, 16 deletions
diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc
index 7c17706..e634a71 100644
--- a/chrome/test/automated_ui_tests/automated_ui_tests.cc
+++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc
@@ -11,6 +11,7 @@
#include "base/rand_util.h"
#include "base/string_util.h"
#include "base/sys_info.h"
+#include "base/time.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/character_encoding.h"
@@ -81,11 +82,11 @@ const std::string kDialogs[] = {
};
AutomatedUITest::AutomatedUITest()
- : total_crashes_(0),
+ : test_start_time_(base::Time::NowFromSystemTime()),
+ total_crashes_(0),
debug_logging_enabled_(false),
post_action_delay_(0) {
show_window_ = true;
- GetSystemTimeAsFileTime(&test_start_time_);
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
if (parsed_command_line.HasSwitch(kDebugModeSwitch))
debug_logging_enabled_ = true;
@@ -941,7 +942,7 @@ std::wstring AutomatedUITest::GetMostRecentCrashDump() {
}
bool AutomatedUITest::DidCrash(bool update_total_crashes) {
- std::wstring crash_dump_path;
+ FilePath crash_dump_path;
PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_path);
// Each crash creates two dump files, so we divide by two here.
int actual_crashes = file_util::CountFilesCreatedAfter(
diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.h b/chrome/test/automated_ui_tests/automated_ui_tests.h
index fc557cf..754b598 100644
--- a/chrome/test/automated_ui_tests/automated_ui_tests.h
+++ b/chrome/test/automated_ui_tests/automated_ui_tests.h
@@ -104,6 +104,10 @@
#include "chrome/test/automated_ui_tests/automated_ui_test_base.h"
#include "chrome/test/ui/ui_test.h"
+namespace base {
+class Time;
+}
+
class AutomatedUITest : public AutomatedUITestBase {
protected:
AutomatedUITest();
@@ -456,7 +460,7 @@ class AutomatedUITest : public AutomatedUITestBase {
XmlWriter xml_writer_;
// Time the test was started. Used to find crash dumps.
- FILETIME test_start_time_;
+ base::Time test_start_time_;
// Number of times the browser has crashed during this run.
// Used to check for new crashes.
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index a5f2566..ddea594 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -110,17 +110,13 @@ UITest::UITest()
include_testing_id_(true),
use_existing_browser_(default_use_existing_browser_),
enable_file_cookies_(true),
+ test_start_time_(base::Time::NowFromSystemTime()),
command_execution_timeout_ms_(kMaxTestExecutionTime),
action_timeout_ms_(kWaitForActionMsec),
action_max_timeout_ms_(kWaitForActionMaxMsec),
sleep_timeout_ms_(kWaitForActionMsec) {
PathService::Get(chrome::DIR_APP, &browser_directory_);
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
-#if defined(OS_WIN)
- GetSystemTimeAsFileTime(&test_start_time_);
-#else
- // http://code.google.com/p/chromium/issues/detail?id=9833
-#endif
}
void UITest::SetUp() {
@@ -165,7 +161,7 @@ void UITest::TearDown() {
#if defined(OS_WIN)
// Check for crashes during the test
- std::wstring crash_dump_path;
+ FilePath crash_dump_path;
PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_path);
// Each crash creates two dump files, so we divide by two here.
int actual_crashes =
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index 0fad7a1..3b37b98 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -444,13 +444,8 @@ class UITest : public testing::Test {
bool enable_file_cookies_; // Enable file cookies, default is true.
private:
-#if defined(OS_WIN)
- // TODO(port): make this use base::Time instead. It would seem easy, but
- // the code also depends on file_util::CountFilesCreatedAfter which hasn't
- // yet been made portable.
- FILETIME test_start_time_; // Time the test was started
+ base::Time test_start_time_; // Time the test was started
// (so we can check for new crash dumps)
-#endif
static bool no_sandbox_;
static bool safe_plugins_;
static bool full_memory_dump_; // If true, write full memory dump