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