OLD | NEW |
1 <script> | 1 <!-- |
2 // This tests whether we have permission to use individual functions, despite | 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this |
3 // not having asked for any permissions in the manifest. | 3 * source code is governed by a BSD-style license that can be found in the |
4 | 4 * LICENSE file. |
5 chrome.test.runTests([ | 5 --> |
6 | 6 <script src="background.js"></script> |
7 // Test the tabs API. | |
8 function tabs() { | |
9 try { | |
10 chrome.tabs.create({url: "404_is_enough.html"}, function(tab1) { | |
11 chrome.tabs.update(tab1.id, {url: "404_again.html"}, function(tab2) { | |
12 chrome.tabs.onRemoved.addListener(function(tabId, removeInfo) { | |
13 chrome.test.assertEq(tab1.id, tabId); | |
14 chrome.test.succeed(); | |
15 }); | |
16 chrome.tabs.remove(tab1.id); | |
17 }); | |
18 }); | |
19 } catch (e) { | |
20 chrome.test.fail(); | |
21 } | |
22 }, | |
23 | |
24 // Negative test for the tabs API. | |
25 function tabsNegative() { | |
26 try { | |
27 var tab = chrome.tabs.getSelected(); | |
28 chrome.test.fail(); | |
29 } catch (e) { | |
30 chrome.test.succeed(); | |
31 } | |
32 } | |
33 | |
34 ]); | |
35 </script> | |
OLD | NEW |