| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_accessibility_api.h" | 10 #include "chrome/browser/extensions/extension_accessibility_api.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 focus_event_count_++; | 123 focus_event_count_++; |
| 124 last_control_name_ = info->name(); | 124 last_control_name_ = info->name(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 MessageLoopForUI message_loop_; | 127 MessageLoopForUI message_loop_; |
| 128 int focus_event_count_; | 128 int focus_event_count_; |
| 129 std::string last_control_name_; | 129 std::string last_control_name_; |
| 130 AccessibilityWindowDelegate* window_delegate_; | 130 AccessibilityWindowDelegate* window_delegate_; |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 #if !defined(TOUCH_UI) | |
| 134 TEST_F(AccessibilityEventRouterViewsTest, TestFocusNotification) { | 133 TEST_F(AccessibilityEventRouterViewsTest, TestFocusNotification) { |
| 135 const char kButton1ASCII[] = "Button1"; | 134 const char kButton1ASCII[] = "Button1"; |
| 136 const char kButton2ASCII[] = "Button2"; | 135 const char kButton2ASCII[] = "Button2"; |
| 137 const char kButton3ASCII[] = "Button3"; | 136 const char kButton3ASCII[] = "Button3"; |
| 138 const char kButton3NewASCII[] = "Button3New"; | 137 const char kButton3NewASCII[] = "Button3New"; |
| 139 | 138 |
| 140 // Create a contents view with 3 buttons. | 139 // Create a contents view with 3 buttons. |
| 141 views::View* contents = new views::View(); | 140 views::View* contents = new views::View(); |
| 142 views::NativeButton* button1 = new views::NativeButton( | 141 views::NativeButton* button1 = new views::NativeButton( |
| 143 NULL, ASCIIToWide(kButton1ASCII)); | 142 NULL, ASCIIToWide(kButton1ASCII)); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // Advance to button 3. Expect the new accessible name we assigned. | 183 // Advance to button 3. Expect the new accessible name we assigned. |
| 185 focus_manager->AdvanceFocus(false); | 184 focus_manager->AdvanceFocus(false); |
| 186 EXPECT_EQ(2, focus_event_count_); | 185 EXPECT_EQ(2, focus_event_count_); |
| 187 EXPECT_EQ(kButton3NewASCII, last_control_name_); | 186 EXPECT_EQ(kButton3NewASCII, last_control_name_); |
| 188 | 187 |
| 189 // Advance to button 1 and check the notification. | 188 // Advance to button 1 and check the notification. |
| 190 focus_manager->AdvanceFocus(false); | 189 focus_manager->AdvanceFocus(false); |
| 191 EXPECT_EQ(3, focus_event_count_); | 190 EXPECT_EQ(3, focus_event_count_); |
| 192 EXPECT_EQ(kButton1ASCII, last_control_name_); | 191 EXPECT_EQ(kButton1ASCII, last_control_name_); |
| 193 } | 192 } |
| 194 #endif | |
| 195 | 193 |
| 196 #endif // defined(TOOLKIT_VIEWS) | 194 #endif // defined(TOOLKIT_VIEWS) |
| OLD | NEW |