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

Unified Diff: chrome/browser/chromeos/system/ash_focus_cycle_browsertest.cc

Issue 13866011: CrOS: Wait for key press to be processed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/system/ash_focus_cycle_browsertest.cc
diff --git a/chrome/browser/chromeos/system/ash_focus_cycle_browsertest.cc b/chrome/browser/chromeos/system/ash_focus_cycle_browsertest.cc
index b4e34e3562392f92172a0291e6c7f6bc2402f7c9..6a909cf9301d441ce839025eca6caf652f94df4f 100644
--- a/chrome/browser/chromeos/system/ash_focus_cycle_browsertest.cc
+++ b/chrome/browser/chromeos/system/ash_focus_cycle_browsertest.cc
@@ -5,6 +5,9 @@
#include "ash/focus_cycler.h"
#include "ash/shell.h"
#include "ash/wm/window_util.h"
+#include "base/bind.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/run_loop.h"
#include "base/stringprintf.h"
#include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h"
#include "chrome/test/base/ui_controls.h"
@@ -44,9 +47,19 @@ class AshFocusCycleTest : public CrosInProcessBrowserTest {
void PressEscape() {
aura::Window* window = ash::wm::GetActiveWindow();
CHECK(window);
- ui_controls::SendKeyPress(window, ui::VKEY_ESCAPE,
- false, false, false, false);
- content::RunAllPendingInMessageLoop();
+ wait_for_key_press_.reset(new base::RunLoop());
+ ui_controls::SendKeyPressNotifyWhenDone(
+ window, ui::VKEY_ESCAPE,
+ false, false, false, false,
+ base::Bind(&AshFocusCycleTest::QuitWaiting, base::Unretained(this)));
+ wait_for_key_press_->Run();
+ }
+
+ private:
+ scoped_ptr<base::RunLoop> wait_for_key_press_;
+
+ void QuitWaiting() {
+ wait_for_key_press_->Quit();
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698