OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 FilePath resources_pack_path; | 70 FilePath resources_pack_path; |
71 EXPECT_TRUE(PathService::Get(chrome::FILE_RESOURCES_PACK, | 71 EXPECT_TRUE(PathService::Get(chrome::FILE_RESOURCES_PACK, |
72 &resources_pack_path)); | 72 &resources_pack_path)); |
73 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); | 73 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); |
74 } | 74 } |
75 }; | 75 }; |
76 | 76 |
77 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, | 77 IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, |
78 PlatformTreeDifferenceTest) { | 78 PlatformTreeDifferenceTest) { |
79 RenderWidgetHostView* host_view = | 79 RenderWidgetHostView* host_view = |
80 browser()->GetSelectedTabContents()->GetRenderWidgetHostView(); | 80 browser()->GetSelectedWebContents()->GetRenderWidgetHostView(); |
81 RenderWidgetHost* host = host_view->GetRenderWidgetHost(); | 81 RenderWidgetHost* host = host_view->GetRenderWidgetHost(); |
82 RenderViewHost* view_host = static_cast<RenderViewHost*>(host); | 82 RenderViewHost* view_host = static_cast<RenderViewHost*>(host); |
83 view_host->set_save_accessibility_tree_for_testing(true); | 83 view_host->set_save_accessibility_tree_for_testing(true); |
84 view_host->EnableRendererAccessibility(); | 84 view_host->EnableRendererAccessibility(); |
85 | 85 |
86 // Setup test paths. | 86 // Setup test paths. |
87 FilePath dir_test_data; | 87 FilePath dir_test_data; |
88 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); | 88 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); |
89 FilePath test_path(dir_test_data.Append(FilePath("accessibility"))); | 89 FilePath test_path(dir_test_data.Append(FilePath("accessibility"))); |
90 EXPECT_TRUE(file_util::PathExists(test_path)) | 90 EXPECT_TRUE(file_util::PathExists(test_path)) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 FilePath(html_file.RemoveExtension().value() + kActualFileSuffix); | 132 FilePath(html_file.RemoveExtension().value() + kActualFileSuffix); |
133 EXPECT_TRUE(file_util::WriteFile( | 133 EXPECT_TRUE(file_util::WriteFile( |
134 actual_file, actual_contents.c_str(), actual_contents.size())); | 134 actual_file, actual_contents.c_str(), actual_contents.size())); |
135 | 135 |
136 ADD_FAILURE() << "No expectation found. Create it by doing:\n" | 136 ADD_FAILURE() << "No expectation found. Create it by doing:\n" |
137 << "mv " << actual_file.LossyDisplayName() << " " | 137 << "mv " << actual_file.LossyDisplayName() << " " |
138 << expected_file.LossyDisplayName(); | 138 << expected_file.LossyDisplayName(); |
139 } | 139 } |
140 } | 140 } |
141 } | 141 } |
OLD | NEW |