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

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

Issue 7048015: Fix app process initialization when opening an app in a new tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't use WebUI. Created 9 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/app_process_apitest.cc
diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc
index 4172c0ccfecdfd4a59a3f23ef96201088a53ee75..7467c04881925c1976e9c832c6bf8a1e6e9ac039 100644
--- a/chrome/browser/extensions/app_process_apitest.cc
+++ b/chrome/browser/extensions/app_process_apitest.cc
@@ -81,12 +81,25 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, AppProcess) {
replace_host.SetHostStr(host_str);
base_url = base_url.ReplaceComponents(replace_host);
- browser()->NewTab();
- ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path1/empty.html"));
+ // Test both opening a URL in a new tab, and opening a tab and then navigating
+ // it. Either way, app tabs should be considered extension processes, but
+ // they have no elevated privileges and thus should not have WebUI bindings.
+ ui_test_utils::NavigateToURLWithDisposition(
+ browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB,
+ ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
+ EXPECT_TRUE(browser()->GetTabContentsAt(1)->render_view_host()->process()->
+ is_extension_process());
+ EXPECT_FALSE(browser()->GetTabContentsAt(1)->web_ui());
browser()->NewTab();
ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path2/empty.html"));
+ EXPECT_TRUE(browser()->GetTabContentsAt(2)->render_view_host()->process()->
+ is_extension_process());
+ EXPECT_FALSE(browser()->GetTabContentsAt(2)->web_ui());
browser()->NewTab();
ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path3/empty.html"));
+ EXPECT_FALSE(browser()->GetTabContentsAt(3)->render_view_host()->process()->
+ is_extension_process());
+ EXPECT_FALSE(browser()->GetTabContentsAt(3)->web_ui());
// The extension should have opened 3 new tabs. Including the original blank
// tab, we now have 4 tabs. Two should be part of the extension app, and
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698