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

Unified Diff: chrome/test/data/extensions/api_test/active_tab/background.js

Issue 10815028: Make ActiveTabPermissionManager also grant the tabs permission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 8 years, 5 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/test/data/extensions/api_test/active_tab/background.js
diff --git a/chrome/test/data/extensions/api_test/active_tab/background.js b/chrome/test/data/extensions/api_test/active_tab/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..3f2fd586246c7a56b05735a9985e8801bc64ecc1
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/active_tab/background.js
@@ -0,0 +1,33 @@
+// Copyright (c) 2011 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.
+
+var theOnlyTestDone = null;
+
+function inject(callback) {
+ chrome.tabs.executeScript({ code: "true" }, callback);
+}
+
+chrome.browserAction.onClicked.addListener(function() {
+ inject(function() {
+ chrome.test.assertNoLastError();
+ chrome.test.notifyPass();
+ });
+});
+
+chrome.webNavigation.onCompleted.addListener(function(details) {
+ inject(function() {
+ chrome.test.assertLastError("Access to extension API denied.");
+ if (details.url.indexOf("final_page") >= 0)
+ theOnlyTestDone();
+ else
+ chrome.test.notifyPass();
+ });
+});
+
+chrome.test.runTests([
+ function theOnlyTest() {
+ // This will keep the test alive until the final callback is run.
+ theOnlyTestDone = chrome.test.callbackAdded();
+ }
+]);
« no previous file with comments | « chrome/renderer/resources/extensions/apitest.js ('k') | chrome/test/data/extensions/api_test/active_tab/final_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698