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

Unified Diff: ui/views/controls/native/native_view_host_mac_unittest.mm

Issue 2654413002: Stretching NativeViewHost, and misc tab capture fixes.
Patch Set: Gettin' it all working on ui/cocoa and MacViews too. Created 3 years, 10 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: ui/views/controls/native/native_view_host_mac_unittest.mm
diff --git a/ui/views/controls/native/native_view_host_mac_unittest.mm b/ui/views/controls/native/native_view_host_mac_unittest.mm
index 0208dc14a5b9aac4aff8936bdb903984c8cf384f..6c9e071e14a6942e56ced8fc5fa83e660b589340 100644
--- a/ui/views/controls/native/native_view_host_mac_unittest.mm
+++ b/ui/views/controls/native/native_view_host_mac_unittest.mm
@@ -100,6 +100,24 @@ void CreateHost() {
DestroyHost();
}
+// Test that the content windows' bounds are set to the correct values while the
+// rendering size is equal or not equal to the View size.
+TEST_F(NativeViewHostMacTest, ContentViewPositionAndSize) {
+ CreateHost();
+ toplevel()->SetBounds(gfx::Rect(0, 0, 100, 100));
+ EXPECT_EQ(gfx::Transform(), host()->native_view()->transform());
+
+ native_host()->ShowWidget(5, 10, 100, 100, 200, 200);
+ EXPECT_EQ(gfx::Rect(0, 0, 200, 200).ToString(),
+ host()->native_view()->bounds().ToString());
+
+ native_host()->ShowWidget(10, 25, 50, 50, 50, 50);
+ EXPECT_EQ(gfx::Rect(0, 0, 50, 50).ToString(),
+ host()->native_view()->bounds().ToString());
+
+ DestroyHost();
+}
+
// Ensure the native view is hidden along with its host, and when detaching, or
// when attaching to a host that is already hidden.
TEST_F(NativeViewHostMacTest, NativeViewHidden) {
« no previous file with comments | « ui/views/controls/native/native_view_host_mac.mm ('k') | ui/views/controls/native/native_view_host_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698