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

Unified Diff: src/platform/window_manager/window_manager_test.cc

Issue 527005: wm: Make WM_MOVE_PANEL use top-right coordinates. (Closed)
Patch Set: fix a poorly-worded sentence Created 10 years, 11 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 | « src/platform/window_manager/window_manager.cc ('k') | src/platform/window_manager/wm_ipc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/window_manager/window_manager_test.cc
diff --git a/src/platform/window_manager/window_manager_test.cc b/src/platform/window_manager/window_manager_test.cc
index 0b87844b394a522e4a03b77d1d629a870b5c2dc4..dce957b59319f735d6d8850afb3b370577b100cb 100644
--- a/src/platform/window_manager/window_manager_test.cc
+++ b/src/platform/window_manager/window_manager_test.cc
@@ -672,6 +672,25 @@ TEST_F(WindowManagerTest, ClientListProperties) {
TestIntArrayProperty(root_xid, stacking_atom, 0);
}
+TEST_F(WindowManagerTest, WmIpcVersion) {
+ // We should assume version 0 if we haven't received a message from Chrome.
+ EXPECT_EQ(0, wm_->wm_ipc_version());
+
+ // Now send the WM a message telling it that Chrome is using version 3.
+ // We use WmIpc to generate the XEvent for us and then pass it to
+ // WindowManager::HandleEvent().
+ MockXConnection::WindowInfo* info = xconn_->GetWindowInfoOrDie(wm_->wm_xid());
+ EXPECT_TRUE(info->client_messages.empty());
+ WmIpc::Message msg(WmIpc::Message::WM_NOTIFY_IPC_VERSION);
+ msg.set_param(0, 3);
+ ASSERT_TRUE(wm_->wm_ipc()->SendMessage(wm_->wm_xid(), msg));
+ ASSERT_EQ(static_cast<size_t>(1), info->client_messages.size());
+ XEvent event;
+ event.xclient = info->client_messages[0];
+ EXPECT_TRUE(wm_->HandleEvent(&event));
+ EXPECT_EQ(3, wm_->wm_ipc_version());
+}
+
} // namespace window_manager
int main(int argc, char **argv) {
« no previous file with comments | « src/platform/window_manager/window_manager.cc ('k') | src/platform/window_manager/wm_ipc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698