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

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

Issue 948243005: Merge custom bindings for context menus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ExtensionContextMenuBrowserTest.UpdateOnclick test Created 5 years, 8 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
OLDNEW
(Empty)
1 // Copyright 2015 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.
4
5 window.onload = function() {
6 chrome.contextMenus.create({
7 id: 'id1',
8 title: 'Menu item 1',
9 onclick: function() {
10 chrome.test.sendMessage('onclick1-unexpected');
11 }
12 }, onCreatedFirstMenu);
13 };
14
15 function onCreatedFirstMenu() {
16 chrome.contextMenus.update('id1', {
17 onclick: null
18 }, function() {
19 chrome.test.sendMessage('update1', function() {
20 // Now create another context menu item, to test whether adding and
21 // updating a context menu with a new onclick handler works.
22 // Upon completing that test, we will also know whether menu 1's initial
23 // onclick attribute has been triggered unexpectedly.
24 createSecondMenu();
25 });
26 });
27 }
28
29 function createSecondMenu() {
30 chrome.contextMenus.create({
31 id: 'id2',
32 title: 'Menu item 2',
33 onclick: function() {
34 chrome.test.sendMessage('onclick2-unexpected');
35 }
36 }, function() {
37 chrome.contextMenus.update('id2', {
38 onclick: function() {
39 chrome.test.sendMessage('onclick2');
40 }
41 }, function() {
42 chrome.test.sendMessage('update2');
43 });
44 });
45 }
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/context_menus/onclick_null/manifest.json ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698