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

Unified Diff: chrome/test/data/extensions/context_menus/simple/test.js

Issue 3017047: Set a max limit on extension items' labels in context menus.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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
« no previous file with comments | « chrome/test/data/extensions/context_menus/patterns/test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/context_menus/simple/test.js
===================================================================
--- chrome/test/data/extensions/context_menus/simple/test.js (revision 54510)
+++ chrome/test/data/extensions/context_menus/simple/test.js (working copy)
@@ -2,33 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Checks that there is only one window and one tab, and calls back |callback|
-// with its id (or -1 if there is more than 1 window or more than 1 tab).
-function getCurrentSingleTabId(callback) {
- chrome.windows.getAll({"populate":true}, function(windows) {
- if (windows.length != 1 || windows[0].tabs.length != 1) {
- callback(-1);
- } else {
- callback(windows[0].tabs[0].id);
- }
- });
-}
-
-function navigateCurrentTab(url) {
- getCurrentSingleTabId(function(tabid) {
- chrome.tabs.update(tabid, {"url": url});
- });
-}
-
function onclick(info) {
- navigateCurrentTab(chrome.extension.getURL("test2.html"));
+ chrome.test.sendMessage("onclick fired");
}
window.onload = function() {
chrome.contextMenus.create({"title":"Extension Item 1",
"onclick": onclick}, function() {
if (!chrome.extension.lastError) {
- navigateCurrentTab(chrome.extension.getURL("test.html"));
+ chrome.test.sendMessage("created item");
}
});
};
« no previous file with comments | « chrome/test/data/extensions/context_menus/patterns/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698