| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "ui/base/clipboard/clipboard.h" | 10 #include "ui/base/clipboard/clipboard.h" |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 | 723 |
| 724 gfx::Point ConvertPointToView(View* view, const gfx::Point& p) { | 724 gfx::Point ConvertPointToView(View* view, const gfx::Point& p) { |
| 725 gfx::Point tmp(p); | 725 gfx::Point tmp(p); |
| 726 View::ConvertPointToView(view->GetWidget()->GetRootView(), view, &tmp); | 726 View::ConvertPointToView(view->GetWidget()->GetRootView(), view, &tmp); |
| 727 return tmp; | 727 return tmp; |
| 728 } | 728 } |
| 729 } | 729 } |
| 730 | 730 |
| 731 TEST_F(ViewTest, HitTestMasks) { | 731 TEST_F(ViewTest, HitTestMasks) { |
| 732 Widget* widget = new Widget; | 732 Widget* widget = new Widget; |
| 733 widget->Init(Widget::InitParams(Widget::InitParams::TYPE_WINDOW)); | 733 widget->Init(Widget::InitParams(Widget::InitParams::TYPE_POPUP)); |
| 734 View* root_view = widget->GetRootView(); | 734 View* root_view = widget->GetRootView(); |
| 735 root_view->SetBounds(0, 0, 500, 500); | 735 root_view->SetBounds(0, 0, 500, 500); |
| 736 | 736 |
| 737 gfx::Rect v1_bounds = gfx::Rect(0, 0, 100, 100); | 737 gfx::Rect v1_bounds = gfx::Rect(0, 0, 100, 100); |
| 738 HitTestView* v1 = new HitTestView(false); | 738 HitTestView* v1 = new HitTestView(false); |
| 739 v1->SetBoundsRect(v1_bounds); | 739 v1->SetBoundsRect(v1_bounds); |
| 740 root_view->AddChildView(v1); | 740 root_view->AddChildView(v1); |
| 741 | 741 |
| 742 gfx::Rect v2_bounds = gfx::Rect(105, 0, 100, 100); | 742 gfx::Rect v2_bounds = gfx::Rect(105, 0, 100, 100); |
| 743 HitTestView* v2 = new HitTestView(true); | 743 HitTestView* v2 = new HitTestView(true); |
| (...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2058 ASSERT_EQ(0, child1->GetIndexOf(foo1)); | 2058 ASSERT_EQ(0, child1->GetIndexOf(foo1)); |
| 2059 | 2059 |
| 2060 ASSERT_EQ(-1, child2->GetIndexOf(NULL)); | 2060 ASSERT_EQ(-1, child2->GetIndexOf(NULL)); |
| 2061 ASSERT_EQ(-1, child2->GetIndexOf(&root)); | 2061 ASSERT_EQ(-1, child2->GetIndexOf(&root)); |
| 2062 ASSERT_EQ(-1, child2->GetIndexOf(child2)); | 2062 ASSERT_EQ(-1, child2->GetIndexOf(child2)); |
| 2063 ASSERT_EQ(-1, child2->GetIndexOf(child1)); | 2063 ASSERT_EQ(-1, child2->GetIndexOf(child1)); |
| 2064 ASSERT_EQ(-1, child2->GetIndexOf(foo1)); | 2064 ASSERT_EQ(-1, child2->GetIndexOf(foo1)); |
| 2065 } | 2065 } |
| 2066 | 2066 |
| 2067 } // namespace views | 2067 } // namespace views |
| OLD | NEW |