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

Side by Side Diff: chrome/test/data/extensions/api_test/context_menus/event_page/test.js

Issue 10454106: Dispatch a new event chrome.contextMenus.onClicked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: names Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 chrome.test.runTests([ 5 chrome.test.runTests([
6 function stringID() { 6 function stringID() {
7 var id1 = chrome.contextMenus.create( 7 var id1 = chrome.contextMenus.create(
8 {"id": "id1", "title": "title1"}, function() { 8 {"id": "id1", "title": "title1"}, function() {
9 chrome.test.assertNoLastError(); 9 chrome.test.assertNoLastError();
10 chrome.test.assertEq("id1", id1); 10 chrome.test.assertEq("id1", id1);
11 chrome.contextMenus.remove("id1", chrome.test.callbackPass()); 11 chrome.contextMenus.remove("id1", chrome.test.callbackPass());
12 }); 12 });
13 }, 13 },
14 14
15 function generatedID() { 15 function generatedID() {
16 chrome.contextMenus.create( 16 chrome.contextMenus.create(
17 {"title": "title2"}, 17 {"title": "title2"},
18 chrome.test.callbackFail("Extensions using event pages must pass an " + 18 chrome.test.callbackFail("Extensions using event pages must pass an " +
19 "id parameter to chrome.contextMenus.create")); 19 "id parameter to chrome.contextMenus.create"));
20 },
21
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."));
20 } 29 }
21 ]); 30 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698