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

Side by Side Diff: chrome/browser/ui/ash/accessibility/ax_tree_source_aura_unittest.cc

Issue 2371113003: Do not give instant focus if a view's toplevelwidget is not active (Closed)
Patch Set: based on comments Created 4 years, 2 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 class AXTreeSourceAuraTest : public ash::test::AshTestBase { 49 class AXTreeSourceAuraTest : public ash::test::AshTestBase {
50 public: 50 public:
51 AXTreeSourceAuraTest() {} 51 AXTreeSourceAuraTest() {}
52 ~AXTreeSourceAuraTest() override {} 52 ~AXTreeSourceAuraTest() override {}
53 53
54 void SetUp() override { 54 void SetUp() override {
55 AshTestBase::SetUp(); 55 AshTestBase::SetUp();
56 56
57 widget_ = new Widget(); 57 widget_ = new Widget();
58 Widget::InitParams init_params(Widget::InitParams::TYPE_POPUP); 58 Widget::InitParams init_params(Widget::InitParams::TYPE_WINDOW_FRAMELESS);
59 init_params.parent = CurrentContext(); 59 init_params.context = CurrentContext();
60 widget_->Init(init_params); 60 widget_->Init(init_params);
61 61
62 content_ = new View(); 62 content_ = new View();
63 widget_->SetContentsView(content_); 63 widget_->SetContentsView(content_);
64 64
65 textfield_ = new Textfield(); 65 textfield_ = new Textfield();
66 textfield_->SetText(base::ASCIIToUTF16("Value")); 66 textfield_->SetText(base::ASCIIToUTF16("Value"));
67 content_->AddChildView(textfield_); 67 content_->AddChildView(textfield_);
68 widget_->Show(); 68 widget_->Show();
69 } 69 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 int text_field_update_index = -1; 169 int text_field_update_index = -1;
170 for (size_t i = 0; i < node_count; ++i) { 170 for (size_t i = 0; i < node_count; ++i) {
171 if (textfield_wrapper->GetID() == out_update2.nodes[i].id) 171 if (textfield_wrapper->GetID() == out_update2.nodes[i].id)
172 text_field_update_index = i; 172 text_field_update_index = i;
173 } 173 }
174 174
175 ASSERT_NE(-1, text_field_update_index); 175 ASSERT_NE(-1, text_field_update_index);
176 ASSERT_EQ(ui::AX_ROLE_TEXT_FIELD, 176 ASSERT_EQ(ui::AX_ROLE_TEXT_FIELD,
177 out_update2.nodes[text_field_update_index].role); 177 out_update2.nodes[text_field_update_index].role);
178 } 178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698