| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 380 |
| 381 // Verifies that bounds changes applied to a window owned by a different | 381 // Verifies that bounds changes applied to a window owned by a different |
| 382 // connection can be refused. | 382 // connection can be refused. |
| 383 TEST_F(WindowServerTest, SetBoundsSecurity) { | 383 TEST_F(WindowServerTest, SetBoundsSecurity) { |
| 384 class TestWindowManagerDelegate : public WindowManagerDelegate { | 384 class TestWindowManagerDelegate : public WindowManagerDelegate { |
| 385 public: | 385 public: |
| 386 TestWindowManagerDelegate() {} | 386 TestWindowManagerDelegate() {} |
| 387 ~TestWindowManagerDelegate() override {} | 387 ~TestWindowManagerDelegate() override {} |
| 388 | 388 |
| 389 // WindowManagerDelegate: | 389 // WindowManagerDelegate: |
| 390 void SetWindowManagerClient(WindowManagerClient* client) override {} |
| 390 bool OnWmSetBounds(Window* window, gfx::Rect* bounds) override { | 391 bool OnWmSetBounds(Window* window, gfx::Rect* bounds) override { |
| 391 return false; | 392 return false; |
| 392 } | 393 } |
| 393 bool OnWmSetProperty(Window* window, | 394 bool OnWmSetProperty(Window* window, |
| 394 const std::string& name, | 395 const std::string& name, |
| 395 scoped_ptr<std::vector<uint8_t>>* new_data) override { | 396 scoped_ptr<std::vector<uint8_t>>* new_data) override { |
| 396 return true; | 397 return true; |
| 397 } | 398 } |
| 398 Window* OnWmCreateTopLevelWindow( | 399 Window* OnWmCreateTopLevelWindow( |
| 399 std::map<std::string, std::vector<uint8_t>>* properties) override { | 400 std::map<std::string, std::vector<uint8_t>>* properties) override { |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 embed_window->SetBounds(gfx::Rect(21, 22, 23, 24)); | 1102 embed_window->SetBounds(gfx::Rect(21, 22, 23, 24)); |
| 1102 WaitForBoundsToChange(GetFirstRoot(embedded_connection)); | 1103 WaitForBoundsToChange(GetFirstRoot(embedded_connection)); |
| 1103 EXPECT_TRUE(gfx::Rect(21, 22, 23, 24) == | 1104 EXPECT_TRUE(gfx::Rect(21, 22, 23, 24) == |
| 1104 GetFirstRoot(embedded_connection)->bounds()); | 1105 GetFirstRoot(embedded_connection)->bounds()); |
| 1105 EXPECT_TRUE(gfx::Insets(1, 2, 3, 4) == | 1106 EXPECT_TRUE(gfx::Insets(1, 2, 3, 4) == |
| 1106 GetFirstRoot(embedded_connection)->client_area()); | 1107 GetFirstRoot(embedded_connection)->client_area()); |
| 1107 } | 1108 } |
| 1108 | 1109 |
| 1109 } // namespace ws | 1110 } // namespace ws |
| 1110 } // namespace mus | 1111 } // namespace mus |
| OLD | NEW |