Chromium Code Reviews| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | |
| 9 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 11 #include "base/logging.h" |
| 11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 13 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
| 14 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "content/browser/accessibility/accessibility_tree_formatter.h" | 17 #include "content/browser/accessibility/accessibility_tree_formatter.h" |
| 17 #include "content/browser/accessibility/browser_accessibility.h" | 18 #include "content/browser/accessibility/browser_accessibility.h" |
| 18 #include "content/browser/accessibility/browser_accessibility_manager.h" | 19 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 19 #include "content/browser/renderer_host/render_view_host_impl.h" | 20 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 20 #include "content/port/browser/render_widget_host_view_port.h" | 21 #include "content/port/browser/render_widget_host_view_port.h" |
| 21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/common/content_paths.h" | 23 #include "content/public/common/content_paths.h" |
| 24 #include "content/public/common/content_switches.h" | |
| 23 #include "content/public/common/url_constants.h" | 25 #include "content/public/common/url_constants.h" |
| 24 #include "content/shell/browser/shell.h" | 26 #include "content/shell/browser/shell.h" |
| 25 #include "content/test/accessibility_browser_test_utils.h" | 27 #include "content/test/accessibility_browser_test_utils.h" |
| 26 #include "content/test/content_browser_test.h" | 28 #include "content/test/content_browser_test.h" |
| 27 #include "content/test/content_browser_test_utils.h" | 29 #include "content/test/content_browser_test_utils.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 29 | 31 |
| 30 // TODO(dmazzoni): Disabled accessibility tests on Win64. crbug.com/179717 | 32 // TODO(dmazzoni): Disabled accessibility tests on Win64. crbug.com/179717 |
| 31 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) | 33 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) |
| 32 #define MAYBE(x) DISABLED_##x | 34 #define MAYBE(x) DISABLED_##x |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 } else if (StartsWithASCII(line, allow_str, true)) { | 114 } else if (StartsWithASCII(line, allow_str, true)) { |
| 113 filters->push_back(Filter(UTF8ToUTF16(line.substr(allow_str.size())), | 115 filters->push_back(Filter(UTF8ToUTF16(line.substr(allow_str.size())), |
| 114 Filter::ALLOW)); | 116 Filter::ALLOW)); |
| 115 } else if (StartsWithASCII(line, deny_str, true)) { | 117 } else if (StartsWithASCII(line, deny_str, true)) { |
| 116 filters->push_back(Filter(UTF8ToUTF16(line.substr(deny_str.size())), | 118 filters->push_back(Filter(UTF8ToUTF16(line.substr(deny_str.size())), |
| 117 Filter::DENY)); | 119 Filter::DENY)); |
| 118 } | 120 } |
| 119 } | 121 } |
| 120 } | 122 } |
| 121 | 123 |
| 124 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
| 125 ContentBrowserTest::SetUpCommandLine(command_line); | |
| 126 // Enable <dialog>, which is used in some tests. | |
| 127 CommandLine::ForCurrentProcess()->AppendSwitch( | |
|
dmazzoni
2013/11/07 16:27:34
Nevermind, looks like you already did this. That's
falken
2013/11/08 05:03:56
Yes, I realized I could do it this way after sendi
| |
| 128 switches::kEnableExperimentalWebPlatformFeatures); | |
| 129 } | |
| 130 | |
| 122 void RunTest(const base::FilePath::CharType* file_path); | 131 void RunTest(const base::FilePath::CharType* file_path); |
| 123 }; | 132 }; |
| 124 | 133 |
| 125 void DumpAccessibilityTreeTest::RunTest( | 134 void DumpAccessibilityTreeTest::RunTest( |
| 126 const base::FilePath::CharType* file_path) { | 135 const base::FilePath::CharType* file_path) { |
| 127 NavigateToURL(shell(), GURL(kAboutBlankURL)); | 136 NavigateToURL(shell(), GURL(kAboutBlankURL)); |
| 128 | 137 |
| 129 // Setup test paths. | 138 // Setup test paths. |
| 130 base::FilePath dir_test_data; | 139 base::FilePath dir_test_data; |
| 131 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); | 140 ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &dir_test_data)); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 } | 412 } |
| 404 | 413 |
| 405 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityLabel) { | 414 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityLabel) { |
| 406 RunTest(FILE_PATH_LITERAL("label.html")); | 415 RunTest(FILE_PATH_LITERAL("label.html")); |
| 407 } | 416 } |
| 408 | 417 |
| 409 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityListMarkers) { | 418 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityListMarkers) { |
| 410 RunTest(FILE_PATH_LITERAL("list-markers.html")); | 419 RunTest(FILE_PATH_LITERAL("list-markers.html")); |
| 411 } | 420 } |
| 412 | 421 |
| 422 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, | |
| 423 AccessibilityModalDialogClosed) { | |
| 424 RunTest(FILE_PATH_LITERAL("modal-dialog-closed.html")); | |
| 425 } | |
| 426 | |
| 427 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, | |
| 428 AccessibilityModalDialogOpened) { | |
| 429 RunTest(FILE_PATH_LITERAL("modal-dialog-opened.html")); | |
| 430 } | |
| 431 | |
| 432 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, | |
| 433 AccessibilityModalDialogStack) { | |
| 434 RunTest(FILE_PATH_LITERAL("modal-dialog-stack.html")); | |
| 435 } | |
| 436 | |
| 413 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityP) { | 437 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityP) { |
| 414 RunTest(FILE_PATH_LITERAL("p.html")); | 438 RunTest(FILE_PATH_LITERAL("p.html")); |
| 415 } | 439 } |
| 416 | 440 |
| 417 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySelect) { | 441 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySelect) { |
| 418 RunTest(FILE_PATH_LITERAL("select.html")); | 442 RunTest(FILE_PATH_LITERAL("select.html")); |
| 419 } | 443 } |
| 420 | 444 |
| 421 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySpan) { | 445 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySpan) { |
| 422 RunTest(FILE_PATH_LITERAL("span.html")); | 446 RunTest(FILE_PATH_LITERAL("span.html")); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 451 | 475 |
| 452 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityUl) { | 476 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityUl) { |
| 453 RunTest(FILE_PATH_LITERAL("ul.html")); | 477 RunTest(FILE_PATH_LITERAL("ul.html")); |
| 454 } | 478 } |
| 455 | 479 |
| 456 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { | 480 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityWbr) { |
| 457 RunTest(FILE_PATH_LITERAL("wbr.html")); | 481 RunTest(FILE_PATH_LITERAL("wbr.html")); |
| 458 } | 482 } |
| 459 | 483 |
| 460 } // namespace content | 484 } // namespace content |
| OLD | NEW |