OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // All of the calls to chrome.* functions should succeed, since this extension | 5 // All of the calls to chrome.* functions should succeed, since this extension |
6 // has requested all required permissions. | 6 // has requested all required permissions. |
7 | 7 |
8 var pass = chrome.test.callbackPass; | 8 var pass = chrome.test.callbackPass; |
9 | 9 |
10 chrome.test.runTests([ | 10 chrome.test.runTests([ |
| 11 function experimental() { |
| 12 // Test that use of an experimental API works. |
| 13 // If/when chrome.experimental.accessibility is moved out of |
| 14 // experimental, this test needs to be updated. |
| 15 chrome.tabs.getSelected(null, function(tab) { |
| 16 try { |
| 17 chrome.experimental.accessibility.getAlertsForTab( |
| 18 tab.id, pass(function(alerts) {})); |
| 19 } catch (e) { |
| 20 chrome.test.fail(); |
| 21 } |
| 22 }); |
| 23 }, |
| 24 |
11 function history() { | 25 function history() { |
12 try { | 26 try { |
13 var query = { 'text': '', 'maxResults': 1 }; | 27 var query = { 'text': '', 'maxResults': 1 }; |
14 chrome.history.search(query, pass(function(results) {})); | 28 chrome.history.search(query, pass(function(results) {})); |
15 } catch (e) { | 29 } catch (e) { |
16 chrome.test.fail(); | 30 chrome.test.fail(); |
17 } | 31 } |
18 }, | 32 }, |
19 | 33 |
20 function bookmarks() { | 34 function bookmarks() { |
21 try { | 35 try { |
22 chrome.bookmarks.get("1", pass(function(results) {})); | 36 chrome.bookmarks.get("1", pass(function(results) {})); |
23 } catch (e) { | 37 } catch (e) { |
24 chrome.test.fail(); | 38 chrome.test.fail(); |
25 } | 39 } |
26 }, | 40 }, |
27 | 41 |
28 function tabs() { | 42 function tabs() { |
29 try { | 43 try { |
30 chrome.tabs.getSelected(null, pass(function(results) {})); | 44 chrome.tabs.getSelected(null, pass(function(results) {})); |
31 } catch (e) { | 45 } catch (e) { |
32 chrome.test.fail(); | 46 chrome.test.fail(); |
33 } | 47 } |
34 } | 48 } |
35 ]); | 49 ]); |
OLD | NEW |