Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 | 91 |
| 92 void set_name(const base::string16& name) { name_ = name; } | 92 void set_name(const base::string16& name) { name_ = name; } |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 base::string16 name_; | 95 base::string16 name_; |
| 96 ui::AXRole role_; | 96 ui::AXRole role_; |
| 97 DISALLOW_COPY_AND_ASSIGN(ViewWithNameAndRole); | 97 DISALLOW_COPY_AND_ASSIGN(ViewWithNameAndRole); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 class AccessibilityEventRouterViewsTest | 100 class AccessibilityEventRouterViewsTest |
| 101 : public testing::Test { | 101 : public testing::Test { |
|
tapted
2014/07/14 00:33:14
not for this CL, but this should be inheriting fro
Andre
2014/07/14 17:49:09
Acknowledged.
| |
| 102 public: | 102 public: |
| 103 AccessibilityEventRouterViewsTest() : control_event_count_(0) { | 103 AccessibilityEventRouterViewsTest() : control_event_count_(0) { |
| 104 } | 104 } |
| 105 | 105 |
| 106 virtual void SetUp() { | 106 virtual void SetUp() { |
| 107 #if defined(OS_WIN) | 107 #if defined(OS_WIN) |
| 108 ole_initializer_.reset(new ui::ScopedOleInitializer()); | 108 ole_initializer_.reset(new ui::ScopedOleInitializer()); |
| 109 #endif | 109 #endif |
| 110 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); | 110 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); |
| 111 #if defined(USE_AURA) | 111 #if defined(USE_AURA) |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 133 // forces it to be deleted now, so we don't have any memory leaks | 133 // forces it to be deleted now, so we don't have any memory leaks |
| 134 // when this method exits. | 134 // when this method exits. |
| 135 base::MessageLoop::current()->RunUntilIdle(); | 135 base::MessageLoop::current()->RunUntilIdle(); |
| 136 | 136 |
| 137 #if defined(OS_WIN) | 137 #if defined(OS_WIN) |
| 138 ole_initializer_.reset(); | 138 ole_initializer_.reset(); |
| 139 #endif | 139 #endif |
| 140 } | 140 } |
| 141 | 141 |
| 142 views::Widget* CreateWindowWithContents(views::View* contents) { | 142 views::Widget* CreateWindowWithContents(views::View* contents) { |
| 143 gfx::NativeView context = NULL; | 143 gfx::NativeWindow context = NULL; |
| 144 #if defined(USE_AURA) | 144 #if defined(USE_AURA) |
| 145 context = aura_test_helper_->root_window(); | 145 context = aura_test_helper_->root_window(); |
| 146 #endif | 146 #endif |
| 147 views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds( | 147 views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds( |
| 148 new AccessibilityWindowDelegate(contents), | 148 new AccessibilityWindowDelegate(contents), |
| 149 context, | 149 context, |
| 150 gfx::Rect(0, 0, 500, 500)); | 150 gfx::Rect(0, 0, 500, 500)); |
| 151 | 151 |
| 152 // Create a profile and associate it with this window. | 152 // Create a profile and associate it with this window. |
| 153 widget->SetNativeWindowProperty(Profile::kProfileKey, &profile_); | 153 widget->SetNativeWindowProperty(Profile::kProfileKey, &profile_); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 | 502 |
| 503 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( | 503 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( |
| 504 menu_container, | 504 menu_container, |
| 505 menu->GetMenuItemByID(kTestCases[i].command_id), | 505 menu->GetMenuItemByID(kTestCases[i].command_id), |
| 506 &index, | 506 &index, |
| 507 &count); | 507 &count); |
| 508 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; | 508 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; |
| 509 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; | 509 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; |
| 510 } | 510 } |
| 511 } | 511 } |
| OLD | NEW |