| OLD | NEW |
| 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 if (!chrome.contextMenus) { | |
| 6 chrome.contextMenus = chrome.experimental.contextMenus; | |
| 7 } | |
| 8 | |
| 9 var assertNoLastError = chrome.test.assertNoLastError; | 5 var assertNoLastError = chrome.test.assertNoLastError; |
| 10 | 6 |
| 11 var tests = [ | 7 var tests = [ |
| 12 function simple() { | 8 function simple() { |
| 13 chrome.contextMenus.create({"title":"1"}, chrome.test.callbackPass()); | 9 chrome.contextMenus.create({"title":"1"}, chrome.test.callbackPass()); |
| 14 }, | 10 }, |
| 15 | 11 |
| 16 function no_properties() { | 12 function no_properties() { |
| 17 chrome.contextMenus.create({}, function(id) { | 13 chrome.contextMenus.create({}, function(id) { |
| 18 chrome.test.assertTrue(chrome.extension.lastError != null); | 14 chrome.test.assertTrue(chrome.extension.lastError != null); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 77 } |
| 82 | 78 |
| 83 for (var i in types) { | 79 for (var i in types) { |
| 84 tests.push(makeCreateTest(types[i])); | 80 tests.push(makeCreateTest(types[i])); |
| 85 } | 81 } |
| 86 for (var i in contexts) { | 82 for (var i in contexts) { |
| 87 tests.push(makeCreateTest("normal", [ contexts[i] ])); | 83 tests.push(makeCreateTest("normal", [ contexts[i] ])); |
| 88 } | 84 } |
| 89 | 85 |
| 90 chrome.test.runTests(tests); | 86 chrome.test.runTests(tests); |
| 91 | |
| OLD | NEW |