Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2812)

Unified Diff: chrome/test/base/chrome_test_launcher.cc

Issue 10803026: Get content_browsertest working. I've added a simple test for now, and will convert the tests in sr… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: get it working on mac + linux, fix unittests crash, and fix unittest link error and add missing dep… Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/chrome_test_launcher.cc
===================================================================
--- chrome/test/base/chrome_test_launcher.cc (revision 147044)
+++ chrome/test/base/chrome_test_launcher.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/run_loop.h"
#include "base/scoped_temp_dir.h"
#include "base/test/test_file_util.h"
#include "chrome/app/chrome_main_delegate.h"
@@ -13,6 +14,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/test/base/chrome_test_suite.h"
#include "content/public/app/content_main.h"
+#include "content/public/browser/browser_thread.h"
#if defined(OS_MACOSX)
#include "chrome/browser/chrome_browser_application_mac.h"
@@ -23,6 +25,10 @@
#include "sandbox/src/sandbox_types.h"
#endif // defined(OS_WIN)
+#if defined(TOOLKIT_VIEWS)
+#include "ui/views/focus/accelerator_handler.h"
+#endif
+
class ChromeTestLauncherDelegate : public test_launcher::TestLauncherDelegate {
public:
ChromeTestLauncherDelegate() {
@@ -106,9 +112,29 @@
return true;
}
+ virtual void PreRunMessageLoop(base::RunLoop* run_loop) OVERRIDE {
+#if !defined(USE_AURA) && defined(TOOLKIT_VIEWS)
+ DCHECK(!handler_.get());
+ if (content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
+ handler_.reset(new views::AcceleratorHandler);
+ run_loop->set_dispatcher(handler_.get());
+ }
+#endif
+ }
+
+ virtual void PostRunMessageLoop() {
+#if !defined(USE_AURA) && defined(TOOLKIT_VIEWS)
+ handler_.reset();
+#endif
+ }
+
private:
ScopedTempDir temp_dir_;
+#if !defined(USE_AURA) && defined(TOOLKIT_VIEWS)
+ scoped_ptr<views::AcceleratorHandler> handler_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(ChromeTestLauncherDelegate);
};
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698