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

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

Issue 11745015: Update references to the extension messaging APIs to point to the "runtime" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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) 2010 The Chromium Authors. All rights reserved. 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 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 var make_browsertest_proceed = function() { 5 var make_browsertest_proceed = function() {
6 if (!chrome.extension.lastError) { 6 if (!chrome.runtime.lastError) {
7 chrome.test.sendMessage("created items"); 7 chrome.test.sendMessage("created items");
8 } 8 }
9 }; 9 };
10 10
11 var patterns = ["http://*.google.com/*", "https://*.google.com/*"]; 11 var patterns = ["http://*.google.com/*", "https://*.google.com/*"];
12 12
13 window.onload = function() { 13 window.onload = function() {
14 // Create one item that does have a documentUrlPattern. 14 // Create one item that does have a documentUrlPattern.
15 var properties1 = { 15 var properties1 = {
16 "title": "test_item1", "documentUrlPatterns": patterns 16 "title": "test_item1", "documentUrlPatterns": patterns
17 }; 17 };
18 chrome.contextMenus.create(properties1); 18 chrome.contextMenus.create(properties1);
19 19
20 // Create an item that initially doesn't have a documentUrlPattern, then 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. 21 // update it, and then proceed with the c++ code in the browser test.
22 var properties2 = { "title": "test_item2" }; 22 var properties2 = { "title": "test_item2" };
23 23
24 var id2; 24 var id2;
25 id2 = chrome.contextMenus.create(properties2, 25 id2 = chrome.contextMenus.create(properties2,
26 function() { 26 function() {
27 var update_properties = { "documentUrlPatterns": patterns }; 27 var update_properties = { "documentUrlPatterns": patterns };
28 chrome.contextMenus.update(id2, update_properties, 28 chrome.contextMenus.update(id2, update_properties,
29 make_browsertest_proceed); 29 make_browsertest_proceed);
30 }); 30 });
31 }; 31 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698