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

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

Issue 1130033003: Make the minimize state work when creating a chrome window in CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated test case Created 5 years, 6 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_aura.cc ('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 "ui/views/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 parent->SetBounds(gfx::Rect(20, 40, 480, 320)); 93 parent->SetBounds(gfx::Rect(20, 40, 480, 320));
94 scoped_ptr<Widget> widget(new Widget()); 94 scoped_ptr<Widget> widget(new Widget());
95 NativeWidgetAura* window = Init(parent.get(), widget.get()); 95 NativeWidgetAura* window = Init(parent.get(), widget.get());
96 window->CenterWindow(gfx::Size(500, 600)); 96 window->CenterWindow(gfx::Size(500, 600));
97 97
98 // |window| should be no bigger than |parent|. 98 // |window| should be no bigger than |parent|.
99 EXPECT_EQ("20,40 480x320", window->GetNativeWindow()->bounds().ToString()); 99 EXPECT_EQ("20,40 480x320", window->GetNativeWindow()->bounds().ToString());
100 widget->CloseNow(); 100 widget->CloseNow();
101 } 101 }
102 102
103 TEST_F(NativeWidgetAuraTest, MinimizedStateTest) {
varkha 2015/06/19 16:14:56 Maybe s/MinimizedStateTest/CreateMinimized to be m
joone 2015/06/19 20:18:39 Done.
104 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
105 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
106 params.parent = NULL;
107 params.context = root_window();
108 params.show_state = ui::SHOW_STATE_MINIMIZED;
109 params.bounds.SetRect(0, 0, 1024, 800);
110 scoped_ptr<Widget> widget(new Widget());
111 widget->Init(params);
112
113 EXPECT_TRUE(widget->IsMinimized());
114 widget->CloseNow();
115 }
116
103 class TestLayoutManagerBase : public aura::LayoutManager { 117 class TestLayoutManagerBase : public aura::LayoutManager {
104 public: 118 public:
105 TestLayoutManagerBase() {} 119 TestLayoutManagerBase() {}
106 ~TestLayoutManagerBase() override {} 120 ~TestLayoutManagerBase() override {}
107 121
108 // aura::LayoutManager: 122 // aura::LayoutManager:
109 void OnWindowResized() override {} 123 void OnWindowResized() override {}
110 void OnWindowAddedToLayout(aura::Window* child) override {} 124 void OnWindowAddedToLayout(aura::Window* child) override {}
111 void OnWillRemoveWindowFromLayout(aura::Window* child) override {} 125 void OnWillRemoveWindowFromLayout(aura::Window* child) override {}
112 void OnWindowRemovedFromLayout(aura::Window* child) override {} 126 void OnWindowRemovedFromLayout(aura::Window* child) override {}
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 delegate->ClearGotMove(); 479 delegate->ClearGotMove();
466 // Simulate a maximize with animation. 480 // Simulate a maximize with animation.
467 delete widget->GetNativeView()->RecreateLayer().release(); 481 delete widget->GetNativeView()->RecreateLayer().release();
468 widget->SetBounds(gfx::Rect(0, 0, 500, 500)); 482 widget->SetBounds(gfx::Rect(0, 0, 500, 500));
469 EXPECT_TRUE(delegate->got_move()); 483 EXPECT_TRUE(delegate->got_move());
470 widget->CloseNow(); 484 widget->CloseNow();
471 } 485 }
472 486
473 } // namespace 487 } // namespace
474 } // namespace views 488 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698