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

Side by Side Diff: ui/views/widget/widget_unittest.cc

Issue 927233003: MacViews: Fix positioning of top-level Widgets with parents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150129-MacViews-Bringup5
Patch Set: Added comment to BridgedNativeWidget Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « ui/views/widget/native_widget_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 // An extension to WidgetBoundsChanged to ensure notifications are forwarded 998 // An extension to WidgetBoundsChanged to ensure notifications are forwarded
999 // by the NativeWidget implementation. 999 // by the NativeWidget implementation.
1000 TEST_F(WidgetObserverTest, WidgetBoundsChangedNative) { 1000 TEST_F(WidgetObserverTest, WidgetBoundsChangedNative) {
1001 // Don't use NewWidget(), so that the Init() flow can be observed to ensure 1001 // Don't use NewWidget(), so that the Init() flow can be observed to ensure
1002 // consistency across platforms. 1002 // consistency across platforms.
1003 Widget* widget = new Widget(); // Note: owned by NativeWidget. 1003 Widget* widget = new Widget(); // Note: owned by NativeWidget.
1004 widget->AddObserver(this); 1004 widget->AddObserver(this);
1005 1005
1006 EXPECT_FALSE(widget_bounds_changed()); 1006 EXPECT_FALSE(widget_bounds_changed());
1007 1007
1008 // Init causes a bounds change, even while not showing. 1008 // Init causes a bounds change, even while not showing. Note some platforms
1009 widget->Init(CreateParams(Widget::InitParams::TYPE_WINDOW)); 1009 // cause a bounds change even when the bounds are empty. Mac does not.
1010 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW);
1011 params.bounds = gfx::Rect(0, 0, 100, 100);
1012 widget->Init(params);
1010 EXPECT_TRUE(widget_bounds_changed()); 1013 EXPECT_TRUE(widget_bounds_changed());
1011 reset(); 1014 reset();
1012 1015
1013 // Resizing while hidden, triggers a change. 1016 // Resizing while hidden, triggers a change.
1014 widget->SetSize(gfx::Size(160, 100)); 1017 widget->SetSize(gfx::Size(160, 100));
1015 EXPECT_FALSE(widget->IsVisible()); 1018 EXPECT_FALSE(widget->IsVisible());
1016 EXPECT_TRUE(widget_bounds_changed()); 1019 EXPECT_TRUE(widget_bounds_changed());
1017 reset(); 1020 reset();
1018 1021
1019 // Setting the same size does nothing. 1022 // Setting the same size does nothing.
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after
3409 bool handled = false; 3412 bool handled = false;
3410 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled); 3413 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled);
3411 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled); 3414 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled);
3412 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled); 3415 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled);
3413 widget.CloseNow(); 3416 widget.CloseNow();
3414 } 3417 }
3415 #endif 3418 #endif
3416 3419
3417 } // namespace test 3420 } // namespace test
3418 } // namespace views 3421 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698