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 "fullscreen": "ask", |
17 "mouselock": "ask", | 18 "mouselock": "ask", |
18 "microphone": "ask", | 19 "microphone": "ask", |
19 "camera": "ask", | 20 "camera": "ask", |
20 }; | 21 }; |
21 | 22 |
22 var settings = { | 23 var settings = { |
23 "cookies": "block", | 24 "cookies": "block", |
24 "images": "allow", | 25 "images": "allow", |
25 "javascript": "block", | 26 "javascript": "block", |
26 "plugins": "block", | 27 "plugins": "block", |
27 "popups": "allow", | 28 "popups": "allow", |
28 "location": "block", | 29 "location": "block", |
29 "notifications": "block", | 30 "notifications": "block", |
| 31 "fullscreen": "allow", |
30 "mouselock": "block", | 32 "mouselock": "block", |
31 "microphone": "block", | 33 "microphone": "block", |
32 "camera": "block" | 34 "camera": "block" |
33 }; | 35 }; |
34 | 36 |
35 Object.prototype.forEach = function(f) { | 37 Object.prototype.forEach = function(f) { |
36 var k; | 38 var k; |
37 for (k in this) { | 39 for (k in this) { |
38 if (this.hasOwnProperty(k)) | 40 if (this.hasOwnProperty(k)) |
39 f(k, this[k]); | 41 f(k, this[k]); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 'setting': 'block' | 93 'setting': 'block' |
92 }, chrome.test.callbackFail("Specific paths are not allowed.")); | 94 }, chrome.test.callbackFail("Specific paths are not allowed.")); |
93 cs.javascript.set({ | 95 cs.javascript.set({ |
94 'primaryPattern': 'http://example.com/*', | 96 'primaryPattern': 'http://example.com/*', |
95 'secondaryPattern': 'file:///home/hansmoleman/*', | 97 'secondaryPattern': 'file:///home/hansmoleman/*', |
96 'setting': 'allow' | 98 'setting': 'allow' |
97 }, chrome.test.callbackFail( | 99 }, chrome.test.callbackFail( |
98 "Path wildcards in file URL patterns are not allowed.")); | 100 "Path wildcards in file URL patterns are not allowed.")); |
99 } | 101 } |
100 ]); | 102 ]); |
OLD | NEW |