- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / sync_file_system / conflict_resolution_policy / test.js
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var testStep = [
6   function testManualPolicy() {
7     testConflictResolutionPolicy('manual', testStep.shift());
8   },
9   function testLastWriteWinPolicy() {
10     testConflictResolutionPolicy('last_write_win', chrome.test.callbackPass());
11   },
12 ];
13
14 function testConflictResolutionPolicy(policy, callback) {
15   var steps = [
16     function setManualPolicy() {
17       chrome.syncFileSystem.setConflictResolutionPolicy(
18           policy, chrome.test.callbackPass(steps.shift()));
19     },
20     function getManualPolicy() {
21       chrome.syncFileSystem.getConflictResolutionPolicy(
22           chrome.test.callbackPass(steps.shift()));
23     },
24     function checkManualPolicy(policy_returned) {
25       chrome.test.assertEq(policy, policy_returned);
26       callback();
27     }
28   ];
29   steps.shift()();
30 }
31
32 chrome.test.runTests([
33   testStep.shift()
34 ]);