Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: chrome/browser/accessibility/dump_accessibility_tree_browsertest.cc

Issue 9420007: Move RenderWidgetHostView into content namespace. Fix include paths. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux_chromeos_gtk build issue not caught by trybots. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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 "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/common/chrome_paths.h" 11 #include "chrome/common/chrome_paths.h"
12 #include "chrome/test/base/in_process_browser_test.h" 12 #include "chrome/test/base/in_process_browser_test.h"
13 #include "chrome/test/base/ui_test_utils.h" 13 #include "chrome/test/base/ui_test_utils.h"
14 #include "content/browser/accessibility/browser_accessibility.h" 14 #include "content/browser/accessibility/browser_accessibility.h"
15 #include "content/browser/accessibility/browser_accessibility_manager.h" 15 #include "content/browser/accessibility/browser_accessibility_manager.h"
16 #include "content/browser/renderer_host/render_view_host.h" 16 #include "content/browser/renderer_host/render_view_host.h"
17 #include "content/browser/renderer_host/render_widget_host.h" 17 #include "content/browser/renderer_host/render_widget_host.h"
18 #include "content/browser/renderer_host/render_widget_host_view.h"
19 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
20 #include "content/public/browser/notification_types.h" 19 #include "content/public/browser/notification_types.h"
20 #include "content/public/browser/render_widget_host_view.h"
21 #include "content/public/browser/web_contents.h" 21 #include "content/public/browser/web_contents.h"
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
24 24
25 using content::OpenURLParams; 25 using content::OpenURLParams;
26 using content::Referrer; 26 using content::Referrer;
27 27
28 // Suffix of the expectation file corresponding to html file. 28 // Suffix of the expectation file corresponding to html file.
29 // Example: 29 // Example:
30 // HTML test: test-file.html 30 // HTML test: test-file.html
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 virtual void SetUpInProcessBrowserTestFixture() { 69 virtual void SetUpInProcessBrowserTestFixture() {
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 content::RenderWidgetHostView* host_view =
80 browser()->GetSelectedWebContents()->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")));
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698