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

Side by Side Diff: mash/wm/window_manager_apptest.cc

Issue 1456233002: Converts remaining windowmanager property based functions to SetProperty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « mash/wm/window_manager_application.cc ('k') | mash/wm/window_manager_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "components/mus/public/cpp/window.h" 6 #include "components/mus/public/cpp/window.h"
7 #include "components/mus/public/cpp/window_tree_connection.h" 7 #include "components/mus/public/cpp/window_tree_connection.h"
8 #include "components/mus/public/cpp/window_tree_delegate.h" 8 #include "components/mus/public/cpp/window_tree_delegate.h"
9 #include "components/mus/public/interfaces/window_manager.mojom.h" 9 #include "components/mus/public/interfaces/window_manager.mojom.h"
10 #include "components/mus/public/interfaces/window_tree.mojom.h" 10 #include "components/mus/public/interfaces/window_tree.mojom.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 private: 39 private:
40 // mus::WindowTreeDelegate: 40 // mus::WindowTreeDelegate:
41 void OnEmbed(mus::Window* root) override {} 41 void OnEmbed(mus::Window* root) override {}
42 void OnConnectionLost(mus::WindowTreeConnection* connection) override {} 42 void OnConnectionLost(mus::WindowTreeConnection* connection) override {}
43 43
44 DISALLOW_COPY_AND_ASSIGN(WindowManagerAppTest); 44 DISALLOW_COPY_AND_ASSIGN(WindowManagerAppTest);
45 }; 45 };
46 46
47 TEST_F(WindowManagerAppTest, SetPreferredSize) { 47 TEST_F(WindowManagerAppTest, OpenWindow) {
48 // TODO(beng): right now this only verifies that requests from other 48 mus::mojom::WindowManagerPtr connection;
49 // connections are blocked. We need to be able to reliably 49 ConnectToWindowManager(&connection);
50 // configure the size of the window manager's display before we
51 // can properly validate that centering actually happened.
52 mus::mojom::WindowManagerPtr connection1, connection2;
53 ConnectToWindowManager(&connection1);
54 ConnectToWindowManager(&connection2);
55 50
56 mus::Window* window_from_connection1 = OpenWindow(connection1.get()); 51 ASSERT_TRUE(OpenWindow(connection.get()));
57 mus::Window* window_from_connection2 = OpenWindow(connection2.get());
58
59 bool succeeded = false;
60 connection1->SetPreferredSize(
61 window_from_connection1->id(), mojo::Size::New(),
62 [&succeeded](mus::mojom::WindowManagerErrorCode result) {
63 succeeded = result == mus::mojom::WINDOW_MANAGER_ERROR_CODE_SUCCESS;
64 });
65 ASSERT_TRUE(connection1.WaitForIncomingResponse());
66 EXPECT_TRUE(succeeded);
67
68 succeeded = false;
69 connection1->SetPreferredSize(
70 window_from_connection2->id(), mojo::Size::New(),
71 [&succeeded](mus::mojom::WindowManagerErrorCode result) {
72 succeeded = result == mus::mojom::WINDOW_MANAGER_ERROR_CODE_SUCCESS;
73 });
74 ASSERT_TRUE(connection1.WaitForIncomingResponse());
75 EXPECT_FALSE(succeeded);
76 } 52 }
OLDNEW
« no previous file with comments | « mash/wm/window_manager_application.cc ('k') | mash/wm/window_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698