| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 // Content settings API test | 2 // Content settings API test |
| 3 // Run with browser_tests --gtest_filter=ExtensionApiTest.ContentSettingsClear | 3 // Run with browser_tests --gtest_filter=ExtensionApiTest.PreferenceClear |
| 4 | 4 |
| 5 var cs = chrome.experimental.contentSettings; | 5 var pw = chrome.experimental.privacy.websites; |
| 6 chrome.test.runTests([ | 6 chrome.test.runTests([ |
| 7 function getThirdPartyCookiesAllowed() { | 7 function getThirdPartyCookiesAllowed() { |
| 8 cs.global.thirdPartyCookiesAllowed.get({}, chrome.test.callbackPass( | 8 pw.thirdPartyCookiesAllowed.get({}, chrome.test.callbackPass( |
| 9 function(allowed) { | 9 function(allowed) { |
| 10 chrome.test.assertEq( | 10 chrome.test.assertEq( |
| 11 allowed, | 11 allowed, |
| 12 { | 12 { |
| 13 'value': false, | 13 'value': false, |
| 14 'levelOfControl': "controllable_by_this_extension" | 14 'levelOfControl': "controllable_by_this_extension" |
| 15 }, | 15 }, |
| 16 "third-party cookies should be blocked"); | 16 "third-party cookies should be blocked"); |
| 17 })); | 17 })); |
| 18 }, | 18 }, |
| 19 function setThirdPartyCookiesAllowed() { | 19 function setThirdPartyCookiesAllowed() { |
| 20 cs.global.thirdPartyCookiesAllowed.set( | 20 pw.thirdPartyCookiesAllowed.set( |
| 21 {'value': true}, | 21 {'value': true}, |
| 22 chrome.test.callbackPass()); | 22 chrome.test.callbackPass()); |
| 23 }, | 23 }, |
| 24 function clearThirdPartyCookiesAllowed() { | 24 function clearThirdPartyCookiesAllowed() { |
| 25 cs.global.thirdPartyCookiesAllowed.clear({}, chrome.test.callbackPass()); | 25 pw.thirdPartyCookiesAllowed.clear({}, chrome.test.callbackPass()); |
| 26 }, | 26 }, |
| 27 function getThirdPartyCookiesAllowed2() { | 27 function getThirdPartyCookiesAllowed2() { |
| 28 cs.global.thirdPartyCookiesAllowed.get({}, chrome.test.callbackPass( | 28 pw.thirdPartyCookiesAllowed.get({}, chrome.test.callbackPass( |
| 29 function(allowed) { | 29 function(allowed) { |
| 30 chrome.test.assertEq( | 30 chrome.test.assertEq( |
| 31 allowed, | 31 allowed, |
| 32 { | 32 { |
| 33 'value': false, | 33 'value': false, |
| 34 'levelOfControl': "controllable_by_this_extension" | 34 'levelOfControl': "controllable_by_this_extension" |
| 35 }, | 35 }, |
| 36 "third-party cookies should be blocked"); | 36 "third-party cookies should be blocked"); |
| 37 })); | 37 })); |
| 38 } | 38 } |
| 39 ]); | 39 ]); |
| 40 </script> | 40 </script> |
| OLD | NEW |