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 // API test for chrome.extension.getViews. | 5 // API test for chrome.extension.getViews. |
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.GetViews | 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.GetViews |
7 | 7 |
8 const assertEq = chrome.test.assertEq; | 8 const assertEq = chrome.test.assertEq; |
9 const assertTrue = chrome.test.assertTrue; | 9 const assertTrue = chrome.test.assertTrue; |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 assertEq(1, chrome.extension.getViews().length); | 37 assertEq(1, chrome.extension.getViews().length); |
38 assertEq(0, chrome.extension.getViews({"type": "tab"}).length); | 38 assertEq(0, chrome.extension.getViews({"type": "tab"}).length); |
39 assertEq(0, chrome.extension.getViews({"type": "infobar"}).length); | 39 assertEq(0, chrome.extension.getViews({"type": "infobar"}).length); |
40 assertEq(0, chrome.extension.getViews({"type": "notification"}).length); | 40 assertEq(0, chrome.extension.getViews({"type": "notification"}).length); |
41 | 41 |
42 chrome.windows.getAll({populate: true}, function(windows) { | 42 chrome.windows.getAll({populate: true}, function(windows) { |
43 assertEq(1, windows.length); | 43 assertEq(1, windows.length); |
44 | 44 |
45 // Show an infobar. | 45 // Show an infobar. |
46 chrome.experimental.infobars.show({tabId: windows[0].tabs[0].id, | 46 chrome.experimental.infobars.show({tabId: windows[0].tabs[0].id, |
47 "path": "infobar.html"}, | 47 "path": "infobar.html", |
| 48 "height": 36}, |
48 function(window) { | 49 function(window) { |
49 assertTrue(window.id > 0); | 50 assertTrue(window.id > 0); |
50 // The infobar will call back to us through infobarCallback (above). | 51 // The infobar will call back to us through infobarCallback (above). |
51 }); | 52 }); |
52 | 53 |
53 }); | 54 }); |
54 } | 55 } |
55 ]; | 56 ]; |
56 | 57 |
57 chrome.test.runTests(tests); | 58 chrome.test.runTests(tests); |
OLD | NEW |