| OLD | NEW |
| 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 <atlbase.h> | 5 #include <atlbase.h> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 void AccessibilityWinBrowserTest::LoadInitialAccessibilityTreeFromHtml( | 199 void AccessibilityWinBrowserTest::LoadInitialAccessibilityTreeFromHtml( |
| 200 string html) { | 200 string html) { |
| 201 // Load the html using a data url and wait for the navigation to finish. | 201 // Load the html using a data url and wait for the navigation to finish. |
| 202 GURL html_data_url(string("data:text/html,") + html); | 202 GURL html_data_url(string("data:text/html,") + html); |
| 203 NavigateToURL(shell(), html_data_url); | 203 NavigateToURL(shell(), html_data_url); |
| 204 | 204 |
| 205 // At this point, renderer accessibility is off and the page has completed | 205 // At this point, renderer accessibility is off and the page has completed |
| 206 // loading. (Both of these must be strictly true or there will be test | 206 // loading. (Both of these must be strictly true or there will be test |
| 207 // flakiness.) Now call GetRendererAccessible, which will trigger | 207 // flakiness.) Now call GetRendererAccessible, which will trigger |
| 208 // changing the accessibility mode to AccessibilityModeComplete. When | 208 // changing the accessibility mode to ACCESSIBILITY_MODE_COMPLETE. When |
| 209 // the renderer switches accessibility on, it will send a Layout Complete | 209 // the renderer switches accessibility on, it will send a Layout Complete |
| 210 // accessibility notification containing the full accessibility tree, which | 210 // accessibility notification containing the full accessibility tree, which |
| 211 // we can wait for. | 211 // we can wait for. |
| 212 WindowedNotificationObserver tree_updated_observer( | 212 WindowedNotificationObserver tree_updated_observer( |
| 213 NOTIFICATION_ACCESSIBILITY_LAYOUT_COMPLETE, | 213 NOTIFICATION_ACCESSIBILITY_LAYOUT_COMPLETE, |
| 214 NotificationService::AllSources()); | 214 NotificationService::AllSources()); |
| 215 GetRendererAccessible(); | 215 GetRendererAccessible(); |
| 216 tree_updated_observer.Wait(); | 216 tree_updated_observer.Wait(); |
| 217 } | 217 } |
| 218 | 218 |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 AccessibleChecker grouping1_checker(L"", ROLE_SYSTEM_GROUPING, L""); | 828 AccessibleChecker grouping1_checker(L"", ROLE_SYSTEM_GROUPING, L""); |
| 829 AccessibleChecker grouping2_checker(L"", ROLE_SYSTEM_GROUPING, L""); | 829 AccessibleChecker grouping2_checker(L"", ROLE_SYSTEM_GROUPING, L""); |
| 830 AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L""); | 830 AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L""); |
| 831 document_checker.AppendExpectedChild(&grouping1_checker); | 831 document_checker.AppendExpectedChild(&grouping1_checker); |
| 832 document_checker.AppendExpectedChild(&grouping2_checker); | 832 document_checker.AppendExpectedChild(&grouping2_checker); |
| 833 document_checker.CheckAccessible(GetRendererAccessible()); | 833 document_checker.CheckAccessible(GetRendererAccessible()); |
| 834 } | 834 } |
| 835 } // namespace. | 835 } // namespace. |
| 836 | 836 |
| 837 } // namespace content | 837 } // namespace content |
| OLD | NEW |