diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 23:09:39 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 23:09:39 +0000 |
commit | 154a9820511c94bdcc8a69a3f7cc69b56ea75cd1 (patch) | |
tree | 41404665474d256283ab285ca688c5913d3eb22c /views/view_unittest.cc | |
parent | 2186fec4df1dde813a12011eb1ea650ce8470ea2 (diff) | |
download | chromium_src-154a9820511c94bdcc8a69a3f7cc69b56ea75cd1.zip chromium_src-154a9820511c94bdcc8a69a3f7cc69b56ea75cd1.tar.gz chromium_src-154a9820511c94bdcc8a69a3f7cc69b56ea75cd1.tar.bz2 |
Fixed a few bugs in view/gtk framework
NativeControlGtk
* Layout if the visibility is changed after the native view is created.
(I also added DCHECK(GetWidget()) to make sure Wiget is available at this point)
NativeViewHostGtk
* decrement the native_view's ref count only if it still has a parent.
* create fixed in AddedToWidget if fixed_ does not exist. This can happen when
a view is removed, then added.
BUG=none
TEST=unit test for last 2 bugs is added to view_unittest.cc (ChangeVisibility).
Review URL: http://codereview.chromium.org/219035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view_unittest.cc')
-rw-r--r-- | views/view_unittest.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/views/view_unittest.cc b/views/view_unittest.cc index 613c522..bad592b 100644 --- a/views/view_unittest.cc +++ b/views/view_unittest.cc @@ -1186,6 +1186,34 @@ TEST_F(DefaultButtonTest, DialogDefaultButtonTest) { } #endif +//////////////////////////////////////////////////////////////////////////////// +// View hierachy / Visibility changes +//////////////////////////////////////////////////////////////////////////////// +/* +TEST_F(ViewTest, ChangeVisibility) { +#if defined(OS_LINUX) + // Make CRITICAL messages fatal + // TODO(oshima): we probably should enable this for entire tests on linux. + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); +#endif + scoped_ptr<views::Widget> window(CreateWidget()); + window->Init(NULL, gfx::Rect(0, 0, 500, 300)); + views::RootView* root_view = window->GetRootView(); + NativeButton* native = new NativeButton(NULL, L"Native"); + + root_view->SetContentsView(native); + native->SetVisible(true); + + root_view->RemoveChildView(native); + native->SetVisible(false); + // Change visibility to true with no widget. + native->SetVisible(true); + + root_view->SetContentsView(native); + native->SetVisible(true); +} +*/ + #if defined(OS_LINUX) class TestViewWithControls : public View { public: |