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