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.experimental.sidebar. | 5 // API test for chrome.experimental.sidebar. |
6 // browser_tests.exe --gtest_filter=SidebarApiTest.Sidebar | 6 // browser_tests.exe --gtest_filter=SidebarApiTest.Sidebar |
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 const pass = chrome.test.callbackPass; | 10 const pass = chrome.test.callbackPass; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 }); | 199 }); |
200 }); | 200 }); |
201 }); | 201 }); |
202 }); | 202 }); |
203 }); | 203 }); |
204 }, | 204 }, |
205 | 205 |
206 function navigateSidebar() { | 206 function navigateSidebar() { |
207 showSidebarForCurrentTab(function() { | 207 showSidebarForCurrentTab(function() { |
208 expandSidebarForCurrentTab(function() { | 208 expandSidebarForCurrentTab(function() { |
209 chrome.sidebar.navigate({url: 'simple_page.html'}); | 209 chrome.sidebar.navigate({path: 'simple_page.html'}); |
210 hideSidebarForCurrentTab(pass()); | 210 hideSidebarForCurrentTab(pass()); |
211 }); | 211 }); |
212 }); | 212 }); |
213 }, | 213 }, |
214 | 214 |
215 function crashTest() { | 215 function crashTest() { |
216 // Chrome should not crash on this request. | 216 // Chrome should not crash on this request. |
217 chrome.sidebar.getState(undefined, function(state) { | 217 chrome.sidebar.getState(undefined, function(state) { |
218 assertEq('hidden', state); | 218 assertEq('hidden', state); |
219 chrome.sidebar.getState(null, function(state) { | 219 chrome.sidebar.getState(null, function(state) { |
(...skipping 17 matching lines...) Expand all Loading... |
237 // TODO(alekseys): test unicode strings. | 237 // TODO(alekseys): test unicode strings. |
238 chrome.sidebar.setBadgeText({text: 'Some random text'}); | 238 chrome.sidebar.setBadgeText({text: 'Some random text'}); |
239 chrome.sidebar.setIcon({path: 'icon.png'}); | 239 chrome.sidebar.setIcon({path: 'icon.png'}); |
240 chrome.sidebar.setTitle({title: 'Some random title'}); | 240 chrome.sidebar.setTitle({title: 'Some random title'}); |
241 hideSidebarForCurrentTab(pass()); | 241 hideSidebarForCurrentTab(pass()); |
242 }); | 242 }); |
243 } | 243 } |
244 ]; | 244 ]; |
245 | 245 |
246 chrome.test.runTests(tests); | 246 chrome.test.runTests(tests); |
OLD | NEW |