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

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

Issue 2875493002: Block navigations to hosted apps non-icon resources with PlzNavigate. (Closed)
Patch Set: Rebase on nick@'s recent changes. Created 3 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
Index: chrome/browser/extensions/process_manager_browsertest.cc
diff --git a/chrome/browser/extensions/process_manager_browsertest.cc b/chrome/browser/extensions/process_manager_browsertest.cc
index 88c5b9681d8e1fc5e5fd0aba7284a6b569ff1684..dcda6cb498f064ba8f23b56f9e775a2ef23964c6 100644
--- a/chrome/browser/extensions/process_manager_browsertest.cc
+++ b/chrome/browser/extensions/process_manager_browsertest.cc
@@ -26,6 +26,7 @@
#include "chrome/test/base/ui_test_utils.h"
#include "components/guest_view/browser/test_guest_view_manager.h"
#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
@@ -1233,4 +1234,21 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest,
}
}
+// Test to verify that loading a resource other than an icon file is
+// disallowed for hosted apps. See https://crbug.com/717626.
+IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, HostedAppManifest) {
+ // Load an extension with a background page.
+ scoped_refptr<const Extension> extension =
+ LoadExtension(test_data_dir_.AppendASCII("hosted_app"));
+ ASSERT_TRUE(extension);
+
+ content::WebContents* tab =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ content::TestNavigationObserver observer(tab);
+ NavigateToURL(extension->GetResourceURL("/manifest.json"));
+ EXPECT_TRUE(!observer.last_navigation_succeeded());
+ EXPECT_EQ(tab->GetController().GetLastCommittedEntry()->GetPageType(),
+ content::PAGE_TYPE_ERROR);
Devlin 2017/05/24 17:27:19 Can we expand this to include a check for icons th
Devlin 2017/05/24 17:39:17 Missed this one?
nasko 2017/05/24 18:46:37 Oops, sorry, indeed I missed this one. Added.
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698