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

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

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Attempt to fix compile. Created 5 years, 4 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
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/chrome_notification_types.h" 6 #include "chrome/browser/chrome_notification_types.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" 10 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 768
769 // Popup window should be in the app's process if site isolation is off; 769 // Popup window should be in the app's process if site isolation is off;
770 // otherwise they should be in different processes. 770 // otherwise they should be in different processes.
771 const BrowserList* active_browser_list = 771 const BrowserList* active_browser_list =
772 BrowserList::GetInstance(chrome::GetActiveDesktop()); 772 BrowserList::GetInstance(chrome::GetActiveDesktop());
773 EXPECT_EQ(2U, active_browser_list->size()); 773 EXPECT_EQ(2U, active_browser_list->size());
774 content::WebContents* popup_contents = 774 content::WebContents* popup_contents =
775 active_browser_list->get(1)->tab_strip_model()->GetActiveWebContents(); 775 active_browser_list->get(1)->tab_strip_model()->GetActiveWebContents();
776 content::WaitForLoadStop(popup_contents); 776 content::WaitForLoadStop(popup_contents);
777 777
778 bool should_be_in_same_process = 778 bool should_be_in_same_process = !content::AreAllSitesIsolatedForTesting();
779 !base::CommandLine::ForCurrentProcess()->HasSwitch(
780 switches::kSitePerProcess);
781 content::RenderProcessHost* popup_process = 779 content::RenderProcessHost* popup_process =
782 popup_contents->GetRenderProcessHost(); 780 popup_contents->GetRenderProcessHost();
783 EXPECT_EQ(should_be_in_same_process, process == popup_process); 781 EXPECT_EQ(should_be_in_same_process, process == popup_process);
784 EXPECT_EQ(should_be_in_same_process, 782 EXPECT_EQ(should_be_in_same_process,
785 process_map->Contains(popup_process->GetID())); 783 process_map->Contains(popup_process->GetID()));
786 } 784 }
787 785
788 // http://crbug.com/118502 786 // http://crbug.com/118502
789 #if defined(OS_MACOSX) || defined(OS_LINUX) 787 #if defined(OS_MACOSX) || defined(OS_LINUX)
790 #define MAYBE_ReloadAppAfterCrash DISABLED_ReloadAppAfterCrash 788 #define MAYBE_ReloadAppAfterCrash DISABLED_ReloadAppAfterCrash
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 // Navigate the popup to another process outside the app. 865 // Navigate the popup to another process outside the app.
868 GURL non_app_url(base_url.Resolve("path3/empty.html")); 866 GURL non_app_url(base_url.Resolve("path3/empty.html"));
869 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); 867 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url);
870 SiteInstance* new_instance = popup_contents->GetSiteInstance(); 868 SiteInstance* new_instance = popup_contents->GetSiteInstance();
871 EXPECT_NE(app_instance, new_instance); 869 EXPECT_NE(app_instance, new_instance);
872 870
873 // It should still be in the same BrowsingInstance, allowing postMessage to 871 // It should still be in the same BrowsingInstance, allowing postMessage to
874 // work. 872 // work.
875 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); 873 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance));
876 } 874 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_site_per_process_browsertest.cc ('k') | chrome/browser/password_manager/password_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698