Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / permissions / enabled / background.js
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
3 // found in the LICENSE file.
4
5 // All of the calls to chrome.* functions should succeed, since this extension
6 // has requested all required permissions.
7
8 var pass = chrome.test.callbackPass;
9
10 chrome.test.runTests([
11   function history() {
12     try {
13       var query = { 'text': '', 'maxResults': 1 };
14       chrome.history.search(query, pass(function(results) {}));
15     } catch (e) {
16       chrome.test.fail();
17     }
18   },
19
20   function bookmarks() {
21     try {
22       chrome.bookmarks.get("1", pass(function(results) {}));
23     } catch (e) {
24       chrome.test.fail();
25     }
26   },
27
28   function tabs() {
29     try {
30       chrome.tabs.getSelected(null, pass(function(results) {}));
31     } catch (e) {
32       chrome.test.fail();
33     }
34   }
35 ]);