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

Side by Side Diff: chrome/browser/ui/views/accessibility_event_router_views_unittest.cc

Issue 7278010: Fix to pure view test on touch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | views/controls/native/native_view_host_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « no previous file | views/controls/native/native_view_host_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698