From f7c80ac89d54f43a43a1fad19a5b4e919927d263 Mon Sep 17 00:00:00 2001 From: "aa@chromium.org" Date: Sun, 29 Jan 2012 22:23:49 +0000 Subject: Remove support for some deprecated APIs in manifest version 2. TBR=kalman@chromium.org Review URL: http://codereview.chromium.org/9295042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119647 0039d316-1c4b-4281-b951-d872f2087c98 --- .../data/extensions/api_test/stubs/background.html | 20 +++++++++++++++++++ .../data/extensions/api_test/stubs/background.js | 18 ----------------- .../data/extensions/api_test/stubs/manifest.json | 5 +---- .../browsertest/crash_25562/background.js | 23 +++------------------- .../browsertest/crash_25562/manifest.json | 9 +++------ .../browsertest/title_localized_pa/background.js | 4 ++-- 6 files changed, 29 insertions(+), 50 deletions(-) create mode 100644 chrome/test/data/extensions/api_test/stubs/background.html delete mode 100644 chrome/test/data/extensions/api_test/stubs/background.js (limited to 'chrome/test') diff --git a/chrome/test/data/extensions/api_test/stubs/background.html b/chrome/test/data/extensions/api_test/stubs/background.html new file mode 100644 index 0000000..f1d207d --- /dev/null +++ b/chrome/test/data/extensions/api_test/stubs/background.html @@ -0,0 +1,20 @@ + diff --git a/chrome/test/data/extensions/api_test/stubs/background.js b/chrome/test/data/extensions/api_test/stubs/background.js deleted file mode 100644 index c0fcc45..0000000 --- a/chrome/test/data/extensions/api_test/stubs/background.js +++ /dev/null @@ -1,18 +0,0 @@ -// 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. - -chrome.extension.onRequest.addListener(function(msg, sender, responseFunc) { - if (msg == "getApi") { - responseFunc(chrome.test.getApiDefinitions()); - } else if (msg == "pass") { - chrome.test.notifyPass(); - } else if (msg.substr(0, 3) == "log") { - chrome.test.log(msg); - } else { - chrome.test.notifyFail("failed"); - } -}); - -// On first install, send a success message so the test can continue. -chrome.test.notifyPass(); diff --git a/chrome/test/data/extensions/api_test/stubs/manifest.json b/chrome/test/data/extensions/api_test/stubs/manifest.json index af8bbbb..6909f1e 100644 --- a/chrome/test/data/extensions/api_test/stubs/manifest.json +++ b/chrome/test/data/extensions/api_test/stubs/manifest.json @@ -1,10 +1,7 @@ { "name": "Content Script Extension API Stubs Test", "version": "1.0", - "manifest_version": 2, - "background": { - "scripts": ["background.js"] - }, + "background_page": "background.html", "content_scripts": [ { "matches": ["http://*/*"], diff --git a/chrome/test/data/extensions/browsertest/crash_25562/background.js b/chrome/test/data/extensions/browsertest/crash_25562/background.js index 8ff4dc0..0264428 100644 --- a/chrome/test/data/extensions/browsertest/crash_25562/background.js +++ b/chrome/test/data/extensions/browsertest/crash_25562/background.js @@ -1,28 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. -// The Page Action ID. -var pageActionId = "TestId"; - -// The window this Page Action is associated with. -var windowId = -1; - -// The TabId this Page Action is associated with. -var tabId = -1; - -// The URL of the page on build.chromium.org. -var pageUrl = ""; - chrome.self.onConnect.addListener(function(port) { - windowId = port.tab.windowId; - tabId = port.tab.id; - pageUrl = port.tab.url; - - port.onMessage.addListener(function(mybool) { + port.onMessage.addListener(function() { // Let Chrome know that the PageAction needs to be enabled for this tabId // and for the url of this page. - chrome.pageActions.enableForTab(pageActionId, - {tabId: tabId, url: pageUrl}); + chrome.pageAction.show(port.sender.tab.id); }); }); diff --git a/chrome/test/data/extensions/browsertest/crash_25562/manifest.json b/chrome/test/data/extensions/browsertest/crash_25562/manifest.json index 4783f04..5c3c5a8 100644 --- a/chrome/test/data/extensions/browsertest/crash_25562/manifest.json +++ b/chrome/test/data/extensions/browsertest/crash_25562/manifest.json @@ -8,12 +8,9 @@ } ], "description": "A page action with incorrect icon specification", "name": "Test extension", - "page_actions": [ { - "icon": "chrome-16.png", - "id": "TestId", - "name": "Page action name", - "tooltip": "Page action tooltip" - } ], + "page_action": { + "icon": "chrome-16.png" + }, "permissions": [ "http://*/*" ], "manifest_version": 2, "version": "1.0" diff --git a/chrome/test/data/extensions/browsertest/title_localized_pa/background.js b/chrome/test/data/extensions/browsertest/title_localized_pa/background.js index 82daf0b..0031ace 100644 --- a/chrome/test/data/extensions/browsertest/title_localized_pa/background.js +++ b/chrome/test/data/extensions/browsertest/title_localized_pa/background.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -6,6 +6,6 @@ chrome.self.onConnect.addListener(function(port) { port.onMessage.addListener(function(mybool) { // Let Chrome know that the PageAction needs to be enabled for this tabId // and for the url of this page. - chrome.pageAction.show(port.tab.id); + chrome.pageAction.show(port.sender.tab.id); }); }); -- cgit v1.1