Index: chrome/test/ui/ui_test.h |
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h |
index 8601bb8431edaf14edc9600926d6b72264204b23..1a355bf73b749bd9fd5b07c080b7e78f511bebbb 100644 |
--- a/chrome/test/ui/ui_test.h |
+++ b/chrome/test/ui/ui_test.h |
@@ -17,15 +17,28 @@ |
// Tests which need to launch the browser with a particular set of command-line |
// arguments should set the value of launch_arguments_ in their constructors. |
+#include "build/build_config.h" |
+ |
+#if defined(OS_WIN) |
#include <windows.h> |
+#endif |
#include <string> |
+#include "base/message_loop.h" |
#include "base/path_service.h" |
+#include "base/process.h" |
#include "base/scoped_ptr.h" |
#include "base/time.h" |
+#if defined(OS_WIN) |
+// TODO(evanm): we should be able to just forward-declare |
+// AutomationProxy here, but many files that #include this one don't |
+// themselves #include automation_proxy.h. |
#include "chrome/test/automation/automation_proxy.h" |
+#endif |
#include "testing/gtest/include/gtest/gtest.h" |
+class AutomationProxy; |
+class BrowserProxy; |
class DictionaryValue; |
class GURL; |
class TabProxy; |
@@ -33,10 +46,10 @@ class TabProxy; |
class UITest : public testing::Test { |
protected: |
// Delay to let browser complete a requested action. |
- static const int kWaitForActionMsec = 2000; |
- static const int kWaitForActionMaxMsec = 10000; |
+ static const int kWaitForActionMsec; |
+ static const int kWaitForActionMaxMsec; |
// Delay to let the browser complete the test. |
- static const int kMaxTestExecutionTime = 30000; |
+ static const int kMaxTestExecutionTime; |
// String to display when a test fails because the crash service isn't |
// running. |
@@ -205,7 +218,7 @@ class UITest : public testing::Test { |
// Get the handle of browser process connected to the automation. This |
// function only retruns a reference to the handle so the caller does not |
// own the handle returned. |
- HANDLE process() { return process_; } |
+ base::ProcessHandle process() { return process_; } |
public: |
// Get/Set a flag to run the renderer in process when running the |
@@ -351,8 +364,14 @@ class UITest : public testing::Test { |
protected: |
AutomationProxy* automation() { |
+#if defined(OS_WIN) |
EXPECT_TRUE(server_.get()); |
return server_.get(); |
+#else |
+ // TODO(port): restore when AutomationProxy bits work. |
+ NOTIMPLEMENTED(); |
+ return NULL; |
+#endif |
} |
// Wait a certain amount of time for all the app processes to exit, |
@@ -373,7 +392,7 @@ class UITest : public testing::Test { |
std::wstring test_data_directory_; // Path to the unit test data, |
// with no trailing slash |
std::wstring launch_arguments_; // Arguments to the browser on launch. |
- int expected_errors_; // The number of errors expected during |
+ size_t expected_errors_; // The number of errors expected during |
// the run (generally 0). |
int expected_crashes_; // The number of crashes expected during |
// the run (generally 0). |
@@ -384,7 +403,7 @@ class UITest : public testing::Test { |
bool dom_automation_enabled_; // This can be set to true to have the |
// test run the dom automation case. |
std::wstring template_user_data_; // See set_template_user_data(). |
- HANDLE process_; // Handle the the first Chrome process. |
+ base::ProcessHandle process_; // Handle to the first Chrome process. |
std::wstring user_data_dir_; // User data directory used for the test |
static bool in_process_renderer_; // true if we're in single process mode |
bool show_window_; // Determines if the window is shown or |
@@ -398,8 +417,13 @@ class UITest : public testing::Test { |
// Default value comes from static. |
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 |
// (so we can check for new crash dumps) |
+#endif |
static bool in_process_plugins_; |
static bool no_sandbox_; |
static bool safe_plugins_; |
@@ -417,7 +441,10 @@ class UITest : public testing::Test { |
static int timeout_ms_; // Timeout in milliseconds to wait |
// for an test to finish. |
static std::wstring js_flags_; // Flags passed to the JS engine. |
- ::scoped_ptr<AutomationProxy> server_; |
+#if defined(OS_WIN) |
+ // TODO(port): restore me after AutomationProxy works. |
+ scoped_ptr<AutomationProxy> server_; |
+#endif |
MessageLoop message_loop_; // Enables PostTask to main thread. |