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

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

Issue 2461693002: Change Isolate Extensions to be off by default. (Closed)
Patch Set: Fixes based on review comments. Created 4 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 EXPECT_TRUE(policy->CanRequestURL( 727 EXPECT_TRUE(policy->CanRequestURL(
728 main_frame->GetProcess()->GetID(), 728 main_frame->GetProcess()->GetID(),
729 GURL("filesystem:chrome-extension://some-extension-id/some-path"))); 729 GURL("filesystem:chrome-extension://some-extension-id/some-path")));
730 EXPECT_TRUE(policy->CanRequestURL( 730 EXPECT_TRUE(policy->CanRequestURL(
731 extension_frame->GetProcess()->GetID(), 731 extension_frame->GetProcess()->GetID(),
732 GURL("chrome-extension://some-extension-id/resource.html"))); 732 GURL("chrome-extension://some-extension-id/resource.html")));
733 EXPECT_TRUE(policy->CanRequestURL( 733 EXPECT_TRUE(policy->CanRequestURL(
734 main_frame->GetProcess()->GetID(), 734 main_frame->GetProcess()->GetID(),
735 GURL("chrome-extension://some-extension-id/resource.html"))); 735 GURL("chrome-extension://some-extension-id/resource.html")));
736 736
737 EXPECT_TRUE(policy->CanCommitURL( 737 if (extensions::IsIsolateExtensionsEnabled()) {
738 extension_frame->GetProcess()->GetID(), 738 EXPECT_TRUE(policy->CanCommitURL(
739 GURL("blob:chrome-extension://some-extension-id/some-guid"))); 739 extension_frame->GetProcess()->GetID(),
740 EXPECT_FALSE(policy->CanCommitURL( 740 GURL("blob:chrome-extension://some-extension-id/some-guid")));
741 main_frame->GetProcess()->GetID(), 741 EXPECT_FALSE(policy->CanCommitURL(
742 GURL("blob:chrome-extension://some-extension-id/some-guid"))); 742 main_frame->GetProcess()->GetID(),
743 EXPECT_TRUE(policy->CanCommitURL( 743 GURL("blob:chrome-extension://some-extension-id/some-guid")));
744 extension_frame->GetProcess()->GetID(), 744 EXPECT_TRUE(policy->CanCommitURL(
745 GURL("chrome-extension://some-extension-id/resource.html"))); 745 extension_frame->GetProcess()->GetID(),
746 EXPECT_FALSE(policy->CanCommitURL( 746 GURL("chrome-extension://some-extension-id/resource.html")));
747 main_frame->GetProcess()->GetID(), 747 EXPECT_FALSE(policy->CanCommitURL(
748 GURL("chrome-extension://some-extension-id/resource.html"))); 748 main_frame->GetProcess()->GetID(),
749 EXPECT_TRUE(policy->CanCommitURL( 749 GURL("chrome-extension://some-extension-id/resource.html")));
750 extension_frame->GetProcess()->GetID(), 750 EXPECT_TRUE(policy->CanCommitURL(
751 GURL("filesystem:chrome-extension://some-extension-id/some-path"))); 751 extension_frame->GetProcess()->GetID(),
752 EXPECT_FALSE(policy->CanCommitURL( 752 GURL("filesystem:chrome-extension://some-extension-id/some-path")));
753 main_frame->GetProcess()->GetID(), 753 EXPECT_FALSE(policy->CanCommitURL(
754 GURL("filesystem:chrome-extension://some-extension-id/some-path"))); 754 main_frame->GetProcess()->GetID(),
755 GURL("filesystem:chrome-extension://some-extension-id/some-path")));
756 }
755 757
756 // Open a new about:blank popup from main frame. This should stay in the web 758 // Open a new about:blank popup from main frame. This should stay in the web
757 // process. 759 // process.
758 content::WebContents* popup = 760 content::WebContents* popup =
759 OpenPopup(main_frame, GURL(url::kAboutBlankURL)); 761 OpenPopup(main_frame, GURL(url::kAboutBlankURL));
760 EXPECT_NE(popup, tab); 762 EXPECT_NE(popup, tab);
761 ASSERT_EQ(2, browser()->tab_strip_model()->count()); 763 ASSERT_EQ(2, browser()->tab_strip_model()->count());
762 EXPECT_EQ(IfExtensionsIsolated(1, 0), 764 EXPECT_EQ(IfExtensionsIsolated(1, 0),
763 pm->GetRenderFrameHostsForExtension(extension->id()).size()); 765 pm->GetRenderFrameHostsForExtension(extension->id()).size());
764 EXPECT_EQ(IfExtensionsIsolated(1, 0), pm->GetAllFrames().size()); 766 EXPECT_EQ(IfExtensionsIsolated(1, 0), pm->GetAllFrames().size());
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 EXPECT_TRUE(ExecuteScriptAndExtractBool( 1063 EXPECT_TRUE(ExecuteScriptAndExtractBool(
1062 popup, "window.domAutomationController.send(!!window.opener)", 1064 popup, "window.domAutomationController.send(!!window.opener)",
1063 &is_opener_defined)); 1065 &is_opener_defined));
1064 EXPECT_TRUE(is_opener_defined); 1066 EXPECT_TRUE(is_opener_defined);
1065 1067
1066 // Verify that postMessage to window.opener works. 1068 // Verify that postMessage to window.opener works.
1067 VerifyPostMessageToOpener(popup->GetMainFrame(), extension_frame); 1069 VerifyPostMessageToOpener(popup->GetMainFrame(), extension_frame);
1068 } 1070 }
1069 1071
1070 } // namespace extensions 1072 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/process_management_browsertest.cc ('k') | chrome/common/extensions/extension_process_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698