Index: chrome/test/data/extensions/api_test/platform_keys/basic.js |
diff --git a/chrome/test/data/extensions/api_test/platform_keys/basic.js b/chrome/test/data/extensions/api_test/platform_keys/basic.js |
index 5e7b45233e851c3febd63c54a5c6c7a433e98d35..106609fd2eb4fb5b425501fef9040dbfdc5b1c0b 100644 |
--- a/chrome/test/data/extensions/api_test/platform_keys/basic.js |
+++ b/chrome/test/data/extensions/api_test/platform_keys/basic.js |
@@ -174,7 +174,8 @@ function checkPropertyIsReadOnly(object, key) { |
var original = object[key]; |
try { |
object[key] = {}; |
- fail('Expected the property to be read-only and an exception to be thrown'); |
+ fail('Expected the property ' + key + |
+ ' to be read-only and an exception to be thrown'); |
} catch (error) { |
assertEq(original, object[key]); |
} |
@@ -515,7 +516,6 @@ function testVerifyUntrusted() { |
} |
var testSuites = { |
- // These tests assume already granted permissions for client_1 and client_2. |
// On interactive selectClientCertificates calls, the simulated user does not |
// select any cert. |
basicTests: function() { |
@@ -551,7 +551,6 @@ var testSuites = { |
chrome.test.runTests(tests); |
}, |
- // This test suite starts without any granted permissions. |
// On interactive selectClientCertificates calls, the simulated user selects |
// client_1, if matching. |
permissionTests: function() { |
@@ -580,7 +579,53 @@ var testSuites = { |
]; |
chrome.test.runTests(tests); |
- } |
+ }, |
+ |
+ managedProfile: function() { |
+ var tests = [ |
+ // If the profile is managed, the user cannot grant permissions for any |
+ // certificates. |
+ testInteractiveSelectNoCerts |
+ ]; |
+ chrome.test.runTests(tests); |
+ }, |
+ |
+ corporateKeyWithoutPermissionTests: function() { |
+ var tests = [ |
+ // Directly trying to sign must fail |
+ testSignClient1Fails, |
+ |
+ // Interactively selecting must not show any cert to the user. |
+ testInteractiveSelectNoCerts, |
+ ]; |
+ chrome.test.runTests(tests); |
+ }, |
+ |
+ corporateKeyWithPermissionTests: function() { |
+ var tests = [ |
+ // The extension has non-interactive access to all corporate keys, even |
+ // without previous additional consent of the user. |
+ testSignSha1Client1, |
+ |
+ // Interactively selecting for client_1 will work as well. |
+ testInteractiveSelectClient1, |
+ ]; |
+ chrome.test.runTests(tests); |
+ }, |
+ |
+ untaggedKeyWithUnrelatedPermissionTests: function() { |
+ // The permission from policy must not affect usage of non-corproate keys. |
+ var tests = [ |
+ // Attempts to sign must fail. |
+ testSignClient1Fails, |
+ |
+ // Interactive selection must not prompt the user and not return any |
+ // certificate. |
+ testInteractiveSelectNoCerts, |
+ ]; |
+ chrome.test.runTests(tests); |
+ }, |
+ |
}; |
setUp(testSuites[selectedTestSuite]); |