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

Unified Diff: components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc

Issue 1749323002: Update WindowTree::OnWindowInputEventAck to include handled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing Component Build DEPS Created 4 years, 9 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
Index: components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
diff --git a/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc b/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
index 69c498be0b90b410dfb54bd3f84b40d8e28023a2..b82225769b265adc6be3b245e49c830ba1921e52 100644
--- a/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
+++ b/components/mus/public/cpp/tests/window_tree_client_impl_unittest.cc
@@ -27,6 +27,12 @@
#include "ui/events/event_utils.h"
#include "ui/gfx/geometry/rect.h"
+namespace {
+
+void DoNothingBool(bool result) {}
+
+} // namespace
+
namespace mus {
mojo::Array<uint8_t> Int32ToPropertyTransportValue(int32_t value) {
@@ -122,21 +128,22 @@ class TestInputEventHandler : public InputEventHandler {
void AckEvent() {
DCHECK(should_manually_ack_);
DCHECK(!ack_callback_.is_null());
- ack_callback_.Run();
- ack_callback_ = base::Closure();
+ ack_callback_.Run(true);
+ ack_callback_ = base::Bind(&::DoNothingBool);
}
void Reset() {
received_event_ = false;
- ack_callback_ = base::Closure();
+ ack_callback_ = base::Bind(&::DoNothingBool);
}
bool received_event() const { return received_event_; }
private:
// InputEventHandler:
- void OnWindowInputEvent(Window* target,
- mojom::EventPtr event,
- scoped_ptr<base::Closure>* ack_callback) override {
+ void OnWindowInputEvent(
+ Window* target,
+ mojom::EventPtr event,
+ scoped_ptr<base::Callback<void(bool)>>* ack_callback) override {
EXPECT_FALSE(received_event_)
<< "Observer was not reset after receiving event.";
received_event_ = true;
@@ -148,7 +155,7 @@ class TestInputEventHandler : public InputEventHandler {
bool received_event_;
bool should_manually_ack_;
- base::Closure ack_callback_;
+ base::Callback<void(bool)> ack_callback_;
DISALLOW_COPY_AND_ASSIGN(TestInputEventHandler);
};
« no previous file with comments | « components/mus/public/cpp/tests/test_window_tree.cc ('k') | components/mus/public/interfaces/window_tree.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698