dump_accessibility_tree_browsertest.cc revision 1320f92c476a1ad9d19dba2a48c72b75566198e9
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 3// found in the LICENSE file. 4 5#include <set> 6#include <string> 7#include <vector> 8 9#include "base/command_line.h" 10#include "base/files/file_util.h" 11#include "base/logging.h" 12#include "base/path_service.h" 13#include "base/strings/string16.h" 14#include "base/strings/string_split.h" 15#include "base/strings/string_util.h" 16#include "base/strings/utf_string_conversions.h" 17#include "content/browser/accessibility/accessibility_tree_formatter.h" 18#include "content/browser/accessibility/browser_accessibility.h" 19#include "content/browser/accessibility/browser_accessibility_manager.h" 20#include "content/browser/renderer_host/render_view_host_impl.h" 21#include "content/browser/renderer_host/render_widget_host_view_base.h" 22#include "content/browser/web_contents/web_contents_impl.h" 23#include "content/public/browser/web_contents.h" 24#include "content/public/common/content_paths.h" 25#include "content/public/common/content_switches.h" 26#include "content/public/common/url_constants.h" 27#include "content/public/test/content_browser_test.h" 28#include "content/public/test/content_browser_test_utils.h" 29#include "content/shell/browser/shell.h" 30#include "content/test/accessibility_browser_test_utils.h" 31#include "testing/gtest/include/gtest/gtest.h" 32 33// TODO(aboxhall): Create expectations on Android for these 34#if defined(OS_ANDROID) 35#define MAYBE(x) DISABLED_##x 36#else 37#define MAYBE(x) x 38#endif 39 40namespace content { 41 42namespace { 43 44const char kCommentToken = '#'; 45const char kMarkSkipFile[] = "#<skip"; 46const char kMarkEndOfFile[] = "<-- End-of-file -->"; 47const char kSignalDiff[] = "*"; 48 49} // namespace 50 51typedef AccessibilityTreeFormatter::Filter Filter; 52 53// This test takes a snapshot of the platform BrowserAccessibility tree and 54// tests it against an expected baseline. 55// 56// The flow of the test is as outlined below. 57// 1. Load an html file from chrome/test/data/accessibility. 58// 2. Read the expectation. 59// 3. Browse to the page and serialize the platform specific tree into a human 60// readable string. 61// 4. Perform a comparison between actual and expected and fail if they do not 62// exactly match. 63class DumpAccessibilityTreeTest : public ContentBrowserTest { 64 public: 65 // Utility helper that does a comment aware equality check. 66 // Returns array of lines from expected file which are different. 67 std::vector<int> DiffLines(const std::vector<std::string>& expected_lines, 68 const std::vector<std::string>& actual_lines) { 69 int actual_lines_count = actual_lines.size(); 70 int expected_lines_count = expected_lines.size(); 71 std::vector<int> diff_lines; 72 int i = 0, j = 0; 73 while (i < actual_lines_count && j < expected_lines_count) { 74 if (expected_lines[j].size() == 0 || 75 expected_lines[j][0] == kCommentToken) { 76 // Skip comment lines and blank lines in expected output. 77 ++j; 78 continue; 79 } 80 81 if (actual_lines[i] != expected_lines[j]) 82 diff_lines.push_back(j); 83 ++i; 84 ++j; 85 } 86 87 // Actual file has been fully checked. 88 return diff_lines; 89 } 90 91 void AddDefaultFilters(std::vector<Filter>* filters) { 92 filters->push_back(Filter(base::ASCIIToUTF16("FOCUSABLE"), Filter::ALLOW)); 93 filters->push_back(Filter(base::ASCIIToUTF16("READONLY"), Filter::ALLOW)); 94 filters->push_back(Filter(base::ASCIIToUTF16("*=''"), Filter::DENY)); 95 } 96 97 // Parse the test html file and parse special directives, usually 98 // beginning with an '@' and inside an HTML comment, that control how the 99 // test is run and how the results are interpreted. 100 // 101 // When the accessibility tree is dumped as text, each attribute is 102 // run through filters before being appended to the string. An "allow" 103 // filter specifies attribute strings that should be dumped, and a "deny" 104 // filter specifies strings that should be suppressed. As an example, 105 // @MAC-ALLOW:AXSubrole=* means that the AXSubrole attribute should be 106 // printed, while @MAC-ALLOW:AXSubrole=AXList* means that any subrole 107 // beginning with the text "AXList" should be printed. 108 // 109 // The @WAIT-FOR:text directive allows the test to specify that the document 110 // may dynamically change after initial load, and the test is to wait 111 // until the given string (e.g., "text") appears in the resulting dump. 112 // A test can make some changes to the document, then append a magic string 113 // indicating that the test is done, and this framework will wait for that 114 // string to appear before comparing the results. 115 void ParseHtmlForExtraDirectives(const std::string& test_html, 116 std::vector<Filter>* filters, 117 std::string* wait_for) { 118 std::vector<std::string> lines; 119 base::SplitString(test_html, '\n', &lines); 120 for (std::vector<std::string>::const_iterator iter = lines.begin(); 121 iter != lines.end(); 122 ++iter) { 123 const std::string& line = *iter; 124 const std::string& allow_empty_str = 125 AccessibilityTreeFormatter::GetAllowEmptyString(); 126 const std::string& allow_str = 127 AccessibilityTreeFormatter::GetAllowString(); 128 const std::string& deny_str = 129 AccessibilityTreeFormatter::GetDenyString(); 130 const std::string& wait_str = "@WAIT-FOR:"; 131 if (StartsWithASCII(line, allow_empty_str, true)) { 132 filters->push_back( 133 Filter(base::UTF8ToUTF16(line.substr(allow_empty_str.size())), 134 Filter::ALLOW_EMPTY)); 135 } else if (StartsWithASCII(line, allow_str, true)) { 136 filters->push_back(Filter(base::UTF8ToUTF16( 137 line.substr(allow_str.size())), 138 Filter::ALLOW)); 139 } else if (StartsWithASCII(line, deny_str, true)) { 140 filters->push_back(Filter(base::UTF8ToUTF16( 141 line.substr(deny_str.size())), 142 Filter::DENY)); 143 } else if (StartsWithASCII(line, wait_str, true)) { 144 *wait_for = line.substr(wait_str.size()); 145 } 146 } 147 } 148 149 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { 150 ContentBrowserTest::SetUpCommandLine(command_line); 151 // Enable <dialog>, which is used in some tests. 152 base::CommandLine::ForCurrentProcess()->AppendSwitch( 153 switches::kEnableExperimentalWebPlatformFeatures); 154 } 155 156 void RunTest(const base::FilePath::CharType* file_path); 157}; 158 159void DumpAccessibilityTreeTest::RunTest( 160 const base::FilePath::CharType* file_path) { 161 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); 162 163 // Setup test paths. 164 base::FilePath dir_test_data; 165 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); 166 base::FilePath test_path( 167 dir_test_data.Append(FILE_PATH_LITERAL("accessibility"))); 168 ASSERT_TRUE(base::PathExists(test_path)) 169 << test_path.LossyDisplayName(); 170 171 base::FilePath html_file = test_path.Append(base::FilePath(file_path)); 172 // Output the test path to help anyone who encounters a failure and needs 173 // to know where to look. 174 printf("Testing: %s\n", html_file.MaybeAsASCII().c_str()); 175 176 std::string html_contents; 177 base::ReadFileToString(html_file, &html_contents); 178 179 // Read the expected file. 180 std::string expected_contents_raw; 181 base::FilePath expected_file = 182 base::FilePath(html_file.RemoveExtension().value() + 183 AccessibilityTreeFormatter::GetExpectedFileSuffix()); 184 base::ReadFileToString(expected_file, &expected_contents_raw); 185 186 // Tolerate Windows-style line endings (\r\n) in the expected file: 187 // normalize by deleting all \r from the file (if any) to leave only \n. 188 std::string expected_contents; 189 base::RemoveChars(expected_contents_raw, "\r", &expected_contents); 190 191 if (!expected_contents.compare(0, strlen(kMarkSkipFile), kMarkSkipFile)) { 192 printf("Skipping this test on this platform.\n"); 193 return; 194 } 195 196 // Parse filters and other directives in the test file. 197 std::vector<Filter> filters; 198 std::string wait_for; 199 AddDefaultFilters(&filters); 200 ParseHtmlForExtraDirectives(html_contents, &filters, &wait_for); 201 202 // Load the page. 203 base::string16 html_contents16; 204 html_contents16 = base::UTF8ToUTF16(html_contents); 205 GURL url = GetTestUrl("accessibility", 206 html_file.BaseName().MaybeAsASCII().c_str()); 207 208 // If there's a @WAIT-FOR directive, set up an accessibility notification 209 // waiter that returns on any event; we'll stop when we get the text we're 210 // waiting for, or time out. Otherwise just wait specifically for 211 // the "load complete" event. 212 scoped_ptr<AccessibilityNotificationWaiter> waiter; 213 if (!wait_for.empty()) { 214 waiter.reset(new AccessibilityNotificationWaiter( 215 shell(), AccessibilityModeComplete, ui::AX_EVENT_NONE)); 216 } else { 217 waiter.reset(new AccessibilityNotificationWaiter( 218 shell(), AccessibilityModeComplete, ui::AX_EVENT_LOAD_COMPLETE)); 219 } 220 221 // Load the test html. 222 NavigateToURL(shell(), url); 223 224 // Wait for notifications. If there's a @WAIT-FOR directive, break when 225 // the text we're waiting for appears in the dump, otherwise break after 226 // the first notification, which will be a load complete. 227 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( 228 shell()->web_contents()); 229 std::string actual_contents; 230 do { 231 waiter->WaitForNotification(); 232 base::string16 actual_contents_utf16; 233 AccessibilityTreeFormatter formatter( 234 web_contents->GetRootBrowserAccessibilityManager()->GetRoot()); 235 formatter.SetFilters(filters); 236 formatter.FormatAccessibilityTree(&actual_contents_utf16); 237 actual_contents = base::UTF16ToUTF8(actual_contents_utf16); 238 } while (!wait_for.empty() && 239 actual_contents.find(wait_for) == std::string::npos); 240 241 // Perform a diff (or write the initial baseline). 242 std::vector<std::string> actual_lines, expected_lines; 243 Tokenize(actual_contents, "\n", &actual_lines); 244 Tokenize(expected_contents, "\n", &expected_lines); 245 // Marking the end of the file with a line of text ensures that 246 // file length differences are found. 247 expected_lines.push_back(kMarkEndOfFile); 248 actual_lines.push_back(kMarkEndOfFile); 249 250 std::vector<int> diff_lines = DiffLines(expected_lines, actual_lines); 251 bool is_different = diff_lines.size() > 0; 252 EXPECT_FALSE(is_different); 253 if (is_different) { 254 // Mark the expected lines which did not match actual output with a *. 255 printf("* Line Expected\n"); 256 printf("- ---- --------\n"); 257 for (int line = 0, diff_index = 0; 258 line < static_cast<int>(expected_lines.size()); 259 ++line) { 260 bool is_diff = false; 261 if (diff_index < static_cast<int>(diff_lines.size()) && 262 diff_lines[diff_index] == line) { 263 is_diff = true; 264 ++diff_index; 265 } 266 printf("%1s %4d %s\n", is_diff? kSignalDiff : "", line + 1, 267 expected_lines[line].c_str()); 268 } 269 printf("\nActual\n"); 270 printf("------\n"); 271 printf("%s\n", actual_contents.c_str()); 272 } 273 274 if (!base::PathExists(expected_file)) { 275 base::FilePath actual_file = 276 base::FilePath(html_file.RemoveExtension().value() + 277 AccessibilityTreeFormatter::GetActualFileSuffix()); 278 279 EXPECT_TRUE(base::WriteFile( 280 actual_file, actual_contents.c_str(), actual_contents.size())); 281 282 ADD_FAILURE() << "No expectation found. Create it by doing:\n" 283 << "mv " << actual_file.LossyDisplayName() << " " 284 << expected_file.LossyDisplayName(); 285 } 286} 287 288IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityA) { 289 RunTest(FILE_PATH_LITERAL("a.html")); 290} 291 292IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAbbr) { 293 RunTest(FILE_PATH_LITERAL("abbr.html")); 294} 295 296IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAddress) { 297 RunTest(FILE_PATH_LITERAL("address.html")); 298} 299 300IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAName) { 301 RunTest(FILE_PATH_LITERAL("a-name.html")); 302} 303 304IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityANoText) { 305 RunTest(FILE_PATH_LITERAL("a-no-text.html")); 306} 307 308IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAOnclick) { 309 RunTest(FILE_PATH_LITERAL("a-onclick.html")); 310} 311 312IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 313 AccessibilityAriaActivedescendant) { 314 RunTest(FILE_PATH_LITERAL("aria-activedescendant.html")); 315} 316 317IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaAlert) { 318 RunTest(FILE_PATH_LITERAL("aria-alert.html")); 319} 320 321IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 322 AccessibilityAriaApplication) { 323 RunTest(FILE_PATH_LITERAL("aria-application.html")); 324} 325 326IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaAtomic) { 327 RunTest(FILE_PATH_LITERAL("aria-atomic.html")); 328} 329 330IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 331 AccessibilityAriaAutocomplete) { 332 RunTest(FILE_PATH_LITERAL("aria-autocomplete.html")); 333} 334 335// crbug.com/98976 will cause new elements to be added to the Blink a11y tree 336// Re-baseline after the Blink change goes in 337IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 338 DISABLED_AccessibilityAriaCombobox) { 339 RunTest(FILE_PATH_LITERAL("aria-combobox.html")); 340} 341 342IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaHidden) { 343 RunTest(FILE_PATH_LITERAL("aria-hidden.html")); 344} 345 346IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 347 MAYBE(AccessibilityAriaFlowto)) { 348 RunTest(FILE_PATH_LITERAL("aria-flowto.html")); 349} 350 351IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaImg) { 352 RunTest(FILE_PATH_LITERAL("aria-img.html")); 353} 354 355IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaInvalid) { 356 RunTest(FILE_PATH_LITERAL("aria-invalid.html")); 357} 358 359IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 360 AccessibilityAriaLabelledByHeading) { 361 RunTest(FILE_PATH_LITERAL("aria-labelledby-heading.html")); 362} 363 364IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaLevel) { 365 RunTest(FILE_PATH_LITERAL("aria-level.html")); 366} 367 368IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaList) { 369 RunTest(FILE_PATH_LITERAL("aria-list.html")); 370} 371 372IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 373 AccessibilityAriaListBoxActiveDescendant) { 374 RunTest(FILE_PATH_LITERAL("aria-listbox-activedescendant.html")); 375} 376 377IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 378 AccessibilityAriaListBoxAriaSelected) { 379 RunTest(FILE_PATH_LITERAL("aria-listbox-aria-selected.html")); 380} 381 382IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 383 AccessibilityAriaListBoxChildFocus) { 384 RunTest(FILE_PATH_LITERAL("aria-listbox-childfocus.html")); 385} 386 387IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaLog) { 388 RunTest(FILE_PATH_LITERAL("aria-log.html")); 389} 390 391IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaMarquee) { 392 RunTest(FILE_PATH_LITERAL("aria-marquee.html")); 393} 394 395IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaMenu) { 396 RunTest(FILE_PATH_LITERAL("aria-menu.html")); 397} 398 399IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 400 AccessibilityAriaMenuitemradio) { 401 RunTest(FILE_PATH_LITERAL("aria-menuitemradio.html")); 402} 403 404IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 405 AccessibilityAriaOrientation) { 406 RunTest(FILE_PATH_LITERAL("aria-orientation.html")); 407} 408 409IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaNone) { 410 RunTest(FILE_PATH_LITERAL("aria-none.html")); 411} 412 413IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 414 AccessibilityAriaPressed) { 415 RunTest(FILE_PATH_LITERAL("aria-pressed.html")); 416} 417 418IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 419 AccessibilityAriaProgressbar) { 420 RunTest(FILE_PATH_LITERAL("aria-progressbar.html")); 421} 422 423IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaRow) { 424 RunTest(FILE_PATH_LITERAL("aria-row.html")); 425} 426 427IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 428 AccessibilityAriaReadonly) { 429 RunTest(FILE_PATH_LITERAL("aria-readonly.html")); 430} 431 432IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaSort) { 433 RunTest(FILE_PATH_LITERAL("aria-sort.html")); 434} 435 436IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 437 AccessibilityAriaSpinButton) { 438 RunTest(FILE_PATH_LITERAL("aria-spinbutton.html")); 439} 440 441IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaTimer) { 442 RunTest(FILE_PATH_LITERAL("aria-timer.html")); 443} 444 445IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 446 AccessibilityAriaToggleButton) { 447 RunTest(FILE_PATH_LITERAL("aria-togglebutton.html")); 448} 449 450IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 451 AccessibilityAriaToolbar) { 452 RunTest(FILE_PATH_LITERAL("aria-toolbar.html")); 453} 454 455IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 456 AccessibilityAriaValueMin) { 457 RunTest(FILE_PATH_LITERAL("aria-valuemin.html")); 458} 459 460IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 461 AccessibilityAriaValueMax) { 462 RunTest(FILE_PATH_LITERAL("aria-valuemax.html")); 463} 464 465IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityArticle) { 466 RunTest(FILE_PATH_LITERAL("article.html")); 467} 468 469IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAWithImg) { 470 RunTest(FILE_PATH_LITERAL("a-with-img.html")); 471} 472 473IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBdo) { 474 RunTest(FILE_PATH_LITERAL("bdo.html")); 475} 476 477IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBody) { 478 RunTest(FILE_PATH_LITERAL("body.html")); 479} 480 481IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBR) { 482 RunTest(FILE_PATH_LITERAL("br.html")); 483} 484 485IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityButton) { 486 RunTest(FILE_PATH_LITERAL("button.html")); 487} 488 489IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityButtonNameCalc) { 490 RunTest(FILE_PATH_LITERAL("button-name-calc.html")); 491} 492 493IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityCanvas) { 494 RunTest(FILE_PATH_LITERAL("canvas.html")); 495} 496 497IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityCaption) { 498 RunTest(FILE_PATH_LITERAL("caption.html")); 499} 500 501IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 502 AccessibilityCheckboxNameCalc) { 503 RunTest(FILE_PATH_LITERAL("checkbox-name-calc.html")); 504} 505 506IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityCol) { 507 RunTest(FILE_PATH_LITERAL("col.html")); 508} 509 510IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityDel) { 511 RunTest(FILE_PATH_LITERAL("del.html")); 512} 513 514IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityDfn) { 515 RunTest(FILE_PATH_LITERAL("dfn.html")); 516} 517 518IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityDialog) { 519 RunTest(FILE_PATH_LITERAL("dialog.html")); 520} 521 522IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityDiv) { 523 RunTest(FILE_PATH_LITERAL("div.html")); 524} 525 526IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityDl) { 527 RunTest(FILE_PATH_LITERAL("dl.html")); 528} 529 530IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 531 AccessibilityContenteditableDescendants) { 532 RunTest(FILE_PATH_LITERAL("contenteditable-descendants.html")); 533} 534 535IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityEm) { 536 RunTest(FILE_PATH_LITERAL("em.html")); 537} 538 539IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityFigcaption) { 540 RunTest(FILE_PATH_LITERAL("figcaption.html")); 541} 542 543IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityFigure) { 544 RunTest(FILE_PATH_LITERAL("figure.html")); 545} 546 547IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityFooter) { 548 RunTest(FILE_PATH_LITERAL("footer.html")); 549} 550 551IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityForm) { 552 RunTest(FILE_PATH_LITERAL("form.html")); 553} 554 555IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityFrameset) { 556 RunTest(FILE_PATH_LITERAL("frameset.html")); 557} 558 559IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityHeading) { 560 RunTest(FILE_PATH_LITERAL("heading.html")); 561} 562 563IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityHR) { 564 RunTest(FILE_PATH_LITERAL("hr.html")); 565} 566 567IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityI) { 568 RunTest(FILE_PATH_LITERAL("i.html")); 569} 570 571IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 572 AccessibilityIframeCoordinates) { 573 RunTest(FILE_PATH_LITERAL("iframe-coordinates.html")); 574} 575 576IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityImg) { 577 RunTest(FILE_PATH_LITERAL("img.html")); 578} 579 580IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputButton) { 581 RunTest(FILE_PATH_LITERAL("input-button.html")); 582} 583 584IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 585 AccessibilityInputButtonInMenu) { 586 RunTest(FILE_PATH_LITERAL("input-button-in-menu.html")); 587} 588 589IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputColor) { 590 RunTest(FILE_PATH_LITERAL("input-color.html")); 591} 592 593IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 594 AccessibilityInputImageButtonInMenu) { 595 RunTest(FILE_PATH_LITERAL("input-image-button-in-menu.html")); 596} 597 598IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputRange) { 599 RunTest(FILE_PATH_LITERAL("input-range.html")); 600} 601 602IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputSearch) { 603 RunTest(FILE_PATH_LITERAL("input-search.html")); 604} 605 606IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 607 AccessibilityInputTextNameCalc) { 608 RunTest(FILE_PATH_LITERAL("input-text-name-calc.html")); 609} 610 611IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityInputTime) { 612 RunTest(FILE_PATH_LITERAL("input-time.html")); 613} 614 615// crbug.com/98976 will cause new elements to be added to the Blink a11y tree 616// Re-baseline after the Blink change goes in 617IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 618 DISABLED_AccessibilityInputTypes) { 619 RunTest(FILE_PATH_LITERAL("input-types.html")); 620} 621 622IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityIns) { 623 RunTest(FILE_PATH_LITERAL("ins.html")); 624} 625 626IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityLabel) { 627 RunTest(FILE_PATH_LITERAL("label.html")); 628} 629 630IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityLandmark) { 631 RunTest(FILE_PATH_LITERAL("landmark.html")); 632} 633 634IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityLegend) { 635 RunTest(FILE_PATH_LITERAL("legend.html")); 636} 637 638IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityListMarkers) { 639 RunTest(FILE_PATH_LITERAL("list-markers.html")); 640} 641 642IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityMain) { 643 RunTest(FILE_PATH_LITERAL("main.html")); 644} 645 646IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityMark) { 647 RunTest(FILE_PATH_LITERAL("mark.html")); 648} 649 650IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 651 AccessibilityMenutypecontext) { 652 RunTest(FILE_PATH_LITERAL("menu-type-context.html")); 653} 654 655IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityMeta) { 656 RunTest(FILE_PATH_LITERAL("meta.html")); 657} 658 659IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityMeter) { 660 RunTest(FILE_PATH_LITERAL("meter.html")); 661} 662 663IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 664 AccessibilityModalDialogClosed) { 665 RunTest(FILE_PATH_LITERAL("modal-dialog-closed.html")); 666} 667 668IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 669 AccessibilityModalDialogOpened) { 670 RunTest(FILE_PATH_LITERAL("modal-dialog-opened.html")); 671} 672 673IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 674 AccessibilityModalDialogInIframeClosed) { 675 RunTest(FILE_PATH_LITERAL("modal-dialog-in-iframe-closed.html")); 676} 677 678IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 679 AccessibilityModalDialogInIframeOpened) { 680 RunTest(FILE_PATH_LITERAL("modal-dialog-in-iframe-opened.html")); 681} 682 683IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 684 AccessibilityModalDialogStack) { 685 RunTest(FILE_PATH_LITERAL("modal-dialog-stack.html")); 686} 687 688IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityOl) { 689 RunTest(FILE_PATH_LITERAL("ol.html")); 690} 691 692IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityObject) { 693 RunTest(FILE_PATH_LITERAL("object.html")); 694} 695 696IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, 697 AccessibilityOptionindatalist) { 698 RunTest(FILE_PATH_LITERAL("option-in-datalist.html")); 699} 700 701IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityP) { 702 RunTest(FILE_PATH_LITERAL("p.html")); 703} 704 705IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityQ) { 706 RunTest(FILE_PATH_LITERAL("q.html")); 707} 708 709IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityRegion) { 710 RunTest(FILE_PATH_LITERAL("region.html")); 711} 712 713IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySelect) { 714 RunTest(FILE_PATH_LITERAL("select.html")); 715} 716 717IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySource) { 718 RunTest(FILE_PATH_LITERAL("source.html")); 719} 720 721IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySpan) { 722 RunTest(FILE_PATH_LITERAL("span.html")); 723} 724 725IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySub) { 726 RunTest(FILE_PATH_LITERAL("sub.html")); 727} 728 729// TODO(dmazzoni): Rebaseline this test after Blink rolls past r155083. 730// See http://crbug.com/265619 731IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, DISABLED_AccessibilitySvg) { 732 RunTest(FILE_PATH_LITERAL("svg.html")); 733} 734 735IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityTab) { 736 RunTest(FILE_PATH_LITERAL("tab.html")); 737} 738 739IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityTableSimple) { 740 RunTest(FILE_PATH_LITERAL("table-simple.html")); 741} 742 743IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityTableSpans) { 744 RunTest(FILE_PATH_LITERAL("table-spans.html")); 745} 746 747IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityTransition) { 748 RunTest(FILE_PATH_LITERAL("transition.html")); 749} 750 751IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityUl) { 752 RunTest(FILE_PATH_LITERAL("ul.html")); 753} 754 755IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { 756 RunTest(FILE_PATH_LITERAL("wbr.html")); 757} 758 759} // namespace content 760