1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 var id1 = chrome.contextMenus.create(
8 {"id": "id1", "title": "title1"}, function() {
9 chrome.test.assertNoLastError();
10 chrome.test.assertEq("id1", id1);
11 chrome.contextMenus.remove("id1", chrome.test.callbackPass());
15 function generatedID() {
16 chrome.contextMenus.create(
18 chrome.test.callbackFail("Extensions using event pages must pass an " +
19 "id parameter to chrome.contextMenus.create"));
22 function noOnClick() {
23 chrome.contextMenus.create(
24 {"id": "id3", "title": "title3", "onclick": function() {}},
25 chrome.test.callbackFail(
26 "Extensions using event pages cannot pass an onclick parameter " +
27 "to chrome.contextMenus.create. Instead, use the " +
28 "chrome.contextMenus.onClicked event."));