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

Side by Side Diff: ui/views/view_unittest.cc

Issue 13584010: views: Migrate the cases of "new .*NativeTextButton(" to LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: back out the changes to one_click_signin_bubble_view.* Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/test/child_modal_window.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 <map> 5 #include <map>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, point, point, 1840 ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, point, point,
1841 ui::EF_LEFT_MOUSE_BUTTON); 1841 ui::EF_LEFT_MOUSE_BUTTON);
1842 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, point, point, 1842 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, point, point,
1843 ui::EF_LEFT_MOUSE_BUTTON); 1843 ui::EF_LEFT_MOUSE_BUTTON);
1844 button_as_view_->OnMousePressed(press_event); 1844 button_as_view_->OnMousePressed(press_event);
1845 button_as_view_->OnMouseReleased(release_event); 1845 button_as_view_->OnMouseReleased(release_event);
1846 EXPECT_EQ(test_dialog_->last_pressed_button_, test_dialog_->button_drop_); 1846 EXPECT_EQ(test_dialog_->last_pressed_button_, test_dialog_->button_drop_);
1847 } 1847 }
1848 1848
1849 //////////////////////////////////////////////////////////////////////////////// 1849 ////////////////////////////////////////////////////////////////////////////////
1850 // View hierarchy / Visibility changes
1851 ////////////////////////////////////////////////////////////////////////////////
1852 /*
1853 TEST_F(ViewTest, ChangeVisibility) {
1854 #if defined(OS_LINUX)
1855 // Make CRITICAL messages fatal
1856 // TODO(oshima): we probably should enable this for entire tests on linux.
1857 g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
1858 #endif
1859 scoped_ptr<Widget> window(CreateWidget());
1860 window->Init(NULL, gfx::Rect(0, 0, 500, 300));
1861 View* root_view = window->GetRootView();
1862 NativeTextButton* native = new NativeTextButton(NULL, ASCIIToUTF16("Native"));
1863
1864 root_view->SetContentsView(native);
1865 native->SetVisible(true);
1866
1867 root_view->RemoveChildView(native);
1868 native->SetVisible(false);
1869 // Change visibility to true with no widget.
1870 native->SetVisible(true);
1871
1872 root_view->SetContentsView(native);
1873 native->SetVisible(true);
1874 }
1875 */
1876
1877 ////////////////////////////////////////////////////////////////////////////////
1878 // Native view hierachy 1850 // Native view hierachy
1879 //////////////////////////////////////////////////////////////////////////////// 1851 ////////////////////////////////////////////////////////////////////////////////
1880 class TestNativeViewHierarchy : public View { 1852 class TestNativeViewHierarchy : public View {
1881 public: 1853 public:
1882 TestNativeViewHierarchy() { 1854 TestNativeViewHierarchy() {
1883 } 1855 }
1884 1856
1885 virtual void NativeViewHierarchyChanged( 1857 virtual void NativeViewHierarchyChanged(
1886 bool attached, 1858 bool attached,
1887 gfx::NativeView native_view, 1859 gfx::NativeView native_view,
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
3390 // Set to non default value. 3362 // Set to non default value.
3391 v->layer()->set_scale_content(false); 3363 v->layer()->set_scale_content(false);
3392 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); 3364 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer());
3393 ui::Layer* new_layer = v->layer(); 3365 ui::Layer* new_layer = v->layer();
3394 EXPECT_FALSE(new_layer->scale_content()); 3366 EXPECT_FALSE(new_layer->scale_content());
3395 } 3367 }
3396 3368
3397 #endif // USE_AURA 3369 #endif // USE_AURA
3398 3370
3399 } // namespace views 3371 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/child_modal_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698