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

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

Issue 1748943002: [Extensions] Harden against bindings interception (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/test/data/extensions/api_test/bindings/function_interceptions.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_bindings_apitest.cc
diff --git a/chrome/browser/extensions/extension_bindings_apitest.cc b/chrome/browser/extensions/extension_bindings_apitest.cc
index 07f6ac38f207e6d5dc6fc446ca24994404a45cba..387576f78c9594f291a0b3d98392fb7d0088d19d 100644
--- a/chrome/browser/extensions/extension_bindings_apitest.cc
+++ b/chrome/browser/extensions/extension_bindings_apitest.cc
@@ -183,5 +183,30 @@ IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest, HandlerFunctionTypeChecking) {
EXPECT_EQ("success", result);
}
+IN_PROC_BROWSER_TEST_F(ExtensionBindingsApiTest,
+ MoreNativeFunctionInterceptionTests) {
+ ASSERT_TRUE(embedded_test_server()->Start());
+
+ // We need to create runtime bindings in the web page. An extension that's
+ // externally connectable will do that for us.
+ ASSERT_TRUE(
+ LoadExtension(test_data_dir_.AppendASCII("bindings")
+ .AppendASCII("externally_connectable_everywhere")));
+
+ ui_test_utils::NavigateToURL(
+ browser(),
+ embedded_test_server()->GetURL(
+ "/extensions/api_test/bindings/function_interceptions.html"));
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ EXPECT_FALSE(web_contents->IsCrashed());
+ // See function_interceptions.html.
+ std::string result;
+ EXPECT_TRUE(content::ExecuteScriptAndExtractString(
+ web_contents, "window.domAutomationController.send(window.testStatus);",
+ &result));
+ EXPECT_EQ("success", result);
+}
+
} // namespace
} // namespace extensions
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/bindings/function_interceptions.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698