OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 // Content settings API test |
| 3 // Run with browser_tests --gtest_filter=ExtensionApiTest.ContentSettings |
| 4 |
| 5 var cs = chrome.experimental.contentSettings; |
| 6 function expect(expected, message) { |
| 7 return chrome.test.callbackPass(function(value) { |
| 8 chrome.test.assertBool(value, expected, message); |
| 9 }); |
| 10 } |
| 11 chrome.test.runTests([ |
| 12 function testIncognito() { |
| 13 cs.misc.blockThirdPartyCookies.get( |
| 14 {}, expect(false, "third-party cookies should not be blocked")); |
| 15 cs.misc.blockThirdPartyCookies.get( |
| 16 { 'incognito': true }, |
| 17 expect(false, |
| 18 "third-party cookies should not be blocked in incognito mode")); |
| 19 cs.misc.blockThirdPartyCookies.set( |
| 20 { 'incognito': true, 'value': true }, chrome.test.callbackPass()); |
| 21 cs.misc.blockThirdPartyCookies.get( |
| 22 {}, expect(false, "third-party cookies should not be blocked")); |
| 23 cs.misc.blockThirdPartyCookies.get( |
| 24 { 'incognito': true }, |
| 25 expect(true, |
| 26 "third-party cookies should be blocked in incognito mode")); |
| 27 }, |
| 28 ]); |
| 29 </script> |
OLD | NEW |