summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui_test_utils.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 22:18:09 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 22:18:09 +0000
commit108c2a1d2780d49121e16b18a29580ef4d28c790 (patch)
treeeca587b489c7c22924814f4475c4a56ec5bc5b8e /chrome/test/ui_test_utils.cc
parent9e241cc8a7320c0a818da0ddac1bc3910fc1b60a (diff)
downloadchromium_src-108c2a1d2780d49121e16b18a29580ef4d28c790.zip
chromium_src-108c2a1d2780d49121e16b18a29580ef4d28c790.tar.gz
chromium_src-108c2a1d2780d49121e16b18a29580ef4d28c790.tar.bz2
Porting the browser tests to Unix.
The browser tests are an alternative to UI tests. They provide a way to exercise the browser from within the test (without having the test and the browser running in different processes). In order to ensure atexit hanlders are run after each tests and static initializers start fresh for each test, each test is run in a new process (on Linux and Mac). On Windows, a DLL containing the test is loaded/unloaded for each tests. BUG=None TEST=Run the browser tests. Review URL: http://codereview.chromium.org/115896 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui_test_utils.cc')
-rw-r--r--chrome/test/ui_test_utils.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc
index 1f252a0..7ef658a 100644
--- a/chrome/test/ui_test_utils.cc
+++ b/chrome/test/ui_test_utils.cc
@@ -14,9 +14,11 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_service.h"
+#if defined (OS_WIN)
+#include "views/widget/accelerator_handler.h"
+#endif
#include "googleurl/src/gurl.h"
#include "net/base/net_util.h"
-#include "views/widget/accelerator_handler.h"
namespace ui_test_utils {
@@ -101,8 +103,12 @@ void RunMessageLoop() {
MessageLoopForUI* loop = MessageLoopForUI::current();
bool did_allow_task_nesting = loop->NestableTasksAllowed();
loop->SetNestableTasksAllowed(true);
+#if defined (OS_WIN)
views::AcceleratorHandler handler;
loop->Run(&handler);
+#else
+ loop->Run();
+#endif
loop->SetNestableTasksAllowed(did_allow_task_nesting);
}