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

Side by Side Diff: content/browser/accessibility/browser_accessibility_win_unittest.cc

Issue 25943003: Support accessible inline text boxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 7 years, 1 month 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
OLDNEW
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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "base/win/scoped_bstr.h" 7 #include "base/win/scoped_bstr.h"
8 #include "base/win/scoped_comptr.h" 8 #include "base/win/scoped_comptr.h"
9 #include "base/win/scoped_variant.h" 9 #include "base/win/scoped_variant.h"
10 #include "content/browser/accessibility/browser_accessibility_manager.h" 10 #include "content/browser/accessibility/browser_accessibility_manager.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 CountedBrowserAccessibility::reset(); 340 CountedBrowserAccessibility::reset();
341 scoped_ptr<BrowserAccessibilityManager> manager( 341 scoped_ptr<BrowserAccessibilityManager> manager(
342 BrowserAccessibilityManager::Create( 342 BrowserAccessibilityManager::Create(
343 root, NULL, new CountedBrowserAccessibilityFactory())); 343 root, NULL, new CountedBrowserAccessibilityFactory()));
344 manager->UpdateNodesForTesting(text1); 344 manager->UpdateNodesForTesting(text1);
345 ASSERT_EQ(2, CountedBrowserAccessibility::num_instances()); 345 ASSERT_EQ(2, CountedBrowserAccessibility::num_instances());
346 346
347 BrowserAccessibilityWin* root_obj = 347 BrowserAccessibilityWin* root_obj =
348 manager->GetRoot()->ToBrowserAccessibilityWin(); 348 manager->GetRoot()->ToBrowserAccessibilityWin();
349 BrowserAccessibilityWin* text1_obj = 349 BrowserAccessibilityWin* text1_obj =
350 root_obj->GetChild(0)->ToBrowserAccessibilityWin(); 350 root_obj->PlatformGetChild(0)->ToBrowserAccessibilityWin();
351 351
352 long text1_len; 352 long text1_len;
353 ASSERT_EQ(S_OK, text1_obj->get_nCharacters(&text1_len)); 353 ASSERT_EQ(S_OK, text1_obj->get_nCharacters(&text1_len));
354 354
355 base::win::ScopedBstr text; 355 base::win::ScopedBstr text;
356 ASSERT_EQ(S_OK, text1_obj->get_text(0, text1_len, text.Receive())); 356 ASSERT_EQ(S_OK, text1_obj->get_text(0, text1_len, text.Receive()));
357 ASSERT_EQ(text1_value, base::UTF16ToUTF8(string16(text))); 357 ASSERT_EQ(text1_value, base::UTF16ToUTF8(string16(text)));
358 text.Reset(); 358 text.Reset();
359 359
360 ASSERT_EQ(S_OK, text1_obj->get_text(0, 4, text.Receive())); 360 ASSERT_EQ(S_OK, text1_obj->get_text(0, 4, text.Receive()));
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 // And the new child exists. 674 // And the new child exists.
675 EXPECT_EQ(WebKit::WebAXRoleButton, acc2_2->role()); 675 EXPECT_EQ(WebKit::WebAXRoleButton, acc2_2->role());
676 EXPECT_EQ(3, acc2_2->renderer_id()); 676 EXPECT_EQ(3, acc2_2->renderer_id());
677 677
678 // Ensure we properly cleaned up. 678 // Ensure we properly cleaned up.
679 manager.reset(); 679 manager.reset();
680 ASSERT_EQ(0, CountedBrowserAccessibility::num_instances()); 680 ASSERT_EQ(0, CountedBrowserAccessibility::num_instances());
681 } 681 }
682 682
683 } // namespace content 683 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_win.cc ('k') | content/common/accessibility_node_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698