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

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

Issue 325443002: Move about://-related constants from //content to //url (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android ifx Created 6 years, 6 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
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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/win/scoped_bstr.h" 9 #include "base/win/scoped_bstr.h"
10 #include "base/win/scoped_comptr.h" 10 #include "base/win/scoped_comptr.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 return base::string16(); 412 return base::string16();
413 } 413 }
414 414
415 } // namespace 415 } // namespace
416 416
417 417
418 // Tests ---------------------------------------------------------------------- 418 // Tests ----------------------------------------------------------------------
419 419
420 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, 420 IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
421 MAYBE(TestBusyAccessibilityTree)) { 421 MAYBE(TestBusyAccessibilityTree)) {
422 NavigateToURL(shell(), GURL(kAboutBlankURL)); 422 NavigateToURL(shell(), GURL(url::kAboutBlankURL));
423 423
424 // The initial accessible returned should have state STATE_SYSTEM_BUSY while 424 // The initial accessible returned should have state STATE_SYSTEM_BUSY while
425 // the accessibility tree is being requested from the renderer. 425 // the accessibility tree is being requested from the renderer.
426 AccessibleChecker document1_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT, 426 AccessibleChecker document1_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT,
427 std::wstring()); 427 std::wstring());
428 document1_checker.SetExpectedState( 428 document1_checker.SetExpectedState(
429 STATE_SYSTEM_READONLY | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_FOCUSED | 429 STATE_SYSTEM_READONLY | STATE_SYSTEM_FOCUSABLE | STATE_SYSTEM_FOCUSED |
430 STATE_SYSTEM_BUSY); 430 STATE_SYSTEM_BUSY);
431 document1_checker.CheckAccessible(GetRendererAccessible()); 431 document1_checker.CheckAccessible(GetRendererAccessible());
432 } 432 }
(...skipping 23 matching lines...) Expand all
456 // Check that document accessible has a parent accessible. 456 // Check that document accessible has a parent accessible.
457 base::win::ScopedComPtr<IAccessible> document_accessible( 457 base::win::ScopedComPtr<IAccessible> document_accessible(
458 GetRendererAccessible()); 458 GetRendererAccessible());
459 ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(NULL)); 459 ASSERT_NE(document_accessible.get(), reinterpret_cast<IAccessible*>(NULL));
460 base::win::ScopedComPtr<IDispatch> parent_dispatch; 460 base::win::ScopedComPtr<IDispatch> parent_dispatch;
461 HRESULT hr = document_accessible->get_accParent(parent_dispatch.Receive()); 461 HRESULT hr = document_accessible->get_accParent(parent_dispatch.Receive());
462 EXPECT_EQ(S_OK, hr); 462 EXPECT_EQ(S_OK, hr);
463 EXPECT_NE(parent_dispatch, reinterpret_cast<IDispatch*>(NULL)); 463 EXPECT_NE(parent_dispatch, reinterpret_cast<IDispatch*>(NULL));
464 464
465 // Navigate to another page. 465 // Navigate to another page.
466 NavigateToURL(shell(), GURL(kAboutBlankURL)); 466 NavigateToURL(shell(), GURL(url::kAboutBlankURL));
467 467
468 // Verify that the IAccessible reference still points to a valid object and 468 // Verify that the IAccessible reference still points to a valid object and
469 // that calls to its methods fail since the tree is no longer valid after 469 // that calls to its methods fail since the tree is no longer valid after
470 // the page navagation. 470 // the page navagation.
471 base::win::ScopedBstr name; 471 base::win::ScopedBstr name;
472 base::win::ScopedVariant childid_self(CHILDID_SELF); 472 base::win::ScopedVariant childid_self(CHILDID_SELF);
473 hr = document_accessible->get_accName(childid_self, name.Receive()); 473 hr = document_accessible->get_accName(childid_self, name.Receive());
474 ASSERT_EQ(E_FAIL, hr); 474 ASSERT_EQ(E_FAIL, hr);
475 } 475 }
476 476
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 AccessibleChecker grouping2_checker(std::wstring(), ROLE_SYSTEM_GROUPING, 874 AccessibleChecker grouping2_checker(std::wstring(), ROLE_SYSTEM_GROUPING,
875 std::wstring()); 875 std::wstring());
876 AccessibleChecker document_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT, 876 AccessibleChecker document_checker(std::wstring(), ROLE_SYSTEM_DOCUMENT,
877 std::wstring()); 877 std::wstring());
878 document_checker.AppendExpectedChild(&grouping1_checker); 878 document_checker.AppendExpectedChild(&grouping1_checker);
879 document_checker.AppendExpectedChild(&grouping2_checker); 879 document_checker.AppendExpectedChild(&grouping2_checker);
880 document_checker.CheckAccessible(GetRendererAccessible()); 880 document_checker.CheckAccessible(GetRendererAccessible());
881 } 881 }
882 882
883 } // namespace content 883 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698