Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / extensions / context_menus / separators / common.js
blob8707440185579aac3580610ac53d0fadf3f5b3cd
1 // Copyright (c) 2010 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.
5 function create(title, type, parent, callback) {
6 props = {};
7 if (title) {
8 props.title = title;
10 props.type = type;
12 if (parent) {
13 props.parentId = parent;
16 chrome.contextMenus.create(props, function() {
17 if (!chrome.runtime.lastError && callback) {
18 callback();
20 });
23 function createTestSet(parent, callback) {
24 create("radio1", "radio", parent);
25 create("radio2", "radio", parent);
26 create("normal1", "normal", parent);
27 create(null, "separator", parent);
28 create("normal2", "normal", parent);
29 create(null, "separator", parent);
30 create("radio3", "radio", parent);
31 create("radio4", "radio", parent);
32 create(null, "separator", parent);
33 create("normal3", "normal", parent, callback);