OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 // System API test |
| 3 // Run with browser_tests --gtest_filter=ExtensionApiTest.SystemApi |
| 4 |
| 5 function expect(expected, message) { |
| 6 return chrome.test.callbackPass(function(value) { |
| 7 chrome.test.assertEq(expected, value, message); |
| 8 }); |
| 9 } |
| 10 |
| 11 chrome.test.runTests([ |
| 12 function readOnlyGetTest() { |
| 13 chrome.systemPrivate.incognitoModeAvailability.get({}, expect( |
| 14 {value: 'disabled', levelOfControl: 'not_controllable'}, |
| 15 "Pref `chrome.windows.incognitoModeAvailability` is expected to be " + |
| 16 "'disabled'")); |
| 17 }, |
| 18 function readOnlySetTest() { |
| 19 chrome.systemPrivate.incognitoModeAvailability.set( |
| 20 {value: 'enabled'}, |
| 21 chrome.test.callbackFail("You cannot modify the read-only preference " + |
| 22 "'incognitoModeAvailability'.")); |
| 23 } |
| 24 ]); |
| 25 </script> |
OLD | NEW |