Index: chrome/test/data/extensions/api_test/sync_file_system/conflict_resolution_policy/test.js |
diff --git a/chrome/test/data/extensions/api_test/sync_file_system/conflict_resolution_policy/test.js b/chrome/test/data/extensions/api_test/sync_file_system/conflict_resolution_policy/test.js |
index 6226198379368e710c8b7d4faabe516854af42c4..30f7e0ddcc3dc5231c70c1facfd9001183d98bb2 100644 |
--- a/chrome/test/data/extensions/api_test/sync_file_system/conflict_resolution_policy/test.js |
+++ b/chrome/test/data/extensions/api_test/sync_file_system/conflict_resolution_policy/test.js |
@@ -2,33 +2,29 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+var callbackPass = chrome.test.callbackPass; |
+var callbackFail = chrome.test.callbackFail; |
+ |
var testStep = [ |
- function testManualPolicy() { |
- testConflictResolutionPolicy('manual', testStep.shift()); |
+ function testNonDefaultConflictResolutionPolicy() { |
+ chrome.syncFileSystem.setConflictResolutionPolicy( |
+ 'manual', |
+ callbackFail('Policy manual is not supported.', testStep.shift())); |
+ }, |
+ function setConflictResolutionPolicy() { |
+ chrome.syncFileSystem.setConflictResolutionPolicy( |
+ 'last_write_win', callbackPass(testStep.shift())); |
}, |
- function testLastWriteWinPolicy() { |
- testConflictResolutionPolicy('last_write_win', chrome.test.callbackPass()); |
+ function getConflictResolutionPolicy() { |
+ chrome.syncFileSystem.getConflictResolutionPolicy( |
+ callbackPass(testStep.shift())); |
}, |
+ function checkConflictResolutionPolicy(policy_returned) { |
+ chrome.test.assertEq('last_write_win', policy_returned); |
+ chrome.test.succeed(); |
+ } |
]; |
-function testConflictResolutionPolicy(policy, callback) { |
- var steps = [ |
- function setManualPolicy() { |
- chrome.syncFileSystem.setConflictResolutionPolicy( |
- policy, chrome.test.callbackPass(steps.shift())); |
- }, |
- function getManualPolicy() { |
- chrome.syncFileSystem.getConflictResolutionPolicy( |
- chrome.test.callbackPass(steps.shift())); |
- }, |
- function checkManualPolicy(policy_returned) { |
- chrome.test.assertEq(policy, policy_returned); |
- callback(); |
- } |
- ]; |
- steps.shift()(); |
-} |
- |
chrome.test.runTests([ |
testStep.shift() |
]); |