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

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

Issue 660633002: Fixed IAccessibleText::TextAtOffset with IA2_TEXT_BOUNDARY_WORD to return text that spans from the … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 (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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 ASSERT_EQ(S_FALSE, text1_obj->get_textAtOffset( 375 ASSERT_EQ(S_FALSE, text1_obj->get_textAtOffset(
376 text1_len, IA2_TEXT_BOUNDARY_CHAR, &start, &end, text.Receive())); 376 text1_len, IA2_TEXT_BOUNDARY_CHAR, &start, &end, text.Receive()));
377 ASSERT_EQ(text1_len, start); 377 ASSERT_EQ(text1_len, start);
378 ASSERT_EQ(text1_len, end); 378 ASSERT_EQ(text1_len, end);
379 text.Reset(); 379 text.Reset();
380 380
381 ASSERT_EQ(S_OK, text1_obj->get_textAtOffset( 381 ASSERT_EQ(S_OK, text1_obj->get_textAtOffset(
382 1, IA2_TEXT_BOUNDARY_WORD, &start, &end, text.Receive())); 382 1, IA2_TEXT_BOUNDARY_WORD, &start, &end, text.Receive()));
383 ASSERT_EQ(0, start); 383 ASSERT_EQ(0, start);
384 ASSERT_EQ(3, end); 384 ASSERT_EQ(4, end);
385 ASSERT_STREQ(L"One", text); 385 ASSERT_STREQ(L"One ", text);
386 text.Reset(); 386 text.Reset();
387 387
388 ASSERT_EQ(S_OK, text1_obj->get_textAtOffset( 388 ASSERT_EQ(S_OK, text1_obj->get_textAtOffset(
389 6, IA2_TEXT_BOUNDARY_WORD, &start, &end, text.Receive())); 389 6, IA2_TEXT_BOUNDARY_WORD, &start, &end, text.Receive()));
390 ASSERT_EQ(4, start); 390 ASSERT_EQ(4, start);
391 ASSERT_EQ(7, end); 391 ASSERT_EQ(8, end);
392 ASSERT_STREQ(L"two", text); 392 ASSERT_STREQ(L"two\n", text);
393 text.Reset(); 393 text.Reset();
394 394
395 ASSERT_EQ(S_OK, text1_obj->get_textAtOffset( 395 ASSERT_EQ(S_OK, text1_obj->get_textAtOffset(
396 text1_len, IA2_TEXT_BOUNDARY_WORD, &start, &end, text.Receive())); 396 text1_len, IA2_TEXT_BOUNDARY_WORD, &start, &end, text.Receive()));
397 ASSERT_EQ(25, start); 397 ASSERT_EQ(25, start);
398 ASSERT_EQ(29, end); 398 ASSERT_EQ(29, end);
399 ASSERT_STREQ(L"six.", text); 399 ASSERT_STREQ(L"six.", text);
400 text.Reset(); 400 text.Reset();
401 401
402 ASSERT_EQ(S_OK, text1_obj->get_textAtOffset( 402 ASSERT_EQ(S_OK, text1_obj->get_textAtOffset(
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 EXPECT_EQ(1 << ui::AX_STATE_BUSY | 698 EXPECT_EQ(1 << ui::AX_STATE_BUSY |
699 1 << ui::AX_STATE_READ_ONLY | 699 1 << ui::AX_STATE_READ_ONLY |
700 1 << ui::AX_STATE_ENABLED, 700 1 << ui::AX_STATE_ENABLED,
701 root->GetState()); 701 root->GetState());
702 702
703 LONG unique_id_win = root->ToBrowserAccessibilityWin()->unique_id_win(); 703 LONG unique_id_win = root->ToBrowserAccessibilityWin()->unique_id_win();
704 ASSERT_EQ(root, manager->GetFromUniqueIdWin(unique_id_win)); 704 ASSERT_EQ(root, manager->GetFromUniqueIdWin(unique_id_win));
705 } 705 }
706 706
707 } // namespace content 707 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698