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

Side by Side Diff: components/mus/view_tree_unittest.cc

Issue 1352043005: mus: Implement Window Server Capture Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "components/mus/client_connection.h" 9 #include "components/mus/client_connection.h"
10 #include "components/mus/connection_manager.h" 10 #include "components/mus/connection_manager.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 mojo::ViewTreePtr tree, 54 mojo::ViewTreePtr tree,
55 Id focused_view_id, 55 Id focused_view_id,
56 uint32_t access_policy) override { 56 uint32_t access_policy) override {
57 // TODO(sky): add test coverage of |focused_view_id|. 57 // TODO(sky): add test coverage of |focused_view_id|.
58 tracker_.OnEmbed(connection_id, root.Pass()); 58 tracker_.OnEmbed(connection_id, root.Pass());
59 } 59 }
60 void OnEmbeddedAppDisconnected(uint32_t view) override { 60 void OnEmbeddedAppDisconnected(uint32_t view) override {
61 tracker_.OnEmbeddedAppDisconnected(view); 61 tracker_.OnEmbeddedAppDisconnected(view);
62 } 62 }
63 void OnUnembed() override { tracker_.OnUnembed(); } 63 void OnUnembed() override { tracker_.OnUnembed(); }
64 void OnLostCapture(Id view_id) override {}
64 void OnViewBoundsChanged(uint32_t view, 65 void OnViewBoundsChanged(uint32_t view,
65 mojo::RectPtr old_bounds, 66 mojo::RectPtr old_bounds,
66 mojo::RectPtr new_bounds) override { 67 mojo::RectPtr new_bounds) override {
67 tracker_.OnViewBoundsChanged(view, old_bounds.Pass(), new_bounds.Pass()); 68 tracker_.OnViewBoundsChanged(view, old_bounds.Pass(), new_bounds.Pass());
68 } 69 }
69 void OnViewViewportMetricsChanged( 70 void OnViewViewportMetricsChanged(
70 mojo::ViewportMetricsPtr old_metrics, 71 mojo::ViewportMetricsPtr old_metrics,
71 mojo::ViewportMetricsPtr new_metrics) override { 72 mojo::ViewportMetricsPtr new_metrics) override {
72 tracker_.OnViewViewportMetricsChanged(old_metrics.Pass(), 73 tracker_.OnViewViewportMetricsChanged(old_metrics.Pass(),
73 new_metrics.Pass()); 74 new_metrics.Pass());
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // root-view is created). 211 // root-view is created).
211 mojo::ViewportMetrics metrics; 212 mojo::ViewportMetrics metrics;
212 metrics.size_in_pixels = mojo::Size::From(gfx::Size(400, 300)); 213 metrics.size_in_pixels = mojo::Size::From(gfx::Size(400, 300));
213 metrics.device_pixel_ratio = 1.f; 214 metrics.device_pixel_ratio = 1.f;
214 delegate->OnViewportMetricsChanged(mojo::ViewportMetrics(), metrics); 215 delegate->OnViewportMetricsChanged(mojo::ViewportMetrics(), metrics);
215 } 216 }
216 void SchedulePaint(const ServerView* view, const gfx::Rect& bounds) override { 217 void SchedulePaint(const ServerView* view, const gfx::Rect& bounds) override {
217 } 218 }
218 void SetViewportSize(const gfx::Size& size) override {} 219 void SetViewportSize(const gfx::Size& size) override {}
219 void SetTitle(const base::string16& title) override {} 220 void SetTitle(const base::string16& title) override {}
221 void SetCapture() override {}
220 const mojo::ViewportMetrics& GetViewportMetrics() override { 222 const mojo::ViewportMetrics& GetViewportMetrics() override {
221 return display_metrices_; 223 return display_metrices_;
222 } 224 }
223 void UpdateTextInputState(const ui::TextInputState& state) override {} 225 void UpdateTextInputState(const ui::TextInputState& state) override {}
224 void SetImeVisibility(bool visible) override {} 226 void SetImeVisibility(bool visible) override {}
225 227
226 private: 228 private:
227 mojo::ViewportMetrics display_metrices_; 229 mojo::ViewportMetrics display_metrices_;
228 230
229 DISALLOW_COPY_AND_ASSIGN(TestDisplayManager); 231 DISALLOW_COPY_AND_ASSIGN(TestDisplayManager);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 EXPECT_EQ("Focused id=2,1", 443 EXPECT_EQ("Focused id=2,1",
442 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); 444 ChangesToDescription1(*wm_client()->tracker()->changes())[0]);
443 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size()); 445 ASSERT_EQ(2u, embed_connection->tracker()->changes()->size());
444 EXPECT_EQ("Focused id=2,1", 446 EXPECT_EQ("Focused id=2,1",
445 ChangesToDescription1(*embed_connection->tracker()->changes())[0]); 447 ChangesToDescription1(*embed_connection->tracker()->changes())[0]);
446 EXPECT_EQ("InputEvent view=2,1 event_action=4", 448 EXPECT_EQ("InputEvent view=2,1 event_action=4",
447 ChangesToDescription1(*embed_connection->tracker()->changes())[1]); 449 ChangesToDescription1(*embed_connection->tracker()->changes())[1]);
448 } 450 }
449 451
450 } // namespace mus 452 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698