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

Side by Side Diff: chrome/browser/extensions/app_process_apitest.cc

Issue 12315094: Remove kDefaultHostDesktopType from browser_finder.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix StartupBrowserCreatorTest.ProfilesWithoutPagesNotLaunched Created 7 years, 9 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) 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 "chrome/browser/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 #include "chrome/browser/extensions/extension_host.h" 6 #include "chrome/browser/extensions/extension_host.h"
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/extension_system.h" 8 #include "chrome/browser/extensions/extension_system.h"
9 #include "chrome/browser/extensions/process_map.h" 9 #include "chrome/browser/extensions/process_map.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // tab, we now have 3 tabs. The two app tabs should not be in the same 106 // tab, we now have 3 tabs. The two app tabs should not be in the same
107 // process, since they do not have the background permission. (Thus, we 107 // process, since they do not have the background permission. (Thus, we
108 // want to separate them to improve responsiveness.) 108 // want to separate them to improve responsiveness.)
109 ASSERT_EQ(3, browser()->tab_strip_model()->count()); 109 ASSERT_EQ(3, browser()->tab_strip_model()->count());
110 WebContents* tab1 = browser()->tab_strip_model()->GetWebContentsAt(1); 110 WebContents* tab1 = browser()->tab_strip_model()->GetWebContentsAt(1);
111 WebContents* tab2 = browser()->tab_strip_model()->GetWebContentsAt(2); 111 WebContents* tab2 = browser()->tab_strip_model()->GetWebContentsAt(2);
112 EXPECT_NE(tab1->GetRenderProcessHost(), tab2->GetRenderProcessHost()); 112 EXPECT_NE(tab1->GetRenderProcessHost(), tab2->GetRenderProcessHost());
113 113
114 // Opening tabs with window.open should keep the page in the opener's 114 // Opening tabs with window.open should keep the page in the opener's
115 // process. 115 // process.
116 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); 116 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
117 browser()->host_desktop_type()));
117 OpenWindow(tab1, base_url.Resolve("path1/empty.html"), true, NULL); 118 OpenWindow(tab1, base_url.Resolve("path1/empty.html"), true, NULL);
118 LOG(INFO) << "WindowOpenHelper 1."; 119 LOG(INFO) << "WindowOpenHelper 1.";
119 OpenWindow(tab2, base_url.Resolve("path2/empty.html"), true, NULL); 120 OpenWindow(tab2, base_url.Resolve("path2/empty.html"), true, NULL);
120 LOG(INFO) << "End of test."; 121 LOG(INFO) << "End of test.";
121 } 122 }
122 }; 123 };
123 124
124 // Omits the disable-popup-blocking flag so we can cover that case. 125 // Omits the disable-popup-blocking flag so we can cover that case.
125 class BlockedAppApiTest : public AppApiTest { 126 class BlockedAppApiTest : public AppApiTest {
126 protected: 127 protected:
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(1); 198 WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(1);
198 199
199 EXPECT_EQ(tab->GetRenderProcessHost(), 200 EXPECT_EQ(tab->GetRenderProcessHost(),
200 browser()->tab_strip_model()->GetWebContentsAt(2)-> 201 browser()->tab_strip_model()->GetWebContentsAt(2)->
201 GetRenderProcessHost()); 202 GetRenderProcessHost());
202 EXPECT_NE(tab->GetRenderProcessHost(), 203 EXPECT_NE(tab->GetRenderProcessHost(),
203 browser()->tab_strip_model()->GetWebContentsAt(3)-> 204 browser()->tab_strip_model()->GetWebContentsAt(3)->
204 GetRenderProcessHost()); 205 GetRenderProcessHost());
205 206
206 // Now let's do the same using window.open. The same should happen. 207 // Now let's do the same using window.open. The same should happen.
207 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); 208 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
209 browser()->host_desktop_type()));
208 OpenWindow(tab, base_url.Resolve("path1/empty.html"), true, NULL); 210 OpenWindow(tab, base_url.Resolve("path1/empty.html"), true, NULL);
209 LOG(INFO) << "WindowOpenHelper 1."; 211 LOG(INFO) << "WindowOpenHelper 1.";
210 OpenWindow(tab, base_url.Resolve("path2/empty.html"), true, NULL); 212 OpenWindow(tab, base_url.Resolve("path2/empty.html"), true, NULL);
211 LOG(INFO) << "WindowOpenHelper 2."; 213 LOG(INFO) << "WindowOpenHelper 2.";
212 // TODO(creis): This should open in a new process (i.e., false for the last 214 // TODO(creis): This should open in a new process (i.e., false for the last
213 // argument), but we temporarily avoid swapping processes away from a hosted 215 // argument), but we temporarily avoid swapping processes away from a hosted
214 // app if it has an opener, because some OAuth providers make script calls 216 // app if it has an opener, because some OAuth providers make script calls
215 // between non-app popups and non-app iframes in the app process. 217 // between non-app popups and non-app iframes in the app process.
216 // See crbug.com/59285. 218 // See crbug.com/59285.
217 OpenWindow(tab, base_url.Resolve("path3/empty.html"), true, NULL); 219 OpenWindow(tab, base_url.Resolve("path3/empty.html"), true, NULL);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // We should have opened 2 new bookmark app tabs. Including the original blank 324 // We should have opened 2 new bookmark app tabs. Including the original blank
323 // tab, we now have 3 tabs. Because normal pages use the 325 // tab, we now have 3 tabs. Because normal pages use the
324 // process-per-site-instance model, each should be in its own process. 326 // process-per-site-instance model, each should be in its own process.
325 ASSERT_EQ(3, browser()->tab_strip_model()->count()); 327 ASSERT_EQ(3, browser()->tab_strip_model()->count());
326 WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(1); 328 WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(1);
327 EXPECT_NE(tab->GetRenderProcessHost(), 329 EXPECT_NE(tab->GetRenderProcessHost(),
328 browser()->tab_strip_model()->GetWebContentsAt(2)-> 330 browser()->tab_strip_model()->GetWebContentsAt(2)->
329 GetRenderProcessHost()); 331 GetRenderProcessHost());
330 332
331 // Now let's do the same using window.open. The same should happen. 333 // Now let's do the same using window.open. The same should happen.
332 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); 334 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
335 browser()->host_desktop_type()));
333 OpenWindow(tab, base_url.Resolve("path1/empty.html"), true, NULL); 336 OpenWindow(tab, base_url.Resolve("path1/empty.html"), true, NULL);
334 OpenWindow(tab, base_url.Resolve("path2/empty.html"), true, NULL); 337 OpenWindow(tab, base_url.Resolve("path2/empty.html"), true, NULL);
335 338
336 // Now let's have a tab navigate out of and back into the app's web 339 // Now let's have a tab navigate out of and back into the app's web
337 // extent. Neither navigation should switch processes. 340 // extent. Neither navigation should switch processes.
338 const GURL& app_url(base_url.Resolve("path1/empty.html")); 341 const GURL& app_url(base_url.Resolve("path1/empty.html"));
339 const GURL& non_app_url(base_url.Resolve("path3/empty.html")); 342 const GURL& non_app_url(base_url.Resolve("path3/empty.html"));
340 RenderViewHost* host2 = 343 RenderViewHost* host2 =
341 browser()->tab_strip_model()->GetWebContentsAt(2)->GetRenderViewHost(); 344 browser()->tab_strip_model()->GetWebContentsAt(2)->GetRenderViewHost();
342 NavigateInRenderer(browser()->tab_strip_model()->GetWebContentsAt(2), 345 NavigateInRenderer(browser()->tab_strip_model()->GetWebContentsAt(2),
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 &browser()->tab_strip_model()->GetActiveWebContents()-> 672 &browser()->tab_strip_model()->GetActiveWebContents()->
670 GetController())); 673 GetController()));
671 chrome::Reload(browser(), CURRENT_TAB); 674 chrome::Reload(browser(), CURRENT_TAB);
672 observer.Wait(); 675 observer.Wait();
673 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 676 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
674 contents, 677 contents,
675 "window.domAutomationController.send(chrome.app.isInstalled)", 678 "window.domAutomationController.send(chrome.app.isInstalled)",
676 &is_installed)); 679 &is_installed));
677 ASSERT_TRUE(is_installed); 680 ASSERT_TRUE(is_installed);
678 } 681 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/management/management_apitest.cc ('k') | chrome/browser/extensions/window_open_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698