| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/accessibility/dump_accessibility_browsertest_base.h" | 5 #include "content/browser/accessibility/dump_accessibility_browsertest_base.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 "/" + std::string(file_dir) + "/" + file_path.BaseName().MaybeAsASCII())); | 250 "/" + std::string(file_dir) + "/" + file_path.BaseName().MaybeAsASCII())); |
| 251 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 251 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
| 252 shell()->web_contents()); | 252 shell()->web_contents()); |
| 253 | 253 |
| 254 if (enable_accessibility_after_navigating_ && | 254 if (enable_accessibility_after_navigating_ && |
| 255 web_contents->GetAccessibilityMode() == AccessibilityModeOff) { | 255 web_contents->GetAccessibilityMode() == AccessibilityModeOff) { |
| 256 // Load the url, then enable accessibility. | 256 // Load the url, then enable accessibility. |
| 257 NavigateToURL(shell(), url); | 257 NavigateToURL(shell(), url); |
| 258 AccessibilityNotificationWaiter accessibility_waiter( | 258 AccessibilityNotificationWaiter accessibility_waiter( |
| 259 web_contents, | 259 web_contents, |
| 260 AccessibilityModeComplete, | 260 ACCESSIBILITY_MODE_COMPLETE, |
| 261 ui::AX_EVENT_NONE); | 261 ui::AX_EVENT_NONE); |
| 262 accessibility_waiter.WaitForNotification(); | 262 accessibility_waiter.WaitForNotification(); |
| 263 } else { | 263 } else { |
| 264 // Enable accessibility, then load the test html and wait for the | 264 // Enable accessibility, then load the test html and wait for the |
| 265 // "load complete" AX event. | 265 // "load complete" AX event. |
| 266 AccessibilityNotificationWaiter accessibility_waiter( | 266 AccessibilityNotificationWaiter accessibility_waiter( |
| 267 web_contents, | 267 web_contents, |
| 268 AccessibilityModeComplete, | 268 ACCESSIBILITY_MODE_COMPLETE, |
| 269 ui::AX_EVENT_LOAD_COMPLETE); | 269 ui::AX_EVENT_LOAD_COMPLETE); |
| 270 NavigateToURL(shell(), url); | 270 NavigateToURL(shell(), url); |
| 271 accessibility_waiter.WaitForNotification(); | 271 accessibility_waiter.WaitForNotification(); |
| 272 } | 272 } |
| 273 | 273 |
| 274 // Get the url of every frame in the frame tree. | 274 // Get the url of every frame in the frame tree. |
| 275 FrameTree* frame_tree = web_contents->GetFrameTree(); | 275 FrameTree* frame_tree = web_contents->GetFrameTree(); |
| 276 std::vector<std::string> all_frame_urls; | 276 std::vector<std::string> all_frame_urls; |
| 277 for (FrameTreeNode* node : frame_tree->Nodes()) { | 277 for (FrameTreeNode* node : frame_tree->Nodes()) { |
| 278 // Ignore about:blank urls because of the case where a parent frame A | 278 // Ignore about:blank urls because of the case where a parent frame A |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 expected_file, actual_contents.c_str(), actual_contents.size())); | 393 expected_file, actual_contents.c_str(), actual_contents.size())); |
| 394 LOG(INFO) << "Wrote expectations to: " | 394 LOG(INFO) << "Wrote expectations to: " |
| 395 << expected_file.LossyDisplayName(); | 395 << expected_file.LossyDisplayName(); |
| 396 } | 396 } |
| 397 } else { | 397 } else { |
| 398 LOG(INFO) << "Test output matches expectations."; | 398 LOG(INFO) << "Test output matches expectations."; |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace content | 402 } // namespace content |
| OLD | NEW |