summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-29 16:57:26 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-29 16:57:26 +0000
commit5ef2c6a4fbd6ef7e869e26847072c4275bcfc225 (patch)
tree194a0143b31b21f91c00ce741613539a7645fe86
parent1dbc10e1ded96c967fa804dd040d1425f6bda127 (diff)
downloadchromium_src-5ef2c6a4fbd6ef7e869e26847072c4275bcfc225.zip
chromium_src-5ef2c6a4fbd6ef7e869e26847072c4275bcfc225.tar.gz
chromium_src-5ef2c6a4fbd6ef7e869e26847072c4275bcfc225.tar.bz2
Merge 245065 "Don't crash the renderer if there is an error on r..."
> Don't crash the renderer if there is an error on runtime.sendMessage from a > hosted app context. The crash comes from us trying to set runtime.lastError > which isn't available to hosted apps. This makes it available to hosted apps. > > BUG=326250 > R=yoz@chromium.org > > Review URL: https://codereview.chromium.org/131473006 TBR=kalman@chromium.org Review URL: https://codereview.chromium.org/140683012 git-svn-id: svn://svn.chromium.org/chrome/branches/1750/src@247704 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_messages_apitest.cc19
-rw-r--r--chrome/common/extensions/api/_api_features.json1
2 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_messages_apitest.cc b/chrome/browser/extensions/extension_messages_apitest.cc
index c1505cf..fdd3f87 100644
--- a/chrome/browser/extensions/extension_messages_apitest.cc
+++ b/chrome/browser/extensions/extension_messages_apitest.cc
@@ -942,5 +942,24 @@ IN_PROC_BROWSER_TEST_F(ExternallyConnectableMessagingTest, HostedAppOnWebsite) {
EXPECT_FALSE(AreAnyNonWebApisDefined());
}
+// Tests that an invalid extension ID specified in a hosted app does not crash
+// the hosted app's renderer.
+//
+// This is a regression test for http://crbug.com/326250#c12.
+IN_PROC_BROWSER_TEST_F(ExternallyConnectableMessagingTest,
+ InvalidExtensionIDFromHostedApp) {
+ InitializeTestServer();
+
+ // The presence of the chromium hosted app triggers this bug. The chromium
+ // connectable extension needs to be installed to set up the runtime bindings.
+ LoadChromiumHostedApp();
+ LoadChromiumConnectableExtension();
+
+ ui_test_utils::NavigateToURL(browser(), chromium_org_url());
+ EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR ,
+ CanConnectAndSendMessages("invalid"));
+}
+
} // namespace
+
}; // namespace extensions
diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json
index 70aa897..681b3c6 100644
--- a/chrome/common/extensions/api/_api_features.json
+++ b/chrome/common/extensions/api/_api_features.json
@@ -532,6 +532,7 @@
},
"runtime.lastError": {
"contexts": "all",
+ "extension_types": "all",
"matches": ["<all_urls>"]
},
"runtime.onConnect": {