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

Side by Side Diff: services/ui/public/cpp/tests/window_tree_client_unittest.cc

Issue 2301353003: Changes ownership of WindowTreeClient (Closed)
Patch Set: fix navigation Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/public/cpp/window_tree_client.h" 5 #include "services/ui/public/cpp/window_tree_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 public: 52 public:
53 TestWindowTreeClientDelegate() {} 53 TestWindowTreeClientDelegate() {}
54 ~TestWindowTreeClientDelegate() override {} 54 ~TestWindowTreeClientDelegate() override {}
55 55
56 ui::PointerEvent* last_event_observed() { return last_event_observed_.get(); } 56 ui::PointerEvent* last_event_observed() { return last_event_observed_.get(); }
57 57
58 void Reset() { last_event_observed_.reset(); } 58 void Reset() { last_event_observed_.reset(); }
59 59
60 // WindowTreeClientDelegate: 60 // WindowTreeClientDelegate:
61 void OnEmbed(Window* root) override {} 61 void OnEmbed(Window* root) override {}
62 void OnDidDestroyClient(WindowTreeClient* client) override {} 62 void OnLostConnection(WindowTreeClient* client) override {}
63 void OnEmbedRootDestroyed(Window* root) override {}
63 void OnPointerEventObserved(const ui::PointerEvent& event, 64 void OnPointerEventObserved(const ui::PointerEvent& event,
64 Window* target) override { 65 Window* target) override {
65 last_event_observed_.reset(new ui::PointerEvent(event)); 66 last_event_observed_.reset(new ui::PointerEvent(event));
66 } 67 }
67 68
68 private: 69 private:
69 std::unique_ptr<ui::PointerEvent> last_event_observed_; 70 std::unique_ptr<ui::PointerEvent> last_event_observed_;
70 71
71 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientDelegate); 72 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientDelegate);
72 }; 73 };
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 1076
1076 // Changes originating from server should notify observers too. 1077 // Changes originating from server should notify observers too.
1077 WindowTreeClientPrivate(setup.client()).CallOnCaptureChanged(child2, nullptr); 1078 WindowTreeClientPrivate(setup.client()).CallOnCaptureChanged(child2, nullptr);
1078 EXPECT_EQ(1, capture_recorder.capture_changed_count()); 1079 EXPECT_EQ(1, capture_recorder.capture_changed_count());
1079 EXPECT_EQ(child2_id, capture_recorder.last_gained_capture_window_id()); 1080 EXPECT_EQ(child2_id, capture_recorder.last_gained_capture_window_id());
1080 EXPECT_EQ(0, capture_recorder.last_lost_capture_window_id()); 1081 EXPECT_EQ(0, capture_recorder.last_lost_capture_window_id());
1081 capture_recorder.reset_capture_captured_count(); 1082 capture_recorder.reset_capture_captured_count();
1082 } 1083 }
1083 1084
1084 } // namespace ui 1085 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/tests/window_server_test_base.cc ('k') | services/ui/public/cpp/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698