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

Unified Diff: ash/wm/window_util_unittest.cc

Issue 2251843002: Add window property for restore bounds when virtual keyboard is enabled. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: ash/wm/window_util_unittest.cc
diff --git a/ash/wm/window_util_unittest.cc b/ash/wm/window_util_unittest.cc
index 5c18e6b58f85ae83b5281cad6be2cdd4e6c0fcb8..db8ce35623bc52fcecd9bbc3bf3b9242e7942b88 100644
--- a/ash/wm/window_util_unittest.cc
+++ b/ash/wm/window_util_unittest.cc
@@ -7,9 +7,12 @@
#include "ash/aura/wm_window_aura.h"
#include "ash/common/wm/window_positioning_utils.h"
#include "ash/common/wm/window_state.h"
+#include "ash/common/wm_window.h"
+#include "ash/common/wm_window_property.h"
#include "ash/screen_util.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/window_state_aura.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
namespace ash {
@@ -92,4 +95,22 @@ TEST_F(WindowUtilTest, AdjustBoundsToEnsureMinimumVisibility) {
GetAdjustedBounds(visible_bounds_left, gfx::Rect(0, 0, 150, 150)));
}
+// Test that WmWindow can get a Rect property set by aura::Window
+TEST_F(WindowUtilTest, RectPropertyTest) {
+ UpdateDisplay("500x400, 600x400");
oshima 2016/08/16 23:14:02 This will not work on windows. Do you need this?
hariank 2016/08/16 23:35:06 Done.
+ std::unique_ptr<aura::Window> window(
+ CreateTestWindowInShellWithBounds(gfx::Rect()));
+
+ gfx::Rect* prop_rect = new gfx::Rect(0, 0, 100, 100);
+ window->SetProperty(aura::client::kVKNewBoundsKey, prop_rect);
+
+ WmWindow* wm_window = WmWindowAura::Get(window.get());
+ EXPECT_EQ(wm_window->GetRectProperty(WmWindowProperty::VK_NEW_BOUNDS),
+ prop_rect);
+
+ window->ClearProperty(aura::client::kVKNewBoundsKey);
+ EXPECT_EQ(wm_window->GetRectProperty(WmWindowProperty::VK_NEW_BOUNDS),
+ nullptr);
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698