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

Side by Side Diff: ui/views/accessibility/native_view_accessibility_unittest.cc

Issue 2715543003: Views a11y: Implement AXPlatformNode::FromNativeViewAccessible on all platforms. (Closed)
Patch Set: Rebase Created 3 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/accessibility/native_view_accessibility.h" 5 #include "ui/views/accessibility/native_view_accessibility.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "ui/accessibility/ax_node_data.h" 9 #include "ui/accessibility/ax_node_data.h"
10 #include "ui/gfx/geometry/rect_conversions.h" 10 #include "ui/gfx/geometry/rect_conversions.h"
(...skipping 27 matching lines...) Expand all
38 ViewsTestBase::SetUp(); 38 ViewsTestBase::SetUp();
39 39
40 widget_ = new views::Widget; 40 widget_ = new views::Widget;
41 views::Widget::InitParams params = 41 views::Widget::InitParams params =
42 CreateParams(views::Widget::InitParams::TYPE_WINDOW); 42 CreateParams(views::Widget::InitParams::TYPE_WINDOW);
43 params.bounds = gfx::Rect(0, 0, 200, 200); 43 params.bounds = gfx::Rect(0, 0, 200, 200);
44 widget_->Init(params); 44 widget_->Init(params);
45 45
46 button_ = new TestButton(); 46 button_ = new TestButton();
47 button_->SetSize(gfx::Size(20, 20)); 47 button_->SetSize(gfx::Size(20, 20));
48 button_accessibility_ = NativeViewAccessibility::Create(button_); 48 button_accessibility_ = NativeViewAccessibility::CreateForView(button_);
49 49
50 label_ = new Label(); 50 label_ = new Label();
51 button_->AddChildView(label_); 51 button_->AddChildView(label_);
52 label_accessibility_ = NativeViewAccessibility::Create(label_); 52 label_accessibility_ = NativeViewAccessibility::CreateForView(label_);
53 53
54 widget_->GetContentsView()->AddChildView(button_); 54 widget_->GetContentsView()->AddChildView(button_);
55 widget_->Show(); 55 widget_->Show();
56 } 56 }
57 57
58 void TearDown() override { 58 void TearDown() override {
59 if (!widget_->IsClosed()) 59 if (!widget_->IsClosed())
60 widget_->Close(); 60 widget_->Close();
61 ViewsTestBase::TearDown(); 61 ViewsTestBase::TearDown();
62 } 62 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // During the destruction of parent, OnBlur will be called and change the 216 // During the destruction of parent, OnBlur will be called and change the
217 // visibility to false. 217 // visibility to false.
218 parent->SetVisible(true); 218 parent->SetVisible(true);
219 AXAuraObjCache* ax = AXAuraObjCache::GetInstance(); 219 AXAuraObjCache* ax = AXAuraObjCache::GetInstance();
220 ax->GetOrCreate(widget.get()); 220 ax->GetOrCreate(widget.get());
221 } 221 }
222 #endif 222 #endif
223 223
224 } // namespace test 224 } // namespace test
225 } // namespace views 225 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698