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

Unified Diff: chrome/browser/extensions/extension_browsertests_misc.cc

Issue 10113005: Remove EPM:all_hosts_ and use all_extension_views_ instead. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: interactive_ui_tests Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_browsertests_misc.cc
diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc
index 9353077700ed788a65a26941b00b1c360ef6194e..75b589d866f5ddc3046074ed99c2354df21ce688 100644
--- a/chrome/browser/extensions/extension_browsertests_misc.cc
+++ b/chrome/browser/extensions/extension_browsertests_misc.cc
@@ -37,6 +37,7 @@
#endif
using content::NavigationController;
+using content::RenderViewHost;
using content::WebContents;
const std::string kSubscribePage = "/subscribe.html";
@@ -65,18 +66,20 @@ const std::string kHashPageAHash = kHashPageA + "#asdf";
const std::string kHashPageB =
"files/extensions/api_test/page_action/hash_change/test_page_B.html";
-// Looks for an ExtensionHost whose URL has the given path component (including
+// Looks for a RenderViewHost whose URL has the given path component (including
// leading slash). Also verifies that the expected number of hosts are loaded.
-static ExtensionHost* FindHostWithPath(ExtensionProcessManager* manager,
- const std::string& path,
- int expected_hosts) {
- ExtensionHost* host = NULL;
+static RenderViewHost* FindHostWithPath(ExtensionProcessManager* manager,
+ const std::string& path,
+ int expected_hosts) {
+ RenderViewHost* host = NULL;
int num_hosts = 0;
- for (ExtensionProcessManager::const_iterator iter = manager->begin();
- iter != manager->end(); ++iter) {
+ ExtensionProcessManager::ContentsSet all_contents = manager->GetAllContents();
+ for (ExtensionProcessManager::ContentsSet::const_iterator iter =
+ all_contents.begin();
+ iter != all_contents.end(); ++iter) {
if ((*iter)->GetURL().path() == path) {
EXPECT_FALSE(host);
- host = *iter;
+ host = (*iter)->GetRenderViewHost();
}
num_hosts++;
}
@@ -125,9 +128,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WebKitPrefsBackgroundPage) {
ExtensionProcessManager* manager =
browser()->profile()->GetExtensionProcessManager();
- ExtensionHost* host = FindHostWithPath(manager, "/backgroundpage.html", 1);
- WebPreferences prefs =
- host->render_view_host()->GetDelegate()->GetWebkitPrefs();
+ RenderViewHost* host = FindHostWithPath(manager, "/backgroundpage.html", 1);
+ WebPreferences prefs = host->GetDelegate()->GetWebkitPrefs();
ASSERT_TRUE(prefs.experimental_webgl_enabled);
ASSERT_TRUE(prefs.accelerated_compositing_enabled);
ASSERT_TRUE(prefs.accelerated_2d_canvas_enabled);
@@ -688,11 +690,11 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, LastError) {
// Get the ExtensionHost that is hosting our background page.
ExtensionProcessManager* manager =
browser()->profile()->GetExtensionProcessManager();
- ExtensionHost* host = FindHostWithPath(manager, "/bg.html", 1);
+ RenderViewHost* host = FindHostWithPath(manager, "/bg.html", 1);
bool result = false;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
- host->render_view_host(), L"", L"testLastError()", &result));
+ host, L"", L"testLastError()", &result));
EXPECT_TRUE(result);
}

Powered by Google App Engine
This is Rietveld 408576698