OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 // Content settings API test | 5 // Content settings API test |
6 // Run with browser_tests --gtest_filter=ExtensionApiTest.ContentSettings | 6 // Run with browser_tests --gtest_filter=ExtensionApiTest.ContentSettings |
7 | 7 |
8 var cs = chrome.contentSettings; | 8 var cs = chrome.contentSettings; |
9 var default_content_settings = { | 9 var default_content_settings = { |
10 "cookies": "session_only", | 10 "cookies": "session_only", |
11 "images": "allow", | 11 "images": "allow", |
12 "javascript": "block", | 12 "javascript": "block", |
13 "plugins": "allow", | 13 "plugins": "allow", |
14 "popups": "block", | 14 "popups": "block", |
15 "location": "ask", | 15 "location": "ask", |
16 "notifications": "ask", | 16 "notifications": "ask", |
17 "mouselock": "ask", | 17 "mouselock": "ask", |
18 "mediaStreamMic": "ask", | 18 "mediaStreamMic": "ask", |
| 19 "mediaStreamCamera": "ask", |
19 }; | 20 }; |
20 | 21 |
21 var settings = { | 22 var settings = { |
22 "cookies": "block", | 23 "cookies": "block", |
23 "images": "allow", | 24 "images": "allow", |
24 "javascript": "block", | 25 "javascript": "block", |
25 "plugins": "block", | 26 "plugins": "block", |
26 "popups": "allow", | 27 "popups": "allow", |
27 "location": "block", | 28 "location": "block", |
28 "notifications": "block", | 29 "notifications": "block", |
29 "mouselock": "block", | 30 "mouselock": "block", |
30 "mediaStreamMic": "block" | 31 "mediaStreamMic": "block", |
| 32 "mediaStreamCamera": "block" |
31 }; | 33 }; |
32 | 34 |
33 Object.prototype.forEach = function(f) { | 35 Object.prototype.forEach = function(f) { |
34 var k; | 36 var k; |
35 for (k in this) { | 37 for (k in this) { |
36 if (this.hasOwnProperty(k)) | 38 if (this.hasOwnProperty(k)) |
37 f(k, this[k]); | 39 f(k, this[k]); |
38 } | 40 } |
39 }; | 41 }; |
40 | 42 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 'setting': 'block' | 91 'setting': 'block' |
90 }, chrome.test.callbackFail("Specific paths are not allowed.")); | 92 }, chrome.test.callbackFail("Specific paths are not allowed.")); |
91 cs.javascript.set({ | 93 cs.javascript.set({ |
92 'primaryPattern': 'http://example.com/*', | 94 'primaryPattern': 'http://example.com/*', |
93 'secondaryPattern': 'file:///home/hansmoleman/*', | 95 'secondaryPattern': 'file:///home/hansmoleman/*', |
94 'setting': 'allow' | 96 'setting': 'allow' |
95 }, chrome.test.callbackFail( | 97 }, chrome.test.callbackFail( |
96 "Path wildcards in file URL patterns are not allowed.")); | 98 "Path wildcards in file URL patterns are not allowed.")); |
97 } | 99 } |
98 ]); | 100 ]); |
OLD | NEW |