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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 class DumpAccessibilityTreeTest : public InProcessBrowserTest { | 45 class DumpAccessibilityTreeTest : public InProcessBrowserTest { |
46 public: | 46 public: |
47 DumpAccessibilityTreeHelper helper_; | 47 DumpAccessibilityTreeHelper helper_; |
48 }; | 48 }; |
49 | 49 |
50 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, | 50 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, |
51 PlatformTreeDifferenceTest) { | 51 PlatformTreeDifferenceTest) { |
52 content::RenderWidgetHostView* host_view = | 52 content::RenderWidgetHostView* host_view = |
53 browser()->GetSelectedWebContents()->GetRenderWidgetHostView(); | 53 browser()->GetSelectedWebContents()->GetRenderWidgetHostView(); |
54 RenderWidgetHost* host = host_view->GetRenderWidgetHost(); | 54 RenderWidgetHost* host = host_view->GetRenderWidgetHost(); |
55 RenderViewHost* view_host = static_cast<RenderViewHost*>(host); | 55 // TODO(joi): Remove this dependency |
| 56 RenderViewHostImpl* view_host = |
| 57 static_cast<RenderViewHostImpl*>(RenderWidgetHostImpl::From(host)); |
56 view_host->set_save_accessibility_tree_for_testing(true); | 58 view_host->set_save_accessibility_tree_for_testing(true); |
57 view_host->EnableRendererAccessibility(); | 59 view_host->EnableRendererAccessibility(); |
58 | 60 |
59 // Setup test paths. | 61 // Setup test paths. |
60 FilePath dir_test_data; | 62 FilePath dir_test_data; |
61 EXPECT_TRUE(PathService::Get(content::DIR_TEST_DATA, &dir_test_data)); | 63 EXPECT_TRUE(PathService::Get(content::DIR_TEST_DATA, &dir_test_data)); |
62 FilePath test_path(dir_test_data.Append(FILE_PATH_LITERAL("accessibility"))); | 64 FilePath test_path(dir_test_data.Append(FILE_PATH_LITERAL("accessibility"))); |
63 EXPECT_TRUE(file_util::PathExists(test_path)) | 65 EXPECT_TRUE(file_util::PathExists(test_path)) |
64 << test_path.LossyDisplayName(); | 66 << test_path.LossyDisplayName(); |
65 | 67 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 114 |
113 EXPECT_TRUE(file_util::WriteFile( | 115 EXPECT_TRUE(file_util::WriteFile( |
114 actual_file, actual_contents8.c_str(), actual_contents8.size())); | 116 actual_file, actual_contents8.c_str(), actual_contents8.size())); |
115 | 117 |
116 ADD_FAILURE() << "No expectation found. Create it by doing:\n" | 118 ADD_FAILURE() << "No expectation found. Create it by doing:\n" |
117 << "mv " << actual_file.LossyDisplayName() << " " | 119 << "mv " << actual_file.LossyDisplayName() << " " |
118 << expected_file.LossyDisplayName(); | 120 << expected_file.LossyDisplayName(); |
119 } | 121 } |
120 } while (!(html_file = file_enumerator.Next()).empty()); | 122 } while (!(html_file = file_enumerator.Next()).empty()); |
121 } | 123 } |
OLD | NEW |