Debian Codegraph @

closure-library/closure/goog/storage/mechanism/mechanismfactory_test.js

raw
1 // Copyright 2011 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 goog.provide('goog.storage.mechanism.mechanismfactoryTest');
16 goog.setTestOnly('goog.storage.mechanism.mechanismfactoryTest');
17
18 goog.require('goog.storage.mechanism.mechanismfactory');
19 goog.require('goog.testing.jsunit');
20
21 function setUp() {
22 mechanism = goog.storage.mechanism.mechanismfactory.create('test');
23 mechanism_shared = goog.storage.mechanism.mechanismfactory.create('test');
24 mechanism_separate = goog.storage.mechanism.mechanismfactory.create('test2');
25 }
26
27 function tearDown() {
28 if (!!mechanism) {
29 mechanism.clear();
30 mechanism = null;
31 }
32 if (!!mechanism_shared) {
33 mechanism_shared.clear();
34 mechanism_shared = null;
35 }
36 if (!!mechanism_separate) {
37 mechanism_separate.clear();
38 mechanism_separate = null;
39 }
40 }
41
42 function testAvailability() {
43 var probe = goog.storage.mechanism.mechanismfactory.create();
44 if (!!probe) {
45 assertNotNull(mechanism);
46 assertNotNull(mechanism_shared);
47 assertNotNull(mechanism_separate);
48 }
49 }