| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 AddDefaultFilters(&filters_); | 245 AddDefaultFilters(&filters_); |
| 246 ParseHtmlForExtraDirectives(html_contents, &filters_, &wait_for); | 246 ParseHtmlForExtraDirectives(html_contents, &filters_, &wait_for); |
| 247 | 247 |
| 248 // Get the test URL. | 248 // Get the test URL. |
| 249 GURL url(embedded_test_server()->GetURL( | 249 GURL url(embedded_test_server()->GetURL( |
| 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() == AccessibilityMode::OFF) { |
| 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, AccessibilityMode::COMPLETE, ui::AX_EVENT_NONE); |
| 260 ACCESSIBILITY_MODE_COMPLETE, | |
| 261 ui::AX_EVENT_NONE); | |
| 262 accessibility_waiter.WaitForNotification(); | 260 accessibility_waiter.WaitForNotification(); |
| 263 } else { | 261 } else { |
| 264 // Enable accessibility, then load the test html and wait for the | 262 // Enable accessibility, then load the test html and wait for the |
| 265 // "load complete" AX event. | 263 // "load complete" AX event. |
| 266 AccessibilityNotificationWaiter accessibility_waiter( | 264 AccessibilityNotificationWaiter accessibility_waiter( |
| 267 web_contents, | 265 web_contents, AccessibilityMode::COMPLETE, ui::AX_EVENT_LOAD_COMPLETE); |
| 268 ACCESSIBILITY_MODE_COMPLETE, | |
| 269 ui::AX_EVENT_LOAD_COMPLETE); | |
| 270 NavigateToURL(shell(), url); | 266 NavigateToURL(shell(), url); |
| 271 accessibility_waiter.WaitForNotification(); | 267 accessibility_waiter.WaitForNotification(); |
| 272 } | 268 } |
| 273 | 269 |
| 274 // Get the url of every frame in the frame tree. | 270 // Get the url of every frame in the frame tree. |
| 275 FrameTree* frame_tree = web_contents->GetFrameTree(); | 271 FrameTree* frame_tree = web_contents->GetFrameTree(); |
| 276 std::vector<std::string> all_frame_urls; | 272 std::vector<std::string> all_frame_urls; |
| 277 for (FrameTreeNode* node : frame_tree->Nodes()) { | 273 for (FrameTreeNode* node : frame_tree->Nodes()) { |
| 278 // Ignore about:blank urls because of the case where a parent frame A | 274 // Ignore about:blank urls because of the case where a parent frame A |
| 279 // has a child iframe B and it writes to the document using | 275 // has a child iframe B and it writes to the document using |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 expected_file, actual_contents.c_str(), actual_contents.size())); | 389 expected_file, actual_contents.c_str(), actual_contents.size())); |
| 394 LOG(INFO) << "Wrote expectations to: " | 390 LOG(INFO) << "Wrote expectations to: " |
| 395 << expected_file.LossyDisplayName(); | 391 << expected_file.LossyDisplayName(); |
| 396 } | 392 } |
| 397 } else { | 393 } else { |
| 398 LOG(INFO) << "Test output matches expectations."; | 394 LOG(INFO) << "Test output matches expectations."; |
| 399 } | 395 } |
| 400 } | 396 } |
| 401 | 397 |
| 402 } // namespace content | 398 } // namespace content |
| OLD | NEW |