OLD | NEW |
1 <script> | 1 <!-- |
2 // Content settings API test | 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this |
3 // Run with browser_tests | 3 * source code is governed by a BSD-style license that can be found in the |
4 // --gtest_filter=ExtensionApiTest.ContentSettingsGetResourceIdentifiers | 4 * LICENSE file. |
5 | 5 --> |
6 Object.prototype.forEach = function(f) { | 6 <script src="test.js"></script> |
7 for (key in this) { | |
8 if (this.hasOwnProperty(key)) | |
9 f(key, this[key]); | |
10 } | |
11 } | |
12 | |
13 var cs = chrome.contentSettings; | |
14 chrome.test.runTests([ | |
15 function getResourceIdentifiers() { | |
16 var contentTypes = { | |
17 "cookies": undefined, | |
18 "images": undefined, | |
19 "javascript": undefined, | |
20 "plugins": [ | |
21 { | |
22 "description": "Foo", | |
23 "id": "foo", | |
24 }, | |
25 { | |
26 "description": "Bar Plugin", | |
27 "id": "bar.plugin", | |
28 }, | |
29 ], | |
30 "popups": undefined, | |
31 "notifications": undefined | |
32 }; | |
33 contentTypes.forEach(function(type, identifiers) { | |
34 cs[type].getResourceIdentifiers(chrome.test.callbackPass(function(value) { | |
35 chrome.test.assertEq(identifiers, value); | |
36 })); | |
37 }); | |
38 }, | |
39 ]); | |
40 </script> | |
OLD | NEW |