summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/runtime
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-05 08:42:04 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-05 08:42:04 +0000
commitf36aac3dd5cbdb2b3b56bf32dd64594958ab9156 (patch)
tree48ba79a82f34841888cdc6ee6ecb0a4b8ce68aef /chrome/browser/extensions/api/runtime
parent054e4822bf8fc2b541559f2cc77dfae799de8bdd (diff)
downloadchromium_src-f36aac3dd5cbdb2b3b56bf32dd64594958ab9156.zip
chromium_src-f36aac3dd5cbdb2b3b56bf32dd64594958ab9156.tar.gz
chromium_src-f36aac3dd5cbdb2b3b56bf32dd64594958ab9156.tar.bz2
Expose the extension/app's id on chrome.runtime.id and, and make this
an unprivileged API (opening it up to content scripts) along with getManifest, getURL, and lastError on chrome.runtime. Review URL: https://chromiumcodereview.appspot.com/10640013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145505 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/api/runtime')
-rw-r--r--chrome/browser/extensions/api/runtime/runtime_apitest.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/extensions/api/runtime/runtime_apitest.cc b/chrome/browser/extensions/api/runtime/runtime_apitest.cc
new file mode 100644
index 0000000..7261858
--- /dev/null
+++ b/chrome/browser/extensions/api/runtime/runtime_apitest.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/test/base/ui_test_utils.h"
+
+// Tests the privileged components of chrome.runtime.
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimePrivileged) {
+ ASSERT_TRUE(RunExtensionTest("runtime/privileged")) << message_;
+}
+
+// Tests the unprivileged components of chrome.runtime.
+IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeUnprivileged) {
+ ASSERT_TRUE(StartTestServer());
+ ASSERT_TRUE(
+ LoadExtension(test_data_dir_.AppendASCII("runtime/content_script")));
+
+ // The content script runs on webpage.html.
+ ResultCatcher catcher;
+ ui_test_utils::NavigateToURL(browser(),
+ test_server()->GetURL("webpage.html"));
+ EXPECT_TRUE(catcher.GetNextResult()) << message_;
+}