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 var make_browsertest_proceed = function() {
6 if (!chrome.runtime.lastError) {
7 chrome.test.sendMessage("created items");
11 var patterns = ["http://*.google.com/*", "https://*.google.com/*"];
13 window.onload = function() {
14 // Create one item that does have a documentUrlPattern.
16 "title": "test_item1", "documentUrlPatterns": patterns
18 chrome.contextMenus.create(properties1);
20 // Create an item that initially doesn't have a documentUrlPattern, then
21 // update it, and then proceed with the c++ code in the browser test.
22 var properties2 = { "title": "test_item2" };
25 id2 = chrome.contextMenus.create(properties2,
27 var update_properties = { "documentUrlPatterns": patterns };
28 chrome.contextMenus.update(id2, update_properties,
29 make_browsertest_proceed);