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

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: Add widget->Show(), widget->Minimize() calls Created 5 years, 5 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, CreateMinimized) {
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 widget->Show();
113 widget->Minimize();
joone 2015/07/01 00:05:42 Now, this test case is almost like the change in S
sadrul 2015/07/01 03:50:56 Isn't the purpose of this CL to make sure Show() d
joone 2015/07/01 22:50:15 Yes, Minimized() should not be necessary, but the
114
115 EXPECT_TRUE(widget->IsMinimized());
116 widget->CloseNow();
117 }
118
103 class TestLayoutManagerBase : public aura::LayoutManager { 119 class TestLayoutManagerBase : public aura::LayoutManager {
104 public: 120 public:
105 TestLayoutManagerBase() {} 121 TestLayoutManagerBase() {}
106 ~TestLayoutManagerBase() override {} 122 ~TestLayoutManagerBase() override {}
107 123
108 // aura::LayoutManager: 124 // aura::LayoutManager:
109 void OnWindowResized() override {} 125 void OnWindowResized() override {}
110 void OnWindowAddedToLayout(aura::Window* child) override {} 126 void OnWindowAddedToLayout(aura::Window* child) override {}
111 void OnWillRemoveWindowFromLayout(aura::Window* child) override {} 127 void OnWillRemoveWindowFromLayout(aura::Window* child) override {}
112 void OnWindowRemovedFromLayout(aura::Window* child) override {} 128 void OnWindowRemovedFromLayout(aura::Window* child) override {}
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 delegate->ClearGotMove(); 481 delegate->ClearGotMove();
466 // Simulate a maximize with animation. 482 // Simulate a maximize with animation.
467 delete widget->GetNativeView()->RecreateLayer().release(); 483 delete widget->GetNativeView()->RecreateLayer().release();
468 widget->SetBounds(gfx::Rect(0, 0, 500, 500)); 484 widget->SetBounds(gfx::Rect(0, 0, 500, 500));
469 EXPECT_TRUE(delegate->got_move()); 485 EXPECT_TRUE(delegate->got_move());
470 widget->CloseNow(); 486 widget->CloseNow();
471 } 487 }
472 488
473 } // namespace 489 } // namespace
474 } // namespace views 490 } // 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