// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/strings/utf_string_conversions.h" #include "ui/accessibility/ax_view_state.h" #include "ui/views/accessibility/native_view_accessibility.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/label.h" #include "ui/views/test/views_test_base.h" namespace views { namespace test { class NativeViewAccessibilityTest; namespace { class TestButton : public Button { public: TestButton() : Button(NULL) {} }; } // namespace class NativeViewAccessibilityTest : public ViewsTestBase { public: NativeViewAccessibilityTest() {} ~NativeViewAccessibilityTest() override {} void SetUp() override { ViewsTestBase::SetUp(); button_.reset(new TestButton()); button_->SetSize(gfx::Size(20, 20)); button_accessibility_ = NativeViewAccessibility::Create(button_.get()); label_.reset(new Label); button_->AddChildView(label_.get()); label_accessibility_ = NativeViewAccessibility::Create(label_.get()); } void TearDown() override { button_accessibility_->Destroy(); button_accessibility_ = NULL; label_accessibility_->Destroy(); label_accessibility_ = NULL; ViewsTestBase::TearDown(); } protected: scoped_ptr button_; NativeViewAccessibility* button_accessibility_; scoped_ptr